Error - could not find function "mutate"

Hello, Im trying to setup a regression analysis for a school project,

However im getting an error when trying to run some code
Here's what I've got so far.

install.packages("tidyr")
install.packages("tidyverse")
install.packages("ggplot2")
install.packages("rlang")
library(tidyverse)
library(ggplot2)
library(rlang)
library(tidyr)
Df = NaturalGasCSV

head(Df)
Df$Year
Df$Volume

Dummy Variable for CUSFTA Agreement Enactment date of 1989

Df$CUSFTA = Df$Year >= 1989

Df = mutate(Df, NaturalGasCSV = Year >= 1989)
select(Df, Year, NaturalGasCSV)

** This is the error message Im getting **

Df = mutate(Df, CUSFTA = Year >= 1989)
Error in mutate(Df, CUSFTA = Year >= 1989) :
could not find function "mutate"

Any help would be greatly appreciated

Hi, that is a bit strange as mutate should be loaded in the tidyverse.

What do you get when you run sessionInfo()?

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.