There was an error when using the pipe function. How can this be resolved..

filtered_toothgrowth<- ToothGrowth %>%

  • filter(dose== 0.5) %>%
  • filtered_toothgrowth<- ToothGrowth %>%
  • filter(dose== 0.5) %>% 
    
  • arrange(len)
    

Error in ToothGrowth %>% filter(dose == 0.5) %>% arrange(len) :
could not find function "%>%"

This pipe is loaded with the magrittr package. You can fix this by either loading the whole tidyverse (since you use dplyr functions I guess you are already in this framework) or by loading the package separately with library(magrittr).

Kind regards

Thanks a lot.. Appreciate it.

Regards

Glad I could help you. Consider accepting the answer if the solution was found. :slight_smile:

Hello again,

I have loaded the tidyverse package already so i
tried to load the package "magrittr" but this is what appeared..

A version of this package for your version of R might be available elsewhere,
see the ideas at

What version of R are you running?

You can look at GitHub - tidyverse/magrittr: Improve the readability of R code with the pipe to find more informations about the Installation. Maybe something there can help you, if it is due to version issues.

I have Version 4.05

Noted , will try to look on Github..

This suggests you have tried to install it, not load it. To load it you need to use this command

library(tidyverse) 

tidyverse already imports magrittr so no need to load it separately.

Thanks a lot. Appreciate it.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.