Skip to content
Prev 12452 / 398502 Next

Write a script

I use these basic scripts:
script.sh
---------
#!/bin/sh
R --no-save < script.R
---------

script.R
---------
exp1 <- read.table("exp1tot")
exp1 <- (30 - exp1)/30
tab <- read.table("numero_son")
exp <- cbind(tab,exp1)
write.table(exp,"try",sep=" ",eol="\n",row.names = FALSE,col.names=FALSE)
---------

and now:
[machine] ./script.sh

R : Copyright 2001, The R Development Core Team
Version 1.3.0  (2001-06-22)

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.

Type `demo()' for some demos, `help()' for on-line help, or
`help.start()' for a HTML browser interface to help.
Type `q()' to quit R.
[machine] 

It works
Olivier Houix
On Thu, Jul 19, 2001 at 05:05:43PM +0200, zze-CHOQUET Denis stagiaire FTRD/DMI/SOP wrote: