dssColNames | R Documentation |
Unlike ds.colnames this function allows to set the names too
dssColNames(
df,
value = NULL,
to.replace = NULL,
async = TRUE,
datasources = NULL
)
df |
a character, name of the dataframe |
value |
a vector containing the new column names (if null, the function simply returns the colnames) |
to.replace |
a vector containing the names of the columns to replace. It must have the same length as the value vector. If null, all column names will be replaced. |
async |
same as in datashield.assign |
datasources |
same as in datashield.assign |
the column names of the dataframe
# open a local pseudo connection:
library(DSLite)
dslite.server1 <<- newDSLiteServer(config = defaultDSConfiguration(include=c('dsSwissKnife')))
dslite.server2 <<- newDSLiteServer(config = defaultDSConfiguration(include=c('dsSwissKnife')))
builder <- newDSLoginBuilder()
builder$append(server="server1", url='dslite.server1',driver = "DSLiteDriver")
builder$append(server="server2", url='dslite.server2',driver = "DSLiteDriver")
logindata <- builder$build()
opals <- datashield.login(logins = logindata, assign = TRUE)
# load the iris dataset
datashield.aggregate(opals[1], as.symbol('partialData("iris", 1, 70)'))
datashield.aggregate(opals[2], as.symbol('partialData("iris", 71, 150)'))
dssColNames('iris')
# set them to something else:
dssColNames('iris', value = c('sl', 'sw', 'pl', 'pw', 'sp'))
#check again:
dssColNames('iris')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.