Unable to install swirl

Windows 10 based computer has following error while trying install swirl

install.packages("swirl")
Installing package into ‘C:/Users/Suresh/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
trying URL 'https://cran.wu.ac.at/bin/windows/contrib/4.0/swirl_2.4.5.zip'
Content type 'application/zip' length 350510 bytes (342 KB)
downloaded 342 KB

package ‘swirl’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
C:\Users\Suresh\AppData\Local\Temp\Rtmpgh12db\downloaded_packages

packageVersion("swirl")
[1] ‘2.4.5’
library(swirl)
Error: package or namespace load failed for ‘swirl’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
there is no package called ‘stringi’

Kindly help me

Hi @suresh.guru,
Welcome to the RStudio Community Forum.

Package swirl depends on package stringr which, in turn, depends on package stringi (hence the last line of your error message). You should be able to solve this by running:

install.packages("swirl", dependencies=TRUE)
library(swirl)

HTH

1 Like

Hi, Thank you for your reply. I am new to R and I sill get the following error.

install.packages("swirl", dependencies=TRUE)
Installing package into ‘C:/Users/Suresh/Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
also installing the dependency ‘stringi’

trying URL 'https://cran.wu.ac.at/bin/windows/contrib/4.0/stringi_1.4.6.zip'
Content type 'application/zip' length 15217051 bytes (14.5 MB)
downloaded 14.5 MB

trying URL 'https://cran.wu.ac.at/bin/windows/contrib/4.0/swirl_2.4.5.zip'
Content type 'application/zip' length 350510 bytes (342 KB)
downloaded 342 KB

package ‘stringi’ successfully unpacked and MD5 sums checked
package ‘swirl’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
C:\Users\Suresh\AppData\Local\Temp\Rtmpgh12db\downloaded_packages

library(swirl)
Error: package or namespace load failed for ‘swirl’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
there is no package called ‘magrittr’

Now you are missing magrittr, you have to install it and repeat this process until you stop getting the "there is no package" error message.

install.packages("magrittr")
1 Like

Hi all,
Thank you all for your support for a beginner. Really amazed to see the instant replies. The problrm finally resolved. Thanks a lot again.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.