DC密度()错误 - "缺少值,其中需要TRUE / FALSE"

时间:2017-12-04 05:16:25

标签: r

当我对我的数据运行DCdensity()函数时,出现以下错误:

Error in if (sum(runvar > cutpoint - bw & runvar < cutpoint) == 0 | sum(runvar <  : 
  missing value where TRUE/FALSE needed

我还没有遇到其他数据的这个问题,这让我觉得这个特定的数据集产生了问题。这是可重现的代码:

var <- c(2563174000,
      2256095000,
      1930871000,
      1864063000,
      906536000,
      841016000,
      463844000,
      372356961,
      354815000,
      350592894,
      348630222,
      307796506,
      290368783,
      238275985,
      221192000,
      220601000,
      215029032,
      207318106,
      190921000,
      179007000,
      166989000,
      164345000,
      153026548,
      151993220,
      151274678,
      150578246,
      147045325,
      142770493,
      141066725,
      139734517,
      136362224,
      134755695,
      130338914,
      125605692,
      124778399,
      120896567,
      101406779,
      93756555,
      91139816,
      87003919,
      71630277,
      65446163,
      58752906,
      50478905,
      48435297,
      48347658,
      43022924,
      42508000,
      41243000,
      40609600,
      35926782,
      35599867,
      34769850,
      34546897,
      33433425,
      32515199,
      30753726,
      30687966,
      30233543,
      29769025,
      29372722,
      28993736,
      26931198,
      26641954,
      26187130,
      25630310,
      25257784,
      25103719,
      24454242,
      24334331,
      23760757,
      23449350,
      23119713,
      22301267,
      22246890,
      22070813,
      21790727,
      20886154,
      20353599,
      19965057,
      19641299,
      19592309,
      19571511,
      19533575,
      19035600,
      18844745,
      18781405,
      17337331,
      17311771,
      16981292,
      16035310,
      15969162,
      15381499,
      15083998,
      14957312,
      14853446,
      14579900,
      14336785,
      14148340,
      13969140,
      13909138,
      13859217,
      13525531,
      13288573,
      12850989,
      12807279,
      12693805,
      12234645,
      12035222,
      11913800,
      11854709,
      11466184,
      11154441,
      10884046,
      10883620,
      10872228,
      10840568,
      10575531,
      10365768,
      10199820,
      10100100)

df <- data.frame(var)

DCdensity(df$var, 50000000)

任何想法是什么问题?有什么想法是什么问题?有什么想法是什么问题?任何想法是什么问题?

0 个答案:

没有答案