We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello everyone,
I have a simple problem with this loop in the section (Correlations of each candidate SNP with the environmental predictors):
foo <- matrix(nrow=(ncand), ncol=4) # 4 columns for 4 predictors colnames(foo) <- c("ID","POP","SURFACE","ALTITUDE")
for (i in 1:length(cand$snp)) { nam <- cand[i,2] snp.gen <- gen.imp[,nam] foo[i,] <- apply(pred,2,function(x) cor(x,snp.gen)) }
#Error in cor(x, snp.gen) : 'x' must be numeric
I understand that cor is a correlation, but in the x section what kind of input should I add to the loop in this case?
Thank you very much for your help
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hello everyone,
I have a simple problem with this loop in the section (Correlations of each candidate SNP with the environmental predictors):
foo <- matrix(nrow=(ncand), ncol=4) # 4 columns for 4 predictors
colnames(foo) <- c("ID","POP","SURFACE","ALTITUDE")
for (i in 1:length(cand$snp)) {
nam <- cand[i,2]
snp.gen <- gen.imp[,nam]
foo[i,] <- apply(pred,2,function(x) cor(x,snp.gen))
}
#Error in cor(x, snp.gen) : 'x' must be numeric
I understand that cor is a correlation, but in the x section what kind of input should I add to the loop in this case?
Thank you very much for your help
The text was updated successfully, but these errors were encountered: