Hello,
When I plug the created R codes from Julius into RStudio they don’t seem to work for me. My error messages vary however the most common one is an error regarding filter for most of my graphs. Is there a way to solve this?
Thanks
Callum
Hello,
When I plug the created R codes from Julius into RStudio they don’t seem to work for me. My error messages vary however the most common one is an error regarding filter for most of my graphs. Is there a way to solve this?
Thanks
Callum
Hi,
Can you share this error message? This will just give me more context.
Okay, from my understanding is that this error message is triggered when you are trying to use the ‘filter’ function from the ‘dplyr’ package (part of the tidyverse package), but R is interpreting ‘filter’ as something else (i.e., a function or object that exists in another package). This can happen if you have a namespace conflict (i.e., stats package also has filter function, so if it is loaded after dplyr it will mask the filter function from dplyr), or an incorrect object type (applying filter to an object that us not in a data frame or tibble… but it looks like you are using df so I don’t think it is that).
You may be able to override this by using the filter function from the dplyr package explicitly. You can do this by using dplyr::filter → dplyr::filter(your_data_frame, your_condition).
You may already know this, but I’m also gonna place it here for others as well, but you can check for conflicts by using the ls() and then remove it by using rm(filter). You can also check the object type by using class(your_data_frame). If it is not converted into a tibble or data frame, you can do so by doing this:
your_data_frame ← as.data.frame(your_data_frame)
#or
your_data_frame ← as_tibble(your_data_frame)
Is Julius also throwing the same error when you run this code? Or does it troubleshoot it?
Sorry, this is lengthy.
Hi Chris,
Thanks for getting back to me, I tried that and still no luck but when I put the code back into Julius it creates the graphs with no errors.
@chrisdavis92 Is there anyway I can send you the code and dataset to run it? as I am not the best at coding and using RStudio.
if you specify filter as stats::filter does that help at all? Wondering if it’s pulling the wrong filter
@cwijelath, sure! If you want to share the google doc with me that would work. You can DM me by going to the DMs section and send it there if you’d like so that I can be the only one that accesses it. I can attempt to figure it out on my end and see.
But, just curious, if you can run this code seamlessly on Julius, is there any reason as to why you’re re-running it on RStudio? It’s fine that you’re doing so, but I was just curious as to why (hope this does not come off as me being rude, not intending too at all!).
Also, I would give what Matt is suggesting a try first to see if it helps at all.
Hi Chris, thanks for your help I will be in contact soon, Im having to re run the codes in RStudio as the reviewer that’s looking at my paper wants to run the codes himself.
@chrisdavis92 where can I find the DMs section?
Sorry, I meant to share that but forgot. You can find them on the left hand side panel.
I’ll just send you a message, one second.