Commit 0cb37d334fea0451f1ad6210e8303d5b33103346
1 parent
db021299ec
Exists in
master
Update to as.data.frame function
Showing
1 changed file
with
15 additions
and
15 deletions
 
Show diff stats
RAutoClDs.R
| ... | ... | @@ -218,7 +218,7 @@ THEFT <- function(){ | 
| 218 | 218 | colnames(ALZWORD) <- colnames(ALZWORD,do.NULL=FALSE) | 
| 219 | 219 | ALZWORD <- chngrownm(ALZWORD)[-1,] | 
| 220 | 220 | ALZWORD <- ALZWORD%>% | 
| 221 | - as.data.frame()%>% | |
| 221 | + as.data.frame(.,stringsAsFactors = FALSE)%>% | |
| 222 | 222 | dplyr::select(-starts_with("col")) | 
| 223 | 223 | |
| 224 | 224 | ##Reorganizing information within the columns and final clinical data | 
| ... | ... | @@ -321,7 +321,7 @@ THEFT <- function(){ | 
| 321 | 321 | |
| 322 | 322 | #Full RAW Data | 
| 323 | 323 | Fullalzdwr <- ALZDAT %>% | 
| 324 | - as.data.frame() %>% | |
| 324 | + as.data.frame(.,stringsAsFactors = FALSE) %>% | |
| 325 | 325 | cbind(ALZWORDF,.) | 
| 326 | 326 | |
| 327 | 327 | #Raw file is output | 
| ... | ... | @@ -347,9 +347,9 @@ THEFT <- function(){ | 
| 347 | 347 | |
| 348 | 348 | ##Getting the names for the rows | 
| 349 | 349 | namedarows <- rownames(rawword)[-hereim] %>% | 
| 350 | - as.data.frame() | |
| 350 | + as.data.frame(.,stringsAsFactors = FALSE) | |
| 351 | 351 | RAWWORD <- rawword[-hereim,] %>% | 
| 352 | - as.data.frame() %>% | |
| 352 | + as.data.frame(.,stringsAsFactors = FALSE) %>% | |
| 353 | 353 | bind_cols(namedarows,.) | 
| 354 | 354 | z <- 1 | 
| 355 | 355 | naroww <- as.data.frame(rep(0,dim(RAWWORD)[1]),stringsAsFactors = FALSE) | 
| ... | ... | @@ -373,7 +373,7 @@ THEFT <- function(){ | 
| 373 | 373 | colnames(roALZna) <- "ID_REF" | 
| 374 | 374 | |
| 375 | 375 | RAWDAT <- t(ALZDAT) %>% | 
| 376 | - as.data.frame(.) | |
| 376 | + as.data.frame(.,stringsAsFactors = FALSE) | |
| 377 | 377 | colnames(RAWDAT) <- NULL | 
| 378 | 378 | rownames(RAWDAT) <- NULL | 
| 379 | 379 | |
| ... | ... | @@ -416,11 +416,11 @@ THEFT <- function(){ | 
| 416 | 416 | dialzdat <- scrawdat %>% | 
| 417 | 417 | dndat(.) %>% | 
| 418 | 418 | t()%>% | 
| 419 | - as.data.frame(.) | |
| 419 | + as.data.frame(.,stringsAsFactors = FALSE) | |
| 420 | 420 | colnames(dialzdat) <- rownames(RAWDATNUM) | 
| 421 | 421 | |
| 422 | 422 | ##setting "ID_REF" as a new variable | 
| 423 | - geneNAM <- as.data.frame(as.matrix(rownames(dialzdat),ncol=1)) | |
| 423 | + geneNAM <- as.data.frame(as.matrix(rownames(dialzdat),ncol=1),stringsAsFactors = FALSE) | |
| 424 | 424 | colnames(geneNAM) <- "ID_REF" | 
| 425 | 425 | rownames(dialzdat) <- NULL | 
| 426 | 426 | dialzdat <-bind_cols(geneNAM,dialzdat) | 
| ... | ... | @@ -506,7 +506,7 @@ THEFT <- function(){ | 
| 506 | 506 | colnames(ALZWORD) <- colnames(ALZWORD,do.NULL=FALSE) | 
| 507 | 507 | ALZWORD <- chngrownm(ALZWORD)[-1,] | 
| 508 | 508 | ALZWORD <- ALZWORD%>% | 
| 509 | - as.data.frame()%>% | |
| 509 | + as.data.frame(.,stringsAsFactors = FALSE)%>% | |
| 510 | 510 | dplyr::select(-starts_with("col")) | 
| 511 | 511 | |
| 512 | 512 | ##Reorganizing information within the columns and final clinical data | 
| ... | ... | @@ -609,7 +609,7 @@ THEFT <- function(){ | 
| 609 | 609 | |
| 610 | 610 | #Full RAW Data | 
| 611 | 611 | Fullalzdwr <- ALZDAT %>% | 
| 612 | - as.data.frame() %>% | |
| 612 | + as.data.frame(.,stringsAsFactors = FALSE) %>% | |
| 613 | 613 | cbind(ALZWORDF,.) | 
| 614 | 614 | |
| 615 | 615 | #Raw file is output | 
| ... | ... | @@ -635,7 +635,7 @@ THEFT <- function(){ | 
| 635 | 635 | |
| 636 | 636 | ##Getting the names for the rows | 
| 637 | 637 | namedarows <- rownames(rawword)[-hereim] %>% | 
| 638 | - as.data.frame() | |
| 638 | + as.data.frame(.,stringsAsFactors = FALSE) | |
| 639 | 639 | RAWWORD <- rawword[-hereim,] %>% | 
| 640 | 640 | as.data.frame() %>% | 
| 641 | 641 | bind_cols(namedarows,.) | 
| ... | ... | @@ -657,11 +657,11 @@ THEFT <- function(){ | 
| 657 | 657 | |
| 658 | 658 | roALZna <- t(ALZDAT) %>% | 
| 659 | 659 | rownames(.) %>% | 
| 660 | - as.data.frame(.) | |
| 660 | + as.data.frame(.,stringsAsFactors = FALSE) | |
| 661 | 661 | colnames(roALZna) <- "ID_REF" | 
| 662 | 662 | |
| 663 | 663 | RAWDAT <- t(ALZDAT) %>% | 
| 664 | - as.data.frame(.) | |
| 664 | + as.data.frame(.,stringsAsFactors = FALSE) | |
| 665 | 665 | colnames(RAWDAT) <- NULL | 
| 666 | 666 | rownames(RAWDAT) <- NULL | 
| 667 | 667 | |
| ... | ... | @@ -671,7 +671,7 @@ THEFT <- function(){ | 
| 671 | 671 | |
| 672 | 672 | ##Editing the file for R processing | 
| 673 | 673 | RAWDATID <- RAWDAT2[,1] %>% | 
| 674 | - as.matrix(.) | |
| 674 | + as.matrix(.,stringsAsFactors = FALSE) | |
| 675 | 675 | |
| 676 | 676 | RAWDATNUM <- RAWDAT2[,-1] %>% | 
| 677 | 677 | mapply(.,FUN = as.numeric) %>% | 
| ... | ... | @@ -704,11 +704,11 @@ THEFT <- function(){ | 
| 704 | 704 | dialzdat <- scrawdat %>% | 
| 705 | 705 | dndat(.) %>% | 
| 706 | 706 | t()%>% | 
| 707 | - as.data.frame(.) | |
| 707 | + as.data.frame(.,stringsAsFactors = FALSE) | |
| 708 | 708 | colnames(dialzdat) <- rownames(RAWDATNUM) | 
| 709 | 709 | |
| 710 | 710 | ##setting "ID_REF" as a new variable | 
| 711 | - geneNAM <- as.data.frame(as.matrix(rownames(dialzdat),ncol=1)) | |
| 711 | + geneNAM <- as.data.frame(as.matrix(rownames(dialzdat),ncol=1),stringsAsFactors = FALSE) | |
| 712 | 712 | colnames(geneNAM) <- "ID_REF" | 
| 713 | 713 | rownames(dialzdat) <- NULL | 
| 714 | 714 | dialzdat <-bind_cols(geneNAM,dialzdat) |