add_parent_to_loop: Add rows of the parent dataframe

Description Usage Arguments Details Value Examples

Description

Add rows of the parent dataframe

Usage

1
2
add_parent_to_loop(loop, parent, variables.to.keep = NULL,
  uuid.name.loop = NULL, uuid.name.parent = NULL)

Arguments

loop

a dataframe containing the loops

parent

a dataframe containing the parent informations

variables.to.keep

optional: a string or a vector of string containing the parent columns names that need to be copy in the loop dataset

uuid.name.loop

optional: a string that specify the name of the loop column containing the uuids. If not specify, searches for column containing the uuid string

uuid.name.parent

optional: a string that specify the name of the parent column containing the uuids. If not specify, searches for column containing uuid string

Details

Searches for each row in loop dataframe if it matches with a row of the parent datarame. Select in the row of the parent dataframe, the information that the user wants to add to the loop dataframe

Value

the loop dataframe to which for each row has been added the corresponding value of the parent dataframe variable

Examples

1
2
3
parent <- data.frame(uuid=1:10, age=sample(10,30,60),gender=sample(c("F","M"),10,replace = T) )
child <- data.frame (parent_uuid=sample(1:10,20,replace = T), age=sample(20,1,18)  gender=sample(c("F","M"),20,replace = T))
family<- add_parent_to_loop(child,parent,c("age"))

sharonorengo/koboloops documentation built on June 30, 2019, 10:56 a.m.