cowcalf-rumen-metagenomic-p.../fetchmetadata.R

8 lines
501 B
R
Raw Normal View History

2019-05-13 16:09:48 +00:00
metadata <- read.delim("metadata.tsv", header=FALSE)
metadata_columns <- head(metadata, 2)
metadata_columns <- as.data.frame(t(metadata_columns))
colnames(metadata_columns) <- c("Name", "DataType")
numcols <- subset(metadata_columns, DataType == "numeric")[,1]
catcols <- subset(metadata_columns, DataType == "categorical")[,1]
write.table(numcols,"numcols.txt",row.names = FALSE, col.names = FALSE, quote = FALSE)
write.table(catcols,"catcols.txt",row.names = FALSE, col.names = FALSE, quote = FALSE)