Skip to content

Conversation

@FedeMassetti
Copy link

I tried to address the problems presented by aggregate_spectra in handling multiple columns in the data of the SpectralDataFrame objects.
With this modification, as soon as all the non-numeric columns are listed as "id", everything runs smoothly (tested for mean and median on the australia dataset and on my own dataset).
The only problem is that the following message is given. But the output has always been alright so far.
Warning message:
In if (id %in% names(features(obj))) { :
the condition has length > 1 and only the first element will be used

This would be worth double checking since this is the first try I try programming in R!

I tried to address the problems presented by aggregate_spectra in handling multiple columns in the data of the SpectralDataFrame objects.
With this modification, as soon as all the non-numeric columns are listed as "id", everything runs smoothly (tested for mean and median on the australia dataset and on my own dataset).
The only problem is that the following message is given. But the output has always been alright so far.
Warning message:
In if (id %in% names(features(obj))) { :
  the condition has length > 1 and only the first element will be used

This would be worth double checking since this is the first try I try programming in R!
@FedeMassetti
Copy link
Author

FedeMassetti commented Aug 29, 2018

There was some problem happening when using just one column as id. Now it should be fixed.
Except for the warning message I mentioned before there is just one bug remaining that I cannot fix. Plyr needs to be loaded after spectacles otherwise it cannot run properly giving the following error.

Error in ddply(s, id, colwise(fun), ...) :
could not find function "ddply"

The strange thing is that if I run s <- ddply(s, id, colwise(mean)) alone I get the same error with or without the updated function running. But as a part of the use of aggregate_spectra it doesn't give any problem until the updated function is loaded.
The error doesn't appear also if require(plyr) is placed at the beginning of the script.

Replaced some elements that were dependent from dplyr.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant