Packages
This lesson is called Packages, part of the R in 3 Months (Spring 2026) course. This lesson is called Packages, part of the R in 3 Months (Spring 2026) course.
Transcript
Click on the transcript to go to that point in the video. Please note that transcripts are auto generated and may contain minor inaccuracies.
Loading transcript...
Your Turn
Working in the console, install the
tidyversepackage using the codeinstall.packages("tidyverse")Check in the Packages tab in the activity bar to confirm that the
tidyversepackage has been installed successfully
If you are a Windows user and get messages about downloading RTools, you can safely ignore these. You should not need RTools to install packages used in this course.
Also for Windows users, if you hit an error that says 'lib = "C:/Program Files/R/R-4.5.3/library"' is not writable, try configuring your library folder under your user folder, not the Program Files system folder (which is often not writable). Do these steps before installing packages:
In the Console, copy and paste the following, then hit enter:
file.edit("~/.Rprofile")
This will open a text file that is the configuration of your profile for R.
Copy the following text in the document and save it to the root directory on your computer (usually something like
C:\Users\YourName):
user_lib <- file.path(
Sys.getenv("LOCALAPPDATA"),
"R",
paste(R.version$major, R.version$minor, sep = "."),
"library"
)
if (!dir.exists(user_lib)) {
dir.create(user_lib, recursive = TRUE)
}
.libPaths(c(user_lib, .libPaths()))
Restart your session and check if the process worked by running
.libPaths()on the console. If you see something like"C:/Users/YourName/AppData/Local/R/win-library/4.5"on the list of results, you should be all set. Try installing a package and load it to make sure it works.
Learn More
If you want to read about the various packages that make up the Tidyverse, check out its website.
Have any questions? Put them below and we will help you out!
Course Content
148 Lessons
You need to be signed-in to comment on this post. Login.
Bonnie Wagner • March 12, 2026
Hello. I receive the following error on task 1 above. Warning in install.packages("tidyverse") : 'lib = "C:/Program Files/R/R-4.5.3/library"' is not writable
Gracielle Higino Coach • March 12, 2026
Hi Bonnie! Are you using a work computer? This is usually common when you don't have permissions to access certain sections of your machine. One alternative would be to tell R to read packages from another location, one that you know you can record data to. Try updating your
.Rprofilefile with the following steps:You can also test running R as an administrator.
Let me know if this works! If it's still buggy, we can schedule a meeting to go through it together.
Bonnie Wagner • March 13, 2026
Hi Gracielle. I am using my personal computer. I tried pasting what you have below in the console, saved and restarted, and I received the following error: Warning in install.packages("tidyverse") : 'lib = "C:/Program Files/R/R-4.5.3/library"' is not writable
Kathy Worley • September 21, 2026
Hi I also get this warning and need assistance Warning in install.packages("tidyverse") : 'lib = "C:/Program Files/R/R-4.6.1/library"' is not writable
Gracielle Higino Coach • September 22, 2026
Hi Kathy! I have added instructions to try to solve this problem for Windows users. Basically you need to tell R to install packages in another location on your computer. With the process I added now, you don't need to add your folder path manually, which might avoid typing errors. Let me know if it doesn't work and I'll find another solution! Also, feel free to book a meeting with me to debug this together.
Mallik Janthak • September 19, 2026
Hello! I received the same error message as below on install.packages("tidyverse") on a Windows laptop and got the same error message. The solution below with .libPaths("Absolute/Path/To/Your/Writable/Directory") did not work.
Gracielle Higino Coach • September 22, 2026
Hi Mallik! I have added instructions to try to solve this problem for Windows users. Basically you need to tell R to install packages in another location on your computer. With the process I added now, you don't need to add your folder path manually, which might avoid typing errors. Let me know if it doesn't work and I'll find another solution! Also, feel free to book a meeting with me to debug this together.
Mallik Janthak • September 22, 2026
I was able to solve the problem on my windows laptop by editing permissions for users of the folder under Security by allowing full control of the folder.
Gracielle Higino Coach • September 22, 2026
Yeah, that's also an option sometimes. I'm glad it worked out for you!