openplantpathology / Mungbean_PM

A meta-analysis of mungbean powdery mildew control fungicide efficacy trials
https://openplantpathology.github.io/Mungbean_PM/
Creative Commons Zero v1.0 Universal
1 stars 0 forks source link

Issue with `same()` comparing value against vector, stops knitting #31

Closed adamhsparks closed 4 years ago

adamhsparks commented 4 years ago

@Paul Melloy, there's an issue in your function, same(), or at least how you've used it here: https://github.com/openplantpathology/Mungbean_PM/blob/df0eaf7cb7b3ab85ee86b8d603f2cbb57f46a97b/03_Prep_data.Rmd#L235

It results in an error when I try to use it. It's because you're comparing something of length 1 with a vector of length 173 and so it takes only the first value of that vector, which may be what you want but it's not programmed correctly that I can tell.

master* > str(clusters[i, "cluster_1"])
 chr "Late"
master* > str(slim_PM_dat$cluster_1)
 chr [1:173] "Late" "Recommended" "Late" "Recommended" "Late" ...
master* 
PaulMelloy commented 4 years ago

I am aware of this warning. I was hoping just changing the chunk to not report errors would be a work around.

adamhsparks commented 4 years ago

Changing the code chunk doesn't fix the issue. It's not programmed to do what you want it to do. It should be fixed.

adamhsparks commented 4 years ago

Closed with https://github.com/openplantpathology/Mungbean_PM/commit/7965a766fcddd72c8c225ede0f6c7981e641d9e9