R: Code Execution
Theory
R is a language and environment for statistical computing and graphics. It is a GNU project which is similar to the S language and environment which was developed at Bell Laboratories (formerly AT&T, now Lucent Technologies) by John Chambers and colleagues.
Practical
System Commands
# System()
system("ls -l") # Executes the ls -l command in Unix-like systems
# System2()
output <- system2("ls", args = "-l", stdout = TRUE)
output
# Shell()
shell("ls -l")File Reading
List Directory Contents
0: No access permissions.
1: Execute access.
2: Write access.
4: Read access.
6: Read and write access.
7: Read, write, and execute access.
REFERENCES
Last updated
Was this helpful?