0

I have a dataset that looks like this:

head(d)
X timestamp      station   year  month   ndvi    landcover     altitude   precipitation
1      1           A       2000   jan   0.4138   Mixed forest     2143          16.0

and I would like to do this with it:

r <- aggr(d,c("station","landcover","year"),c("altitude=mean(altitude)",
         "max.ndvi=NA","max.month=NA","max.timestamp=NA","precipitation=NA"))

Unfortunately, I get the error:

Error in aggr_work(x, delimiter, plot, ...) : 
The missing-index of imputed variables must be of the type logical
In addition: Warning message:
In grep(delimiter, colnames(x)) :
argument 'pattern' has length > 1 and only the first element will be used

I tried researching possible solutions for this error but without any success. Are there too many elements?

I would appreciate any help.

Thanks!

  • 1
    There is no `aggr` function in base R, so your error is not reproducible. If you are using a package or someone's code, please edit your question accordingly. – tonytonov Apr 23 '14 at 11:58
  • @tonytonov Yes the person just sent me their package and it works out now. I had installed the VIM package initially, but that didn't work. – user3460660 Apr 23 '14 at 13:12
  • Please use the [following guideline](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) to ask a question that can be actually answered. Without your code, how should the community approach your problem? – tonytonov Apr 23 '14 at 13:18
  • That's right, aggr is a function of the VIM package (visualization of missing values) – Colibri Jun 12 '19 at 18:58

0 Answers0