convert-data-types-and-values: Convert data types in 'data.frame(dataType,isList)' to...

Description Usage Arguments Value Note Examples

Description

Convert data types in data.frame(dataType,isList) to character of NDEx data types

Usage

1
2
3
.convertDataTypes(df, cols = c(dataType = "dataType", isList = "isList"))

.convertValues(df, cols = c(value = "value", isList = "isList"))

Arguments

df

data.frame with dataType and isList: data.frame(dataType,isList)

cols

named character; column names of dataType and isList in df

Value

character; NDEx data types (e.g. "string" or "list_of_integer")

Note

Internal function only for convenience

Examples

1
2
3
4
5
6
7
8
df = data.frame(dataType=c("string","boolean","double","integer","long",
                           "string","boolean","double","integer","long"),
                isList=c(FALSE,FALSE,FALSE,FALSE,FALSE,
                         TRUE,TRUE,TRUE,TRUE,TRUE))
df$value = list("string",TRUE,3.14,314,314,
                c("str","ing"),c(TRUE,FALSE),c(3.14,1.0),c(314,666),c(314,666))
RCX:::.convertDataTypes(df)
RCX:::.convertValues(df)

frankkramer-lab/RCX documentation built on July 14, 2021, 6:33 p.m.