Commit b2053f56b69da1d68abb902a7ec37884a79c7e8a
1 parent
f2cad6d272
Exists in
master
Updating handling of strings in as.data.frame function
Showing
1 changed file
with
7 additions
and
7 deletions
Show diff stats
RCleanDscret.R
... | ... | @@ -212,7 +212,7 @@ rownames(ALZWORD)=NULL |
212 | 212 | colnames(ALZWORD) <- colnames(ALZWORD,do.NULL=FALSE) |
213 | 213 | ALZWORD <- chngrownm(ALZWORD)[-1,] |
214 | 214 | ALZWORD <- ALZWORD%>% |
215 | - as.data.frame()%>% | |
215 | + as.data.frame(.,stringsAsFactors = FALSE)%>% | |
216 | 216 | dplyr::select(-starts_with("col")) |
217 | 217 | |
218 | 218 | ##Reorganizing information within the columns |
... | ... | @@ -341,9 +341,9 @@ subjnam <- rawword[hereim,] |
341 | 341 | |
342 | 342 | ##Getting the names for the rows |
343 | 343 | namedarows <- rownames(rawword)[-hereim] %>% |
344 | - as.data.frame() | |
344 | + as.data.frame(.,stringsAsFactors = FALSE) | |
345 | 345 | RAWWORD <- rawword[-hereim,] %>% |
346 | - as.data.frame() %>% | |
346 | + as.data.frame(.,stringsAsFactors = FALSE) %>% | |
347 | 347 | bind_cols(namedarows,.) |
348 | 348 | z <- 1 |
349 | 349 | naroww <- as.data.frame(rep(0,dim(RAWWORD)[1]),stringsAsFactors = FALSE) |
... | ... | @@ -363,11 +363,11 @@ RAWWORD <- bind_cols(RAWWORD,naroww) |
363 | 363 | |
364 | 364 | roALZna <- t(ALZDAT) %>% |
365 | 365 | rownames(.) %>% |
366 | - as.data.frame(.) | |
366 | + as.data.frame(.,stringsAsFactors = FALSE) | |
367 | 367 | colnames(roALZna) <- "ID_REF" |
368 | 368 | |
369 | 369 | RAWDAT <- t(ALZDAT) %>% |
370 | - as.data.frame(.) | |
370 | + as.data.frame(.,stringsAsFactors = FALSE) | |
371 | 371 | colnames(RAWDAT) <- NULL |
372 | 372 | rownames(RAWDAT) <- NULL |
373 | 373 | |
... | ... | @@ -411,11 +411,11 @@ colnames(scrawdat) <- rownames(tabRDATID) |
411 | 411 | dialzdat <- scrawdat %>% |
412 | 412 | dndat(.) %>% |
413 | 413 | t()%>% |
414 | - as.data.frame(.) | |
414 | + as.data.frame(.,stringsAsFactors = FALSE) | |
415 | 415 | colnames(dialzdat) <- rownames(RAWDATNUM) |
416 | 416 | |
417 | 417 | ##setting "ID_REF" as a new variable |
418 | -geneNAM <- as.data.frame(as.matrix(rownames(dialzdat),ncol=1)) | |
418 | +geneNAM <- as.data.frame(as.matrix(rownames(dialzdat),ncol=1),stringsAsFactors = FALSE) | |
419 | 419 | colnames(geneNAM) <- "ID_REF" |
420 | 420 | rownames(dialzdat) <- NULL |
421 | 421 | dialzdat <-bind_cols(geneNAM,dialzdat) |