From b2053f56b69da1d68abb902a7ec37884a79c7e8a Mon Sep 17 00:00:00 2001 From: Efrain Gonzalez Date: Mon, 26 Jun 2017 13:06:26 -0400 Subject: [PATCH] Updating handling of strings in as.data.frame function --- RCleanDscret.R | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/RCleanDscret.R b/RCleanDscret.R index fa41a39..64413c5 100644 --- a/RCleanDscret.R +++ b/RCleanDscret.R @@ -212,7 +212,7 @@ rownames(ALZWORD)=NULL colnames(ALZWORD) <- colnames(ALZWORD,do.NULL=FALSE) ALZWORD <- chngrownm(ALZWORD)[-1,] ALZWORD <- ALZWORD%>% - as.data.frame()%>% + as.data.frame(.,stringsAsFactors = FALSE)%>% dplyr::select(-starts_with("col")) ##Reorganizing information within the columns @@ -341,9 +341,9 @@ subjnam <- rawword[hereim,] ##Getting the names for the rows namedarows <- rownames(rawword)[-hereim] %>% - as.data.frame() + as.data.frame(.,stringsAsFactors = FALSE) RAWWORD <- rawword[-hereim,] %>% - as.data.frame() %>% + as.data.frame(.,stringsAsFactors = FALSE) %>% bind_cols(namedarows,.) z <- 1 naroww <- as.data.frame(rep(0,dim(RAWWORD)[1]),stringsAsFactors = FALSE) @@ -363,11 +363,11 @@ RAWWORD <- bind_cols(RAWWORD,naroww) roALZna <- t(ALZDAT) %>% rownames(.) %>% - as.data.frame(.) + as.data.frame(.,stringsAsFactors = FALSE) colnames(roALZna) <- "ID_REF" RAWDAT <- t(ALZDAT) %>% - as.data.frame(.) + as.data.frame(.,stringsAsFactors = FALSE) colnames(RAWDAT) <- NULL rownames(RAWDAT) <- NULL @@ -411,11 +411,11 @@ colnames(scrawdat) <- rownames(tabRDATID) dialzdat <- scrawdat %>% dndat(.) %>% t()%>% - as.data.frame(.) + as.data.frame(.,stringsAsFactors = FALSE) colnames(dialzdat) <- rownames(RAWDATNUM) ##setting "ID_REF" as a new variable -geneNAM <- as.data.frame(as.matrix(rownames(dialzdat),ncol=1)) +geneNAM <- as.data.frame(as.matrix(rownames(dialzdat),ncol=1),stringsAsFactors = FALSE) colnames(geneNAM) <- "ID_REF" rownames(dialzdat) <- NULL dialzdat <-bind_cols(geneNAM,dialzdat) -- 2.29.0