Hi! I know this is a common error, but I've been trying different things for a few days now and am still unable to solve my problem. I have this code:
myotutable <- read.csv("weightedandtaxa.csv", header = TRUE)
mymetadata <- read.delim("Qiime_18S_merged_copy.tsv", header = TRUE)
d <- amp_load(otutable = myotutable,
metadata = mymetadata)
Which is supposed to merge "myotutable" and "mymetadata" to form a new file called "d" which can be used for a number of visualizations! However, I keep getting the error message "Error in colSums(abund) : 'x' must be numeric". I'm not sure which file this error is referring to or how to fix it. My two files look like :
For my metadata table.
I'm supposed to be able to match the sample data from mymetadata with the taxonomic data from myotu, but it's not able to work. I tried running:
myotutable <- read.csv("weightedandtaxa.csv", header = TRUE)
mymetadata <- read.delim("Qiime_18S_merged_copy.tsv", header = TRUE)
mymetadata$Date <- as.character(metadata$Date)
mymetadata$Year <- as.character(metadata$Year)
mymetadata$Depth <- as.character(metadata$Depth)
mymetadata$Salinity <- as.numeric(metadata$Salinity)
mymetadata$Temperature <- as.numeric(metadata$Temperature)
mymetadata$Nitrate_and_Nitrite <- as.numeric(metadata$Nitrate_and_Nitrite)
mymetadata$Silicate <- as.numeric(metadata$Silicate)
mymetadata$Phosphate <- as.numeric(metadata$Phosphate)
mymetadata$Line <- as.character(metadata$Line)
d <- amp_load(otutable = myotutable,
metadata = mymetadata)
To define each category of data, but that didn't help. I'm very new to R, so any help will be much appreciated!