I'm taking a course on cleaning data, and need to do swirl exercises using dplyr. I use RStudio (Posit) Cloud, R version Shortstop Beagle (4.2.3). My CRAN mirror is set to "global (CDN) - RStudio".
I've tried installing dplyr inside and outside of swirl, and gotten different errors for those methods.
I've tried to install outside of swirl using:
install.packages("dpylr", repos = 'https://cloud.r-project.org', dependencies = TRUE)
And it gives this error:
Installing package into ‘/cloud/lib/x86_64-pc-linux-gnu-library/4.2’
(as ‘lib’ is unspecified)
Warning in install.packages :
package ‘dpylr’ 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
https://cran.r-project.org/doc/manuals/r-patched/R-admin.html#Installing-packages
I also tried using my local CRAN mirror instead of the global RStudio CRAN and got the same message (and previously I also tried without the repos argument--no change. A different error appeared without the "dependencies" argument but I understand why, so I don't think that's important. If you think it is, let me know and I will provide an example of what happened).
Then, finally, I tried installing from within swirl using these steps:
install.packages("swirl")
(successful)
install_from_swirl("Getting and Cleaning Data")
(successful)
library(swirl)
(successful)
Went through the relevant swirl prompts, then it gave me this:
This lesson requires the ‘dplyr’ package. Would you like me to
| install it for you now?
1: Yes
2: No
I chose "yes" and then this happened:
Trying to install package ‘dplyr’ now...
also installing the dependencies ‘generics’, ‘tidyselect’
| Package ‘dplyr’ loaded correctly!
Error in yaml.load(readLines(con, warn = readLines.warn), error.label = error.label, :
(/cloud/lib/x86_64-pc-linux-gnu-library/4.2/swirl/Courses/Getting_and_Cleaning_Data/Manipulating_Data_with_dplyr/lesson.yaml) Scanner error: while scanning a tag at line 205, column 9 did not find expected whitespace or line break at line 205, column 19
In addition: Warning message:
`tbl_df()` was deprecated in dplyr 1.0.0.
ℹ Please use `tibble::as_tibble()` instead.
ℹ The deprecated feature was likely used in the swirl package.
Please report the issue to the authors.
This warning is displayed once every 8 hours.
Call `lifecycle::last_lifecycle_warnings()` to see where this
warning was generated.
| Leaving swirl now. Type swirl() to resume.
Is it the swirl lesson that's out of date somehow? This course probably isn't monitored, so I'm unlikely to get a response/fix quickly if that's the case--is there anything else I can do in the meantime? It should be noted the swirl exercises don't appear to be part of the grade, so if you have some other suggestion for how to get familiar with dplyr, I'd welcome it!
You have a typo in the first command (installing outside swirl)
The correct one
install.packages("dplyr", repos = 'https://cloud.r-project.org', dependencies = TRUE)
I tested it and it works in posit.cloud
Never the less, I have the same error inside swirl but note the dplyr
package was installed and loaded successfully the error was about a yaml file
for the first lesson 1: Manipulating Data with dplyr
I tested the second one 2: Grouping and Chaining with dplyr looks ok