I have the csv file and I want to read it as a dataframe or matrix. I successfully read the .csv file, but when I want to change the entries based on conditional if statement, it does not work. The csv file can be downloaded here mydata
I want to read this .csv file as a matrix or dataframe. Then, I want to change the entries to "YES" or "NO" based on some condition. I tried this:
mydata = read.csv("mydata.csv")
mydata = data.frame(mydata)
ifelse(mydata>0.005, "YES", "NO")
mydata
However, the result I got are
and 
I have tried this
mydata =
read.csv("/home/hudamoh/scRNAspatial/binomial/tangram_output.csv")
myresult = data.frame(mydata)
myresult[myresult>0.0005] <- "YES"
myresult[myresult<=0.0005] <- "NO"
myresult
But the output I got is that some are not changed to "YES" or "NO". Also I want it looks like matrix where the rows should be 0, 1, 9. Please help.

Aucun commentaire:
Enregistrer un commentaire