in a time series dataframe named "csmib", drop all the rows containing na observations in r

To drop all rows containing NA values in a time series dataframe named "csmib" in R, you can use the complete.cases() function to identify and subset the complete rows without missing values.

main.r
csmib <- csmib[complete.cases(csmib),]
39 chars
2 lines

This code will remove all rows that contain any missing values in the csmib dataframe, producing a modified version of the original dataframe with only complete observations.

gistlibby LogSnag