Questions tagged [na.rm]

48 questions
-1
votes
2 answers

trying to use na.rm = TRUE to exclude NAs in graph output

I am using this code to calculate the means of different groups of values. > means <- aggregate(jots.xpc.txt$Cfxtn32, by=list(jots.xpc.txt$Tx), mean) > means Group.1 x 1 C1_Mac 0.04957707 2 C1_MH 0.14721646 3 C2_Mac 0.01389217 4 …
AnisaW
  • 7
  • 2
-2
votes
2 answers

Troubles with na.rm=TRUE with and without if statement

I am having a problems with getting na.rm to behave how I want to. I am practicing writing functions and currently writing a function for mean. My test vector is t <- c(12,14, NA, 1) my two test are my.mean(t) my.mean(t, na.rm=TRUE) my…
snowy
  • 17
  • 2
-2
votes
3 answers

Issue with removing missing values in ggplot2

I'm creating a bar chart using ggplot2 in R and I want to remove the missing values in my x-values, I have tried a few different ways of getting ride of "NA"s but nothing seems to change the output. Currently my code reads (data is not publicly…
mdavis
  • 15
  • 1
  • 4
1 2 3
4