# "Other" "Master's, professional school, or doctoral degree" "Master's, professional school, or doctoral degree" # "Master's, professional school, or doctoral degree" "Master's, professional school, or doctoral degree" "Master's, professional school, or doctoral degree" # "Other" "Master's, professional school, or doctoral degree" "Master's, professional school, or doctoral degree" # "Master's, professional school, or doctoral degree" "Master's, professional school, or doctoral degree" NA # "Master's, professional school, or doctoral degree" NA "Master's, professional school, or doctoral degree" # "Master's, professional school, or doctoral degree" "Master's, professional school, or doctoral degree" "Master's, professional school, or doctoral degree" # NA "Other" "Master's, professional school, or doctoral degree", ![]() ![]() Ses_data_reduced$EDUCD_MOM_reclass <- ifelse(ses_data_reduced$EDUCD_MOM = 65 & ses_data_reduced$EDUCD_MOM= 81 & ses_data_reduced$EDUCD_MOM= 101 & ses_data_reduced$EDUCD_MOM= 114 & ses_data_reduced$EDUCD_MOM<= 116, "Master's, professional school, or doctoral degree", Ses_data_reduced$EDUCD_MOM_reclass<- NULL #create empty field. “Master’s, professional school, or doctoral degree”) Ordered_levels_ipums = c(“High school diploma or the equivalent, such as GED”, “Some college but no degree”, “Associate degree in college”, “Bachelor’s degree”, Here’s my code so you can understand what I am working with: I want the value to stay as NA if it’s true and to report the observed value if it is false. I want to use the is.na and define what I want it to do if it finds an NA value. I’m trying to reclass values for a dataframe and I’m populating values in an already existing table with new values in a specific column with the ifelse function. The graphic can be produced with the following R code: The header graphic of this page illustrates NA values in our data. However, there are hundreds of different possibilities to apply is.na in a useful way.ĭo you know any other helpful applications? Or do you have a question about the usage of is.na in a specific scenario?ĭon’t hesitate to let me know in the comments! I’ve shown you the most important ways to use the is.na R function. I also speak about other functions for the handling of missing data in R data frames. ![]() In the video, I provide further examples for is.na. You want to learn even more possibilities to deal with NAs in R? Then definitely check out the following video of my YouTuber channel. In the video, I’m explaining the contents of this post. Video & Further Examples for the Handling of NAs in Rĭo you need further info on the R code of this article? Then you might have a look at the following video on my YouTube channel. na (data$x_num ), "Damn, it's NA", "Wow, that's awesome" ) # "Wow, that's awesome" "Wow, that's awesome" "Wow, that's awesome" "Damn, it's NA" # "Damn, it's NA" "Wow, that's awesome".
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |