diff --git a/DESCRIPTION b/DESCRIPTION index dd29261..580c0e2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: dsOmics Type: Package Title: DataSHIELD server site Omic functions -Version: 1.0.7-7 +Version: 1.0.7-8 Date: 2021-07-08 Authors@R: c(person("Yannick", "Marcon", , "yannick.marcon@obiba.org", role = "aut"), person("Xavier", "Esriba-Montagut", , "xavier.escriba@isglobal.org", role = "aut"), diff --git a/NAMESPACE b/NAMESPACE index 1a59518..e6b0d77 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -28,7 +28,7 @@ export(getChromosomeNamesDS) export(getSNPSbyGenDS) export(getVariable) export(limmaDS) -export(make_valid_column_namesDS) +export(make_valid_namesDS) export(nFeaturesDS) export(nSamplesDS) export(plinkDS) diff --git a/R/make_valid_column_namesDS.R b/R/make_valid_column_namesDS.R deleted file mode 100644 index d02028f..0000000 --- a/R/make_valid_column_namesDS.R +++ /dev/null @@ -1,13 +0,0 @@ -#' @title Rename column names -#' @description Passes the column names through \code{make.names} and rewrites them -#' -#' @param x \code{data.frame} Table to change the column names -#' -#' @return \code{data.frame} with the column names updated -#' @export -#' -#' @examples -make_valid_column_namesDS <- function(x){ - colnames(x) <- make.names(colnames(x)) - return(x) -} \ No newline at end of file diff --git a/R/make_valid_namesDS.R b/R/make_valid_namesDS.R new file mode 100644 index 0000000..725e709 --- /dev/null +++ b/R/make_valid_namesDS.R @@ -0,0 +1,18 @@ +#' @title Rename column names and character variables +#' +#' @description Passes the column names and the character variables through \code{make.names}, this creates +#' names without any special characters so there are no problems for accessing any columns or any category +#' when using the DataSHIELD parser. +#' +#' @param x \code{data.frame} Entry table to modify +#' +#' @return \code{data.frame} with the column names and character columns updated +#' @export +#' +#' @examples +make_valid_namesDS <- function(x){ + x <- eval(parse(text=x), envir = parent.frame()) + colnames(x) <- make.names(colnames(x)) + x <- x %>% mutate(across(where(is.character), make.names)) + return(x) +} \ No newline at end of file diff --git a/inst/DATASHIELD b/inst/DATASHIELD index c857440..4d2ae1c 100644 --- a/inst/DATASHIELD +++ b/inst/DATASHIELD @@ -32,4 +32,4 @@ AssignMethods: RNAseqPreprocDS, PRSDS, PRSDS_aux, - make_valid_column_namesDS \ No newline at end of file + make_valid_namesDS \ No newline at end of file diff --git a/man/make_valid_column_namesDS.Rd b/man/make_valid_column_namesDS.Rd deleted file mode 100644 index 4ad2cce..0000000 --- a/man/make_valid_column_namesDS.Rd +++ /dev/null @@ -1,17 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/make_valid_column_namesDS.R -\name{make_valid_column_namesDS} -\alias{make_valid_column_namesDS} -\title{Rename column names} -\usage{ -make_valid_column_namesDS(x) -} -\arguments{ -\item{x}{\code{data.frame} Table to change the column names} -} -\value{ -\code{data.frame} with the column names updated -} -\description{ -Passes the column names through \code{make.names} and rewrites them -} diff --git a/man/make_valid_namesDS.Rd b/man/make_valid_namesDS.Rd new file mode 100644 index 0000000..070a1f1 --- /dev/null +++ b/man/make_valid_namesDS.Rd @@ -0,0 +1,19 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/make_valid_namesDS.R +\name{make_valid_namesDS} +\alias{make_valid_namesDS} +\title{Rename column names and character variables} +\usage{ +make_valid_namesDS(x) +} +\arguments{ +\item{x}{\code{data.frame} Entry table to modify} +} +\value{ +\code{data.frame} with the column names and character columns updated +} +\description{ +Passes the column names and the character variables through \code{make.names}, this creates +names without any special characters so there are no problems for accessing any columns or any category +when using the DataSHIELD parser. +}