Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 578183
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:14:00+00:00 2026-05-13T14:14:00+00:00

The following R commands will install all CRAN packages: availablePackages <- available.packages()[,1] install.packages(availablePackages) And

  • 0

The following R commands will install all CRAN packages:

availablePackages <- available.packages()[,1]
install.packages(availablePackages)

And the following command will list all installed packages:

installedPackages <- .packages(all.available = TRUE)

My question is: How do I instruct R to install all CRAN packages that are not already installed?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T14:14:00+00:00Added an answer on May 13, 2026 at 2:14 pm

    Frankly, I think it’s painstaking job… it would last for days, even weeks (depending on resources), but here’s the code (I just enjoy doing trivial things):

    # get names of installed packages
    packs <- installed.packages()
    exc <- names(packs[,'Package'])
    
    # get available package names
    av <- names(available.packages()[,1])
    
    # create loooong string
    ins <- av[!av %in% exc]
    install.packages(ins)
    

    I still don’t get why you’re doing this, but, hey… some things are just not meant to be….
    What wonders me the most is the fact that you’ve already answered your own question! You got what you needed, and it’s just up to you to put things together…
    Are we missing the point? Did you have something else in mind?!?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Following command will let me know the names of databases. $ mysqlshow But how
Assuming an InnoDB table, will the following command ... CHECK TABLE table_name; ... cause
When I use make command, like make mica2, in TinyOS. The following problem will
Trying to install mysql-python. Got following error. Got mysql and pythond already installed. Any
I have installed output_kafka plugin for my fluentd by command gem install fluent-plugin-kafka. but
Are there any differences in the save locations for the following commands?: gem install
I get the following output from the sudo bundle install command: Fetching source index
I'm using the following command to install SQL Server Express 2008 R2 on various
I have the following commands in a README file: ./Setup ... ./Setup ... ./Setup
You usually invoke the following commands to build a ./configure d product: make make

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.