Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Execute two commands sequentially on one line in R?

Tags:

syntax

command

r

I know in shell one can do:

command1; command2 

How about in R? Is there some syntax where I could combine two commands onto one line?

like image 200
Alec Avatar asked Oct 05 '11 14:10

Alec


People also ask

How do you run multiple commands in one line?

Running Multiple Commands as a Single Job We can start multiple commands as a single job through three steps: Combining the commands – We can use “;“, “&&“, or “||“ to concatenate our commands, depending on the requirement of conditional logic, for example: cmd1; cmd2 && cmd3 || cmd4.

How do you execute more than one command or program from a single command line entry?

The semicolon (;) operator allows you to execute multiple commands in succession, regardless of whether each previous command succeeds. For example, open a Terminal window (Ctrl+Alt+T in Ubuntu and Linux Mint). Then, type the following three commands on one line, separated by semicolons, and press Enter.


1 Answers

try ";":

cat("12"); cat("13"); cat("\n") 
like image 127
Rainer Avatar answered Sep 20 '22 18:09

Rainer