I use perl -e to add Perl scripts to a shell script, such as bash, without creating a Perl script file.
perl -e ' while (<>) { print; }' < file
Is there a similar way to do this for R? I want to write R scripts in a bash script, but without creating an R script file.
One way is to use
R
Unlike perl -e, when using $, you must specify a backslash when referring to a table column. In perl -e, we do not need to use \ $ to refer to a perl variable.
source share