Installing dplyr, caret and do Parallel packages

Hi, I am a newbie and this thing is driving me crazy. I try to install the packages and I am receiving the following messages, what can I do differently to install these packages?

install.packages("dplyr", lib = "C:/Users/ahmed/Documents/R/win-library/4.0")
install.packages("caret", lib = "C:/Users/ahmed/Documents/R/win-library/4.0")
install.packages("doParallel", lib = "C:/Users/ahmed/Documents/R/win-library/4.0")

trying URL ''
Content type 'application/zip' length 1309084 bytes (1.2 MB)
downloaded 1.2 MB

package ‘dplyr’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in

This message shows that dplyr was properly installed. Are you having trouble using the package?

so when I try to run my code, I receive the following message

could not find function "%>%"

is it because the library is not installed?

Once you have installed a package, you need to load it into your session in order to use functions from the package. To use dplyr for example, you would call library(dplyr) at the top of your script.

I have done that,

install.packages("dplyr", lib = "/Users/ahmed/Documents/R/win-library/4.0")
install.packages("caret", lib = "/Users/ahmed/Documents/R/win-library/4.0")
install.packages("doParallel", lib = "/Users/ahmed/Documents/R/win-library/4.0")

Then when I run this, I receive this message

Attaching package: �dplyr�

The following objects are masked from �package:stats�:

filter, lag

I understand that filter function from dplyr will be applied first,

but when I try to run this code

flightsNotCancelled = df %>%
filter(CANCELLED == 0) %>%

I receive the following error

Error in UseMethod("filter_") : no applicable method for 'filter_' applied to an object of class "NULL"

What defines the df object in your code?

This topic was automatically closed 21 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.