Closed kathy0305 closed 6 years ago
Great idea. Would you be willing to submit a pull request with this change?
ofcourse! should we change it to levels(sex)[1] <- NA or levels(sex)[1] <- "NA" ?
levels(sex)[1] <- NA
Ok, then when we plot(surveys$sex) only F and M will show
Oh. right. Hmm.
I don't use baseplot enough to know how to make it label the NAs as something.
@fmichonneau what are your thoughts? Should we leave it as 'missing' since the NAs don't get an x axis label with baseplot?
I don't think the missing data should be excluded from the plot - it might be important to show the number of missing data versus M and F. But +1 for levels(sex)[1] <- NA to keep it consistent!
I was traveling and couldn't comment earlier. My suggestion would be to use "undetermined" instead of "missing". This way we keep the data in the plot and we don't introduce the confusion over missing data being represented as NA.
@kathy0305 would you be willing to write up a pull request with @fmichonneau suggestion?
Oh, sure! pull request on its way. Thanks
this is has been implemented. Thanks @kathy0305 !
R-ecology-lesson
levels(sex) returned 3 levels "" "F" "M" so we decided to rename "" (empty sex label) "missing" levels(sex)[1] <- "missing"
I think we should stay consistent of how R names/represents missing data with NA specially that we introduced NA in the previous lesson. If the intention is to show the missing values in the plot, we can use NA in "" levels(sex)[1] <- "NA"
I just feel that they should start referring to missing values as NA's