add.rg3: Add a rotation group indicator to a table indicating wheter a...

Description Usage Arguments Details Value Examples

View source: R/AK.R

Description

Add a rotation group indicator to a table indicating wheter a unit is present in the previous and next samples.

Usage

1
add.rg3(df_1, df0, df1, id, rg.name = "rg")

Arguments

df_1

a data frame, the previous table

df0

a data frame, the current table

df1

a data frame, the next table

id

a vector of character strings indicating the variable names for the sample unit primary key.

rg.name

a character string

Details

creates a variable named rg.name that takes values 4 for elements present in the current and next tables only, 3 for elements present in the current table only, 2 for elements present in the previous, current and next tables, 1 for elements present in the previous and current tables only.

depends on dplyr, tidyr

Value

a list of data.frames with a new variable named rg.name

Examples

1
2
3
4
5
6
df <- expand.grid(x= 1:10, y = 1:10)
 df_1 <- df[sample(100,25),]
 df0 <- df[sample(100,25),]
 df1 <- df[sample(100,25),]
 id=c("x","y")
 add.rg3(df_1,df0,df1,c("x","y"))

DanielBonnery/CompositeRegressionEstimation documentation built on June 17, 2020, 12:16 p.m.