Dear All:

I have been trying to remove "Inf" values from a series of data (multiple ratio operations). I have tried the na.rm() function (and tried this inside mean(), median(), and var()) but this does not always work. Though the !is.finite() or is.infinite() functions appear to be very promising, this would require the creation of an intermediary variable and would make the direct creation of a data.frame() from a series of ratios much less convenient.

Would anyone have a hint on a function similar to na.rm(), except it removes Inf values? Would anyone in the R project be possibly interested on adding this functionality?

Minimal example:

TissueRatios = rbind(
rbind(c(median(XmodA$IDPG[XmodA$Organ=="Tumor" & XmodA$Time=="48h"]/XmodA$IDPG[XmodA$Organ=="Blood" & XmodA$Time=="48h"], na.rm=TRUE), var(XmodA$IDPG[XmodA$Organ=="Tumor" & XmodA$Time=="48h"]/XmodA$IDPG[XmodA$Organ=="Blood" & XmodA$Time=="48h"], na.rm=TRUE), 1, 1, 1), c(median(XmodA$IDPG[XmodA$Organ=="Tumor" & XmodA$Time=="72h"]/XmodA$IDPG[XmodA$Organ=="Blood" & XmodA$Time=="72h"], na.rm=TRUE), var(XmodA$IDPG[XmodA$Organ=="Tumor" & XmodA$Time=="72h"]/XmodA$IDPG[XmodA$Organ=="Blood" & XmodA$Time=="72h"], na.rm=TRUE), 2, 1, 1), c(median(XmodA$IDPG[XmodA$Organ=="Tumor" & XmodA$Time=="96h"]/XmodA$IDPG[XmodA$Organ=="Blood" & XmodA$Time=="96h"], na.rm=TRUE), var(XmodA$IDPG[XmodA$Organ=="Tumor" & XmodA$Time=="96h"]/XmodA$IDPG[XmodA$Organ=="Blood" & XmodA$Time=="96h"], na.rm=TRUE), 3, 1, 1)), . . .)


Thank you in advance for any help!
Julia

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to