Get access to all lessons in this course.
Getting Started with R
Files in R
This lesson is locked
This lesson is called Files in R, part of the Getting Started with R course. This lesson is called Files in R, part of the Getting Started with R 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.
Your Turn
Create and save an R script file
Enter a mathematical expression on your R script file and run it
You need to be signed-in to comment on this post. Login.
Benoit Gauthier
January 11, 2022
Hi. Out of curiosity, I tried to install.packages("tidyverse"). After several minutes of output, it ended on an error with dependencies (googledrive, googlesheets4, haven, httr, rvest, xml2) and the removal of the package. What to do then?
Benoit Gauthier
January 11, 2022
skimr installed fine.
David Keyes
January 11, 2022
Could you paste the error message please?
Benoit Gauthier
January 12, 2022
R version 4.1.2 (2021-11-01) -- "Bird Hippie" Copyright (C) 2021 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit)
R est un logiciel libre livré sans AUCUNE GARANTIE. Vous pouvez le redistribuer sous certaines conditions. Tapez 'license()' ou 'licence()' pour plus de détails.
R est un projet collaboratif avec de nombreux contributeurs. Tapez 'contributors()' pour plus d'information et 'citation()' pour la façon de le citer dans les publications.
Tapez 'demo()' pour des démonstrations, 'help()' pour l'aide en ligne ou 'help.start()' pour obtenir l'aide au format HTML. Tapez 'q()' pour quitter R.
> install.packages("tidyverse") Installation du package dans ‘/home/benoit/R/x86_64-pc-linux-gnu-library/4.1’ (car ‘lib’ n'est pas spécifié) installation des dépendances ‘gargle’, ‘curl’, ‘ids’, ‘openssl’, ‘googledrive’, ‘googlesheets4’, ‘haven’, ‘httr’, ‘rvest’, ‘xml2’
essai de l'URL 'https://cloud.r-project.org/src/contrib/gargle_1.2.0.tar.gz' Content type 'application/x-gzip' length 313418 bytes (306 KB)
downloaded 306 KB
essai de l'URL 'https://cloud.r-project.org/src/contrib/curl_4.3.2.tar.gz' Content type 'application/x-gzip' length 793345 bytes (774 KB)
downloaded 774 KB
essai de l'URL 'https://cloud.r-project.org/src/contrib/ids_1.0.1.tar.gz' Content type 'application/x-gzip' length 91213 bytes (89 KB)
downloaded 89 KB
essai de l'URL 'https://cloud.r-project.org/src/contrib/openssl_1.4.6.tar.gz' Content type 'application/x-gzip' length 1198268 bytes (1.1 MB)
downloaded 1.1 MB
essai de l'URL 'https://cloud.r-project.org/src/contrib/googledrive_2.0.0.tar.gz' Content type 'application/x-gzip' length 1593656 bytes (1.5 MB)
downloaded 1.5 MB
essai de l'URL 'https://cloud.r-project.org/src/contrib/googlesheets4_1.0.0.tar.gz' Content type 'application/x-gzip' length 222038 bytes (216 KB)
downloaded 216 KB
essai de l'URL 'https://cloud.r-project.org/src/contrib/haven_2.4.3.tar.gz' Content type 'application/x-gzip' length 296805 bytes (289 KB)
downloaded 289 KB
essai de l'URL 'https://cloud.r-project.org/src/contrib/httr_1.4.2.tar.gz' Content type 'application/x-gzip' length 159950 bytes (156 KB)
downloaded 156 KB
essai de l'URL 'https://cloud.r-project.org/src/contrib/rvest_1.0.2.tar.gz' Content type 'application/x-gzip' length 94357 bytes (92 KB)
downloaded 92 KB
essai de l'URL 'https://cloud.r-project.org/src/contrib/xml2_1.3.3.tar.gz' Content type 'application/x-gzip' length 283965 bytes (277 KB)
downloaded 277 KB
essai de l'URL 'https://cloud.r-project.org/src/contrib/tidyverse_1.3.1.tar.gz' Content type 'application/x-gzip' length 702779 bytes (686 KB)
downloaded 686 KB
libcurl.pc' to the PKG_CONFIG_PATH environment variable No package 'libcurl' found Package libcurl was not found in the pkg-config search path. Perhaps you should add the directory containing
libcurl.pc' to the PKG_CONFIG_PATH environment variable No package 'libcurl' found Using PKG_CFLAGS= Using PKG_LIBS=-lcurl ------------------------- ANTICONF ERROR --------------------------- Configuration failed because libcurl was not found. Try installing:ERROR: configuration failed for package ‘curl’
ERROR: configuration failed for package ‘openssl’
libxml-2.0.pc' to the PKG_CONFIG_PATH environment variable No package 'libxml-2.0' found Package libxml-2.0 was not found in the pkg-config search path. Perhaps you should add the directory containing
libxml-2.0.pc' to the PKG_CONFIG_PATH environment variable No package 'libxml-2.0' found Using PKG_CFLAGS= Using PKG_LIBS=-lxml2 ------------------------- ANTICONF ERROR --------------------------- Configuration failed because libxml-2.0 was not found. Try installing:ERROR: configuration failed for package ‘xml2’
David Keyes
January 12, 2022
So it seems like some packages that are dependencies of tidyverse (i.e. packages that the tidyverse relies on for certain functions) didn't install correctly. What operating system are you using?
Benoit Gauthier
January 12, 2022
Ubuntu 18.04.6 LTS
Benoit Gauthier
January 13, 2022
After some googling around, I found that some (3) packages needed be installed in Ubuntu itself (libcurl4-openssl-dev, libxml2-dev, libssl-dev). The dependency verification process built into R did not take care of these installations. I'm good now.
Delia Ayled Serna Guerrero
March 20, 2022
Hi! I am having the following warning:
WARNING: Rtools is required to build R packages but is not currently installed. Please download and install the appropriate version of Rtools before proceeding:
But still doing what its needed, should I be worried?
Charlie Hadley
March 21, 2022
Hi Delia. RTools is a collection of compilers and other things that are not installed by default on Windows and are occasionally required when using R. Unfortunately, it's not always clear that something isn't working because RTools is missing. So I'd recommend installing it at the beginning so it's just there. Thanks, Charlotte
Delia Ayled Serna Guerrero
March 23, 2022
Oh perfect! Thanks!
NIKHIL RATNA
July 19, 2022
I see this error. Error in install.packages : object 'tidyverse' not found
NIKHIL RATNA
July 19, 2022
I am sorry, its a syntax error.
Charlie Hadley
July 19, 2022
Yup! Almost all functions for manipulating packages require package names in quotation marks (ie, as a string). The only exception is library(tidyverse)
NIKHIL RATNA
July 19, 2022
Do you want to install from sources the packages which need compilation?
what does that mean and what should I answer. I am going with yes for now
Charlie Hadley
July 19, 2022
Hi Nikhil,
This is a useful thread that goes into lots of detail about what installing from source means.
It's almost always okay to say "yes", provided you have the necessary tooling for installing from source. On macOS and Linux this tooling is almost always going to be correctly configured on your system. Whereas on Windows you would need to install RTools and there might be some additional configuration required.
If installing from source fails select "no" instead. If this means the code you're trying to work truly depends on installing from source you'll have errors. These can be fixed by either waiting 2 days for CRAN to update or else to investigate what's wrong with your tooling - but that can get quite complicated.
Cheers,
Charlie
Shannon Peery
August 29, 2022
After starting a new project (for my work) and the 'getting started' master for this course, I still do not have a 'scripts' window in either project. All other three windows are there: Console/Terminal, Environment/History & Files/Plots/Packages/Help. Why am I missing the Scripts window?
Shannon Peery
August 29, 2022
Sorry, answered my previous question - had to do 'New File' & Script for that box to pop up.
Charlie Hadley
August 30, 2022
No worries!
Yasemin Akbaba
February 14, 2023
I get the following error message: install packages “tidyverse” Error: unexpected symbol in "install packages"
David Keyes
February 14, 2023
Do you have a space between install and packages? If so, replace that with a period:
install.packages("tidyverse")
Yasemin Akbaba
February 15, 2023
This worked! Thanks.