Questions tagged [rscript]

Rscript (Rscript.exe on Windows) is a binary front-end to R, for use in scripting applications.

Rscript (Rscript.exe on Windows) is a binary front-end to R, for use in scripting applications. It is included in the core R distribution since version 2.5.0.

littler is an alternative front end to R for use in '#!' scripts.

Example:

Rscript

#! /path/to/Rscript
args <- commandArgs()
args <- args[-(1:match("--args", args)]
cat('hello world!', args, "\n")

littler

#! /path/to/r
cat('hello world!', argv, "\n")

Rscript passes all script arguments to R as additional elements to the vector returned from commandArgs().

littler provides convenience by assigning the script arguments to an argv vector and placing that into the global environment, a convention followed by other popular scripting languages.

656 questions
-1
votes
1 answer

Group by Status and find difference of datetime being on this status

x Status 14/09/2017 15:30:31 A 14/09/2017 15:30:34 A 14/09/2017 16:40:25 B 14/09/2017 17:00:25 B 15/09/2017 09:00:20 A 15/09/2017 10:00:20 …
-1
votes
1 answer

R fread() error when executing multiple scripts

edit: the file path i am giving is not /tmp/... the file path is in the form of: Erfurt/phased_edited_all_chr.gz i think the tmp directory is created by Slurm, but not sure about it. end edit. I am working on a data analysis project, and have a…
-1
votes
1 answer

Dump CSV files to Postgres and read in R while maintaining column data types

I'm new to R and correctly working a project refactoring code reading from csv files to from a database. The work includes dumping the csv files to a Postgres database, and modify existing R scripts to ingest input data from the db tables instead of…
-1
votes
1 answer

How to display the total number of a coloumn and the percentage of a coloumn

I need to display the following: Number of total listings - the list is given, from that I need to find the total number Percentage of listings - which are not reviewed : the list is given and the entries which are not reviewed are marked as…
-1
votes
2 answers

include character and numeric values dataframe

I have a dataframe with one column of 0 and 1, labeled "capture". I would like to convert it to Y and N but keep it in the dataframe which I'm later using to print a kable. How could I successfully mix variable types like this? ï..video capture…
-1
votes
2 answers

How to pass the R script into R shiny

I already have a simple defined function process in the R script. I want to design an R shiny app to enter the input keywords. After entering the searching keywords and R shiny will automatically jump to my function I wrote in the R script to get…
-1
votes
1 answer

I don't know what make of the result of the function predict

Introduction In my school I must participate at a challenge for see if I have understand how work the text mining in R. For that, we have 1050 files of different type (shopping, home, account, etc.). The goal of this exercise is the development of…
CookieHacker
  • 103
  • 2
  • 11
-1
votes
1 answer

R script to arguments

currently, in this code below, there is manual intervention I want to define the path of 2 input files. but then I am not sure how to do it library("openxlsx") nm=readline("Enter data file name:") readline("Enter input file name:…
-1
votes
1 answer

Creating a loop for segments within a vector that give return values for each corresponding segment

I've created a vector "numGrades" of 100 random numbers to represent values within a grading system. I need to write a "for" loop that takes segments of numerical grades and returns a vector of corresponding letter grades i.e.: 90+ = "A", 80-89 =…
Conner M
  • 15
  • 1
  • 6
-1
votes
1 answer

Date and Time seperation using R script

I am unable to separate the date and time using the POSIX package in R. This is the sample data for separating the date and time in the two separate columns.
-1
votes
1 answer

Comparison between two Data Sets using R Scripting / TERR in Spotfire

I want to compare the two data table columns ID using R-Script / TERR in spotfire. Due to some limitations in am not able to install the functions called "compare","SQLDf". I can use the functions called "duplicated". Can some one help me in…
VidyaSagar
  • 11
  • 4
-1
votes
2 answers

r removing and renaming columns after str_split

I used str_split_fixed to split my first column to 6 others. adobe.placement$name <- str_split_fixed(adobe.placement$name, ":::", 6) After that I wanted to rename those columns using colnames: colnames(adobe.placement) <-…
TityBoi
  • 399
  • 1
  • 4
  • 11
-1
votes
1 answer

Automating the generation of model output in R

I have a list of R commands that first grabs data from SQL database through RODBC, computes calculated fields and then applies a regression model(assigned as "objModel" in my R environment)to the data. The final output is a csv file with two…
gibbz00
  • 1,947
  • 1
  • 19
  • 31
-1
votes
2 answers

Bar Chart Using R-Script

Here i need to make a chart using R-Script and i am using a Data frame called DF. a<-c("01-01-2013 12:00:00 AM","01-02-2013 12:00:00 AM", "01-03-2013 12:00:00 AM","01-04-2013 12:00:00 AM", "01-05-2013 12:00:00…
-2
votes
1 answer

Frequency Plot in R for example dataset

I had the Dataset…
Sajaym
  • 1
1 2 3
43
44