dssColNames: Get or set the column names of a dataframe

Description Usage Arguments Value Examples

View source: R/dssColNames.R

Description

Unlike ds.colnames this function allows to set the names too

Usage

1
2
3
4
5
6
7
8
dssColNames(
  df,
  value = NULL,
  to.replace = NULL,
  async = TRUE,
  wait = TRUE,
  datasources = NULL
)

Arguments

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

wait

same as in datashield.assign

datasources

same as in datashield.assign

Value

the column names of the dataframe

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# open a local pseudo connection:
opals <- dssCreatePseudoServers(servers = 2, tie_first_to_GlobalEnv = 1)
# 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')

IulianD/dsSwissKnifeClient documentation built on June 23, 2020, 4:38 p.m.