Reputation: 479
I have the following script called making_list_313_SNPs_from_csv.R. Briefly, this script takes in a .csv file and does some quick re-arrangements to produce a .txt file.
The .csv has 8 columns and the column I am interested has names like : 1_11100_A_T.
My R script looks like so:
library(tidyr)
setwd("/Users/m/folder/List_313/")
list = read.csv("file.csv")
list = as.data.frame(list[,2])
colnames(list) = c("SNP")
new_list = separate(data = list, col = SNP, into = c("part1", "part2", "part3", "part4"), sep = "_")
new_list = new_list[,c(1,2)]
write.table(new_list,"list_313_to_find.txt",quote=F,row.names = F, col.names = F)
I wanted to run this script from my Mac terminal like so:
Rscript making_list_313_SNPs_from_csv.R
This works and I get an output file that looks like what I want. However, I get the following output:
Warning message:
package ‘tidyr’ was built under R version 3.2.5
Warning message:
In .doLoadActions(where, attach) :
trying to execute load actions without 'methods' package
The first warning is simply a warning about the version of the R package I am using. However, I have no idea what the second warning means. Any help would be appreciated.
Upvotes: 0
Views: 482
Reputation: 61953
Rscript doesn't load the methods package. Add library(methods)
to your script. A normal R session loads it automatically.
If you think this is silly then you're not the only one.
Upvotes: 2