Up: Component summary Component

CSVDplyr

Applies up to R functions (including dplyr functions) to the input csv1. Other CSV inputs are available as helpers. You can pass library loading for example in the script parameter which will gets evaluated first.

Version 1.2
Bundle tools
Categories Analysis
Authors Amjad Alkodsi (Amjad.Alkodsi@Helsinki.FI)
Issue tracker View/Report issues
Requires dplyr (R-package)
Source files component.xml CSVDplyr.r
Usage Example with default values

Inputs

Name Type Mandatory Description
csv1 CSV Optional Input csv file to be manipulated. If this input is not defined, component assumes the first element of the Array input is the starting point.
csv2 CSV Optional Input helper csv file.
csv3 CSV Optional Input helper csv file.
in Array<CSV> Optional Input CSV Array. Variables are named csv.[key]

Outputs

Name Type Description
out CSV Output CSV after manipulation.

Parameters

Name Type Default Description
function1 string "" Function applied on csv1 e.g. select(x,y) to select columns x and y. If csv1 input is not defined, functions start with the first Array element. You can also manually concatenate more functions with "%>%". Note that column names with special characters (like spaces) can be quoted with backticks.
function2 string "" Function to be applied.
function3 string "" Function to be applied.
function4 string "" Function to be applied.
function5 string "" Function to be applied.
function6 string "" Function to be applied.
function7 string "" Function to be applied.
function8 string "" Function to be applied.
function9 string "" Function to be applied.
script string "" R code to be evaluated first, e.g. library loading.

Test cases

Test case Parameters IN
csv1
IN
csv2
IN
csv3
IN
in
OUT
out
case1 properties csv1 (missing) (missing) (missing) out

function1=select(Car=car,mpg,cyl,wt,vs,disp),
function2=filter(cyl < 8),
function3=mutate(brand=sapply(strsplit(as.character(Car)," "),function(x)x[1])),
function4=group_by(brand),
function5=summarise(meanmpg=mean(mpg),meanwt=mean(wt)),
function6=arrange(meanmpg)

case2 properties csv1 csv2 csv3 (missing) out

function1=merge(csv2,by=1),
function2=merge(csv3,by=1),
function3=filter(cyl==4 | cyl==6),
function4=select(car,cyl,gear),
function5=melt(),
script=library(reshape)

case3_array properties (missing) (missing) (missing) in out

function1=merge(csv.2,by=1) %>% merge(csv.3,by=1),
function2=filter(cyl==4 | cyl==6) %>% select(car,cyl,gear) %>% melt(),
script=library(reshape)


Generated 2018-12-11 07:42:06 by Anduril 2.0.0