对于R中的循环警告:要替换的项目数不是替换长度的倍数

时间:2017-08-22 22:17:52

标签: r loops for-loop

这是我的代码,我想知道为什么有警告信息说“要替换的项目数量不是替换长度的倍数”?

public class Settings
{
    private BunifuCustomTextbox xOffsetTB;
    private BunifuCustomTextbox yOffsetTB;
    private BunifuCustomTextbox scanIntervalTB;
    private BunifuCustomTextbox rClickIntervalTB;
    private BunifuCustomTextbox snipeWatiTimeTB;
    private BunifuCustomTextbox arrowWaitTimeTB;
    private BunifuCheckbox closeRangeRClickCB;
    private BunifuCheckbox longRangeRClickCB;
    private BunifuCheckbox closeRangeLClickCB;
    private BunifuCheckbox longRangeLClickCB;
    private BunifuSwitch kinessaModeCB;
    private BunifuSwitch shalinModeCB;
    private BunifuiOSSwitch DrawCB;
    private BunifuiOSSwitch DisableOnShiftCB;

    public int xOffset { get; set; }
    public int yOffset { get; set; }
    public int scanInterval { get; set; }
    public int rClickInterval { get; set; }
    public int snipeWaitTime { get; set; }
    public int arrowWaitTime { get; set; }
    public bool closeRangeRClick { get; set; }
    public bool longRangeRClick { get; set; }
    public bool closeRangeLClick { get; set; }
    public bool kinessaMode { get; set; }
    public bool shalinMode { get; set; }
    public bool draw { get; set; }
    public bool disableOnShift { get; set; }

}

看起来很有效,但我对这些警告信息感到好奇。

谢谢!

1 个答案:

答案 0 :(得分:1)

我认为问题可能出在Julian_data_first_expose+365*(i-1)。这似乎返回一个向量,而不是单个值,是你想要的吗?我对您的预期代码的猜测是Julian_data_first_expose[i] +365*(i-1)