Reputation: 115
I know this is a very basic question. So you might wonder why this is even bothering. But, I have an issue with rounding numbers up.
I tried this but none of this worked.
mode(RNA_data) <- 'numeric'
Error in mde(x) : (list) object cannot be coerced to type 'double'
RNA_data<-as.numeric(RNA_data)
Error: (list) object cannot be coerced to type 'double'
round(P7_N02_RNA, digits=0)
Error in Math.data.frame(list(P07_N02_RNA.genes.V5 = c(326L, 1L, 851L, :
non-numeric variable(s) in data frame: P07_N02_RNA.genes.V5
Error: unexpected symbol in "non-numeric variable"
P7_N02_RNA <- round(P7_N02_RNA, digits=0)
Error in Math.data.frame(list(P07_N02_RNA.genes.V5 = c(326L, 1L, 851L, :
non-numeric variable(s) in data frame: P07_N02_RNA.genes.V5
Error: unexpected symbol in "non-numeric variable"
trimmed_RNA <- round(RNA_data$p07_N01,digit = 0)
Error in round(RNA_data$p07_N01, digit = 0) :
non-numeric argument to mathematical function
Error: unexpected symbol in "non-numeric argument"
trimmed_RNA <- round(RNA_data[-1,], digits=0)
Error in Math.data.frame(list(geneID = 2:58639, p07_N01 = c(2175L, 9753L, : non-numeric variable(s) in data frame: geneID, p07_N01, p07_T01, p07_N02, p07_T02, p08_N01, p08_T01, p08_N02, p08_T02, p09_N01, p09_T01, p09_N02, p09_T02
RNA_data <-data.frame(RNA_data)
trimmed_RNA <- data.frame(round(as.numeric(levels(RNA_data)[RNA_data])))
got a reault with 0 obs.
rm(trimmed_RNA)
require(data.table)
setDT(RNA_data)
RNA_data[, RNA_data:=round(as.numeric(levels(RNA_data)[RNA_data]))]
Error in
[.data.table
(RNA_data, ,:=
(RNA_data, round(as.numeric(levels(RNA_data)[RNA_data])))) : RHS of assignment to existing column 'RNA_data' is zero length but not NULL. If you intend to delete the column use NULL. Otherwise, the RHS must have length > 0; e.g., NA_integer_. If you are trying to change the column type to be an empty list column then, as with all column type changes, provide a full length RHS vector such as vector('list',nrow(DT)); i.e., 'plonk' in the new column.**
This is how data looks like with 58639 rows.
I also tried to export files into csv file and trim them in excel but, also had a circular reference error, and didn't work. Now I have no idea what can I do.
Can anybody help me with rounding up those numbers?
Upvotes: 0
Views: 300
Reputation: 2770
Its hard to tell from your question, but first convert your variables to numeric like this:
mtcars$mpg <- as.numeric( as.character( mtcars$mpg))
And is this what you mean by rounding up
ceiling( mtcars$qsec )
round( mtcars$disp , -1 )
Upvotes: 0