Installation of package goes wrong/Library doesn't load packages

package-installation
#1

Hi everyone,

it is my first time working with RStudio and I am running into problems. This one I struggle to solve on my own:
I am trying to install the package "UsingR" (install.packages("UsingR")) and load it in the library (library(Using"R").

But after installation the library shows the error: Error in library("UsingR") : there is no package called ‘UsingR’

That is how the output looks like:

can somebody please help :slight_smile: Thank you

0 Likes

#2

Your problem is that the library is not getting installed because of missing dependencies, try with this command

install.packages("UsingR", dependencies = TRUE)

If everything goes well you should get this message at the end

* DONE (UsingR)

The downloaded source packages are in
	‘/tmp/Rtmp0gcizd/downloaded_packages’

Then you can load the library with

library(UsingR)
1 Like

#3

Hi Andresrcs,

many thanks for your support. I tried it, but I couldn't make it work. Is there something else I could do different?

Attached you find my output.
It would be great to hear from you again.

0 Likes

#4

0 Likes

#5

0 Likes

#6

It seems like you are on MacOS and that you haven't installed xquartz, try installing it in your system (this is a system program not an R package)

https://www.xquartz.org/

Also, please post the error messages between 3 backticks instead of pasting a screenshot, something like this

```
* DONE (UsingR)

The downloaded source packages are in
	‘/tmp/Rtmp0gcizd/downloaded_packages’
```
0 Likes

#7

When you post your code as images we can't copy it to google either. If you look closely at your log, it will say it failed, with nonzero status. It also mentions the Hmisc package. If you try to install that package you'll likely get another error. Then you fix that one and work back up the path to install the one needed.
Often this means you need to install something externally that the package is expecting on your system but isn't found.

0 Likes

#8

Dear all,

thank you for your advice!
@andresrcs you are right, I am working on a MacOS system. Now I installed xquartz and I opened it when I tried to install the packages, do I need to us it in a certain way?

at stat_geek I tried to install Hmisc but get the same error as before.

`
ERROR: dependency ‘htmlTable’ is not available for package ‘Hmisc’

`
Warning in install.packages :
installation of package ‘UsingR’ had non-zero exit status

`

0 Likes

#9

Dear all,

after deinstallation of RStudio and xQuartz, I (re-)installed R 3.5.3, RStudio 1.1.463 and xQuartz.
I then opened RStudio and now I hope that this is what it is suppose to look like when a package was successfully installed and loaded (sorry for being such a newbie):

> library(UsingR)
Loading required package: MASS
Loading required package: HistData
Loading required package: Hmisc
Loading required package: lattice
Loading required package: survival
Loading required package: Formula
Loading required package: ggplot2

Attaching package: ‘Hmisc’

The following objects are masked from ‘package:base’:

    format.pval, units


Attaching package: ‘UsingR’

The following object is masked from ‘package:survival’:

    cancer
0 Likes

#10

Yes, you managed to solve your problem, although all the uninstalling wasn't really necessary but nevertheless, congratulations!

If your question's been answered (even by you!), would you mind choosing a solution? It helps other people see which questions still need help, or find solutions if they have similar problems. Here’s how to do it:

0 Likes

#11

Yes, I will do so. Many thanks to you @andresrcs !

0 Likes

closed #12

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

If you have a query related to it or one of the replies, start a new topic and refer back with a link.

0 Likes