0

enter image description here

As the pictures shows, I need to get a input as depth1, I generated an Named num array as depth2 but it doesn't work for the input (would cause error..)

flyboyleo
  • 51
  • 3
  • what is the error – rawr Aug 07 '20 at 19:21
  • @rawr "Error in if (all(sign(colors) >= 0)) { : missing value where TRUE/FALSE needed Calls: ... withCallingHandlers -> withVisible -> eval -> eval -> " actually no value is 0, all positive values. – flyboyleo Aug 07 '20 at 19:28
  • seems like colors has NA values, `sum(is.na(colors))` – rawr Aug 07 '20 at 19:31
  • @rawr sum(is.na(depth1)) [1] 0 > sum(is.na(depth2)) [1] 0 – flyboyleo Aug 07 '20 at 19:36
  • But what about your color vector? your if else references colors not depth1 or 2 – NotThatKindODr Aug 07 '20 at 19:54
  • @NotThatKindODr color is identical as depth2. – flyboyleo Aug 07 '20 at 20:18
  • does depth1 have a weird typeof() or class() – NotThatKindODr Aug 07 '20 at 20:32
  • Nope.. @NotThatKindODr – flyboyleo Aug 07 '20 at 20:40
  • can you dput(depth1) and add it to your question along with the if-else code? – NotThatKindODr Aug 07 '20 at 20:42
  • 2
    It's easier to help you if you include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input and desired output that can be used to test and verify possible solutions. It's unclear what code you are actually running. Also it's unclear if the problem is just with how RStudio is displaying the variable or if it's the object itself. A reproducible example would clear that up. – MrFlick Aug 07 '20 at 20:42

1 Answers1

0

Solved finally. I checked the input, it's because the rownames I output with triple quote marks somehow, thus RStudio could recognize & convert it correctly but Rmarkdown engine can't.. To this issue, named Num related to that rownames..

flyboyleo
  • 51
  • 3