search for: city_unq

Displaying 1 result from an estimated 1 matches for "city_unq".

2011 Feb 02
2
Efficient way to determine if a data frame has missing observations
...has population data. In the full data frame, my approach to finding the missing observations has been to create a data frame with all combinations of 'city' and 'var', merge this onto the original data frame, and then extract the observations with missing data for 'value': city_unq<-c("A","B","C") var_unq<-c("sqmi","pop","emp") comb<-expand.grid(city=city_unq,var=var_unq) mrg<-merge(comb,df,by=c("city","var"),all=T) missing<-mrg[is.na(mrg$value),] This works, but on a large datase...