Cannot download the 'clean_names' package

I want to use the clean_names function , I have downloaded the 'janitor' package for this function but R returns this message.
> clean_names(penguins)
Error in clean_names(penguins) : could not find function "clean_names"

so i tried this, and it is still not working
> install.packages('clean_names',repos='http://cran.us.r-project.org')
Installing package into ‘C:/Users/Wind/Documents/R/win-library/4.1’
(as ‘lib’ is unspecified)
Warning in install.packages :
** package ‘clean_names’ is not available for this version of R**

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

Can anyone please tell me how to fix this?

This doesn't work because clean_names() is a function not a package.

You have to load the package first and then use the function

# Load the package
library(janitor)

# Then use the function 
clean_names(penguins)

If that doesn't work then most likely you haven't installed janitor successfully as you think and we will need to see the error message you get in order to help you out.

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.