creating outdirs if doesn't exista and reading master file from backup
This commit is contained in:
parent
c553ef3be0
commit
745f45eb6d
1 changed files with 15 additions and 6 deletions
21
read_data.R
21
read_data.R
|
@ -9,9 +9,13 @@ getwd()
|
||||||
source("Header_TT.R")
|
source("Header_TT.R")
|
||||||
########################################################################
|
########################################################################
|
||||||
# TODO: turn this to a repo
|
# TODO: turn this to a repo
|
||||||
all_df <- read.csv("/home/pub/Work/MOSAIC/MOSAIC_from_work/MASTER/MOSAIC_2015_MASTER_Aki_stata_20150721/Mosaic_master_file_from_stata.csv"
|
all_df <- read.csv("/home/backup/MOSAIC/MEDIATOR_Data/master_file/Mosaic_master_file_from_stata.csv"
|
||||||
, fileEncoding='latin1')
|
, fileEncoding='latin1')
|
||||||
#hc_data<-
|
|
||||||
|
hc_data<- read.csv("/home/backup/MOSAIC/MEDIATOR_Data/master_file/Mediators_for_HC.csv")
|
||||||
|
str(hc_data)
|
||||||
|
table(hc_data$Timepoint, hc_data$Sample)
|
||||||
|
|
||||||
# meta data columns
|
# meta data columns
|
||||||
meta_data_cols = c("mosaic", "gender", "age", "adult", "flustat", "type"
|
meta_data_cols = c("mosaic", "gender", "age", "adult", "flustat", "type"
|
||||||
, "obesity", "obese2", "height", "height_unit", "weight"
|
, "obesity", "obese2", "height", "height_unit", "weight"
|
||||||
|
@ -23,7 +27,12 @@ all(meta_data_cols%in%colnames(all_df))
|
||||||
|
|
||||||
metadata_all = all_df[, meta_data_cols]
|
metadata_all = all_df[, meta_data_cols]
|
||||||
########################################################################
|
########################################################################
|
||||||
#
|
outdir = "~/git/mosaic_2020/output/"
|
||||||
#outdir =
|
ifelse(!dir.exists(outdir), dir.create(outdir), FALSE)
|
||||||
#outdir_plots =
|
|
||||||
outdir_stats = paste0("~/git/mosaic_2020/output/stats/")
|
outdir_stats = "~/git/mosaic_2020/output/stats/"
|
||||||
|
ifelse(!dir.exists(outdir_stats), dir.create(outdir_stats), FALSE)
|
||||||
|
|
||||||
|
outdir_plots = "~/git/mosaic_2020/output/plots/"
|
||||||
|
ifelse(!dir.exists(outdir_plots), dir.create(outdir_plots), FALSE)
|
||||||
|
########################################################################
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue