knitr in R Markdown failing to recognise standard commands

19 Views Asked by At

This code works fine in R script but fails in R Markdown

#Examine and clean data file
colnames(act_dat)  # Read the column names
View(act_dat)
act_dat <- clean_names(act_dat)  # Clean the names
colnames(act_dat)  # Review the results

I get the following error message Quitting from lines 55-60 [chunk 3] Error in clean_names(): ! could not find function "clean_names" Execution halted

What is wrong?

I ran the code in an R Script file and it worked entirely

I ran it in R Markdown and it stopped at view(act_data) but when I changed it o View(act_data) it got as far as act_dat <- clean_names(act_dat) and stopped with the message: ! could not find function "clean_names"

0

There are 0 best solutions below