Trying to Load hrbrthemes Package, but Fail

Viewed 1999

I want to make some graphics to analyze Covid-19 with ggplot and hrbrthemes in R Google Colaboratory. But, when load the hrbrthemes package, I found the error like this

Error in library(hrbrthemes): there is no package called ‘hrbrthemes’
Traceback:

1. library(hrbrthemes)

Before I face this error, I have loaded ggplot2 and hrbrthemes package just like this

library(ggplot2)

library(hrbrthemes)

How I solved this? Can one of you help me to solve this problem? I'm very pleased when you can find the solution for me. Thank you ^^

6 Answers

I had it three days ago, and today I found the solution. you can try to install with

install.packages('https://cran.r-project.org/src/contrib/Archive/hrbrthemes/hrbrthemes_0.1.0.tar.gz', type='source', repos=NULL)

it works to me

Have you installed the "hrbrthemes" package yet? If not, you should install the package before loading it.

install.packages("hrbrthemes")

I think you probably haven't installed the package {hrbrthemes}.

You can install the package using the following command:

install.packages("hrbrthemes")

I would suggest try install.packages("hrbrthemes") on console

thank you for all your responses :) By the way, I had isntalled hrbrthemes package with install.packages() just like your recommend

install.packages('hrbrthemes')

But, I found the result like this after clicking the Run button about 3 until 4 times:

Installing package into ‘/usr/local/lib/R/site-library’ (as ‘lib’ is unspecified)

also installing the dependency ‘gdtools’

Warning message in install.packages("hrbrthemes"): “installation of package ‘gdtools’ had non-zero exit status” Warning message in install.packages("hrbrthemes"): “installation of package ‘hrbrthemes’ had non-zero exit status”

And then, when I run the library, the result is still like this

Error in library(hrbrthemes): there is no package called ‘hrbrthemes’ Traceback:

  1. library(hrbrthemes)

Should I install the package with another way? Is the another way can influence to R packages that I had installed before? By the way, before I installed the package, I had installed Python, R and R Studio in my laptop. My laptop has Windows 64 bit systems.

You must first install libcairo2-dev before the hrbrthemes on Google Colab for R:

system('sudo apt install libcairo2-dev')
install.packages('hrbrthemes')
library(hrbrthemes)

However, I haven't gotten it to be functional in Colab. Let me know if you get it to work!

Solution based on this GitHub comment.

Related