Unable to load tidy verse but it is installed

Tidyverse appears in my packages but when I apple library(tidyverse) it won't upload. It says there is no package called 'stringi'

Output:

library(tidyverse)
Error: package or namespace load failed for ‘tidyverse’:
.onAttach failed in attachNamespace() for 'tidyverse', details:
call: NULL
error: package or namespace load failed for ‘stringr’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
there is no package called ‘stringi’

this is the version I have installed

  • R-4.2.3.pkg

Hi @Carolina_f234, welcome to the community!

Can you try install.packages("stringi") and then re-try to load the tidyverse?

Best,
Randy

I suggest you try pak, it'll install all (missing) dependencies of tidyverse:

install.packages("pak", repos = sprintf(
  "https://r-lib.github.io/p/pak/stable/%s/%s/%s",
  .Platform$pkgType,
  R.Version()$os,
  R.Version()$arch
))

(Cf. All about installing pak. — Installing pak • pak)

pak::pkg_install("tidyverse")
1 Like

thank you! it worked but when i only select it under packages. if i code it, it won’t install there. Is that normal ?

Glad we're moving in the right direction!

To be clear, you should only have to install the package once...what is only happening if you select it under packages vs. coding?

Best,
Randy

One of my homework assignments is to load library(tidyverse) , which i then have to unselect tidyverse in my packages to install again.

Would this cause it to need to backup R session ??

Also, does it always take long to back up R session ??

In this case, since one of the dependencies is missing, yes, you have to unselect tidyverse or restart your session, install stringi, then try to load tidyverse again.

You don't have to backup your session, I suppose it depends on what else is in your environment and whether you want to save it.

Similar to the above answer, it can take a long time to back up an R session if you have a lot of data loaded or lots of objects.

That said, it's considered good practice to NOT save your environment every time, as it can lead to subtle errors where you forgot what you did to generate those objects. Rather, it's better to get into the habit of having all of your commands in a script when feasible, then re-running the script in each session, so that you know what was created can only have come from your written code.

This page briefly highlights the workflow I'm describing:
https://www2.hawaii.edu/~georgeha/Handouts/meas/_book/saving.html

Best,
Randy

Hi,
Can someone please help me
I installed the dplyr package with this function,

install.packages("dplyr")
and i lo0aded it from the library
I wanted to work on the toothgrowth data
I could not get the filter funtion to work
Using the code bellow
filtered_tg<- Filter(ToothGrowth, dose== 0.5)

this is the error message
Error in get(as.character(FUN), mode = "function", envir = envir) :
object 'ToothGrowth' of mode 'function' was not found

I need guidance on how to proceed
Thanks

Lowercase filter and uppercase Filter are different functions, you probably meant the lowercase, not the uppercase?

Every time I run library(tidyverse), I get an error saying that the package or namespace load failed because there's no package called 'stringi'. The issue is with 'stringr' depending on 'stringi', which is missing. Has anyone else encountered this problem?

That means you need to install the stringi package. If you don't want to install missing dependencies one by one, you can give the pak package a try, it is a different way of installing packages. pak will automatically install all dependencies. See the post above.

1 Like