I have a problem, when I input data (.txt), and I want to perform x.cor<- cor(x)
in R, I got an error: Error in cor(x) : 'x' must be numeric
my .txt data is like that:
I have a problem, when I input data (.txt), and I want to perform x.cor<- cor(x)
in R, I got an error: Error in cor(x) : 'x' must be numeric
my .txt data is like that:
What organism are these cells and what language is the data in?
EDIT: Some Googling showed me that this could possibly be Arabic numerals: https://www.softschools.com/languages/arabic/numbers_1_10_in_arabic/
You need the "English numeral" from the table in that page, not the Arabic part. Some more Googling got me to a StackOverflow answer with this R code:
persian <- "\u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669\u06F0\u06F1\u06F2\u06F3\u06F4\u06F5\u06F6\u06F7\u06F8\u06F9"
english <- "01234567890123456789"
persian.tonumber <- function(s) as.numeric(chartr(persian,english,s))
Once you run the above code, you can use the persian.tonumber
function like you would any R function:
persian.tonumber("<your input here>")
See the linked post for a concrete example
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
How is this related to bioinformatics? This is a simple R error, did you try Googling the error message? Also, that data is not numeric.
my data are from Gene expressions in cells. and i want to calculate correlations of genes and create a pheatmap.