Add empty column to a data.frame, if column does not exist in the data.frame

fncols(data, cname)

Arguments

data

data.frame

cname

column name

Value

data.frame

Examples

cbpManager:::fncols(data.frame(a=c(1,2,3), b=c(4,5,6)), "new")
#>   a b new
#> 1 1 4    
#> 2 2 5    
#> 3 3 6