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 8049735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T06:51:57+00:00 2026-06-05T06:51:57+00:00

I am a engineer newbie to R and have got a script which I

  • 0

I am a engineer newbie to R and have got a script which I have to run on linux, I searched alot but was not able to find a simple command to run the script on linux. I have to couple my engineering software with R so I need to run it also on linux.

My script name is  myscipt.R and I want to use 2 cpus to run that script.

kindly help me with the startup.

best regards.

  • 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-06-05T06:51:58+00:00Added an answer on June 5, 2026 at 6:51 am

    This works for me:

    R CMD BATCH myscript.R
    

    As an example, the following should produce a .csv file of a random generated matrix. I have always named this scripts with an “.R” extension, but I’m not sure that that is necessary.

    The script to call (named “testscript.R”) contains the following lines of code:

    set.seed(1)
    M<-matrix(runif(20),5,4)
    write.csv(M, file="M.csv")
    

    Then call this script in your console as illustrated above:

    R CMD BATCH testscript.R
    

    On my machine, this produces the “M.csv” document, which looks like this:

        "","V1","V2","V3","V4"
    "1",0.2655086631421,0.898389684967697,0.205974574899301,0.497699242085218
    "2",0.37212389963679,0.944675268605351,0.176556752528995,0.717618508264422
    "3",0.572853363351896,0.660797792486846,0.687022846657783,0.991906094830483
    "4",0.908207789994776,0.62911404389888,0.384103718213737,0.380035179434344
    "5",0.201681931037456,0.0617862704675645,0.769841419998556,0.777445221319795
    

    Also, a “testscript.Rout” file is produced giving the R console output:

    R version 2.14.0 (2011-10-31)
    Copyright (C) 2011 The R Foundation for Statistical Computing
    ISBN 3-900051-07-0
    Platform: i386-pc-solaris2.10 (32-bit)
    
    R is free software and comes with ABSOLUTELY NO WARRANTY.
    You are welcome to redistribute it under certain conditions.
    Type 'license()' or 'licence()' for distribution details.
    
    R is a collaborative project with many contributors.
    Type 'contributors()' for more information and
    'citation()' on how to cite R or R packages in publications.
    
    Type 'demo()' for some demos, 'help()' for on-line help, or
    'help.start()' for an HTML browser interface to help.
    Type 'q()' to quit R.
    
    [Previously saved workspace restored]
    
    > set.seed(1)
    > M<-matrix(runif(20),5,4)
    > write.csv(M, file="M.csv")
    > 
    > proc.time()
       user  system elapsed 
      9.075   0.257   9.362 
    

    Hope that explains it better.

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

Sidebar

Related Questions

I have a script that I need to reverse engineer, but the script appears
I'm a computer engineer student and i've got a basically simple assignment but i'd
I'm trying to reverse engineer a function over which i have no source, and
We have a test engineer that does not need access to all of our
I am an engineer and not a software programmer, so please excuse my ignorance.
Do you have some advices or reading how to engineer features for a machine
i was trying to reverse engineer a website ( www.asklaila.com ) to find out
What is the difference between Build Engineer and Install Engineer ? Should Companies have
I am trying to reverse engineer a c code, but this part of assembly
Tried to 'reverse engineer' other SO users questions/answers to my question but couldn't. JOINS

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.