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

convert-data-types-and-valuesR Documentation

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

Description

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

Usage

.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

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 Feb. 4, 2023, 5:12 p.m.