Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

warning messages when developing R package [duplicate]

Tags:

r

When I develop a function in R, the following message appears when I click Build and Reload: Warning messages:

1: package ‘formattable’ was built under R version 3.4.1 
2: package ‘ggplot2’ was built under R version 3.4.1 
3: package ‘Amelia’ was built under R version 3.4.1 
4: package ‘car’ was built under R version 3.4.1 
5: package ‘pscl’ was built under R version 3.4.1 
6: package ‘gplots’ was built under R version 3.4.1 
7: package ‘ROCR’ was built under R version 3.4.1 
8: package ‘caret’ was built under R version 3.4.1 
9: package ‘roxygen2’ was built under R version 3.4.1 
10: package ‘miniCRAN’ was built under R version 3.4.1 

How to overcome this problem ?

like image 251
Joe Avatar asked Sep 12 '25 02:09

Joe


1 Answers

The reason for this is, as the message says, that you are using different libraries built under different versions of R. This could mean that it could break at some point due to version differences and R is letting you know this. To solve this you could update your packages to the most recent version. This can be done manually by running:

update.packages()

or if you want to update them all:

update.packages(ask=FALSE)

To update one specific "PACKAGE"

install.packages("PACKAGE")

although this might take some time and some packages might not be available up to the same version. You could use devtools to install an specific VERSION of the PACKAGE

require(devtools)
install_version("PACKAGE", version = "VERSION", repos = "http://cran.us.r-project.org")

If you do not want to do this you can suppress the warning message by using:

suppressWarnings()

or set warning messages off (might not be a good idea):

options(warn = -1)

use

options(warn = 0)

to set them on again.

?warning

for help.

like image 168
Diego F Medina Avatar answered Sep 14 '25 16:09

Diego F Medina