DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Related

  • Tips and Tricks for Efficient Coding in R
  • How to Get a Non-Programmer Started with R
  • Python vs. R: A Comparison of Machine Learning in the Medical Industry
  • How to Rectify R Package Error in Android Studio

Trending

  • Analyzing Techniques to Provision Access via IDAM Models During Emergency and Disaster Response
  • Non-Project Backlog Management for Software Engineering Teams
  • Role of Cloud Architecture in Conversational AI
  • How to Create a Successful API Ecosystem
  1. DZone
  2. Coding
  3. Languages
  4. Using R — Package Installation Problems

Using R — Package Installation Problems

By 
Jonathan Callahan user avatar
Jonathan Callahan
·
Feb. 25, 13 · Interview
Likes (0)
Comment
Save
Tweet
Share
4.3K Views

Join the DZone community and get the full member experience.

Join For Free

The post titled Installing Packages described the basics of package installation with R.  The process is wonderfully simple when everything goes well.  But it can be maddening when it does not.  Error messages give a hint as to what went wrong but do not necessarily tell you how to resolve the problem.  This post will collect some of the error messages we’ve encountered while installing R packages and describe the reasons for the error and the workarounds we’ve found.

1) Older version of R

Warning message:
In install.packages(c("sp")) : package ‘sp’ is not available

This is the message that you get when the CRAN package you’re interested in requires a more recent version of R than you have.  Remember, the default behavior ofinstall.packages() is to grab the latest version of a package.

In this case you have to poke around in the “Old sources” link on the CRAN page for that package and use trial-and-error to find an older version of the package that will work with your version of R.  You should start by determining what version of R you have:

1
2
$R--version
Rversion2.8.1(2008-12-22)

This version of R was released at the end of 2008 and any version of the “sp” package released in 2008 should work. At least some of the 2009 releases should also work. Perusing the sp archive, we might try installing version 0.9-37, the last of the 0.9-3x series which was released in May of 2009:

1
2
3
4
$wget http://cran.r-project.org/src/contrib/Archive/sp/sp_0.9-37.tar.gz
$sudo CMD INSTALL sp_0.9-37.tar.gz
...
$# Success!

2) Unable to execute files in /tmp directory

ERROR: 'configure' exists but is not executable -- see the 'R Installation and Administration Manual'

By default, R uses the /tmp directory to install packages.  On security conscious machines, the /tmp directory is often marked as “noexec” in the /etc/fstab file.  This means that no file under /tmp can ever be executed.  Packages that require compilation or that have self-inflating data will fail with the error above.  One such package isRJSONIO.

The solution is to set the TMPDIR environment variable which R will use as the compilation directory. For csh shell:

1
2
$mkdir~/tmp
$setenv TMPDIR~/tmp

And for bash:

1
2
$mkdir~/tmp
$export TMPDIR=~/tmp

Other problems

Please leave comments describing other package installation problems and solutions you’ve encountered to help us build a more complete listing.

R (programming language)

Published at DZone with permission of Jonathan Callahan, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Tips and Tricks for Efficient Coding in R
  • How to Get a Non-Programmer Started with R
  • Python vs. R: A Comparison of Machine Learning in the Medical Industry
  • How to Rectify R Package Error in Android Studio

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!