aphalo / ggspectra

R package 'ggspectra' (from r4photobiology suite)
https://docs.r4photobiology.info/ggspectra
5 stars 0 forks source link

Improve handling of spectra in long form in autotitle() #1

Closed aphalo closed 6 months ago

aphalo commented 2 years ago

Brief description of the problem

autotitle() and autoplot() cannot handle the attribute values returned by spct objects containing multiple spectra in long form, as they are lists of the usual values, with one member per spectrum. There is no easy way to solve this, as pasting them would make titles too long. Currently autotitle() returns NULL with a warning which is o.k., but not ideal.

aphalo commented 2 years ago

Editted autoplot() methods so that object.label gets set to the correct value for collections of spectra and correctly passed to autotitle().

aphalo commented 1 year ago

Updated autotitle() to support the attributes that can be easily supported. Other attributes are tougher to handle. when.measured could be converted to a range. where.measured could be supported if the same geocode is attached to all spectra. how.measured could be supported if unique accross all spectra. For the time being I will put this additional nicieties on hold.

aphalo commented 6 months ago

Updated now to support all the attributes, at least when possible, i.e., after calling unique() or range().