You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
library(pavo)
#> Welcome to pavo 2! Take a look at the latest features (and update your bibliography) in our recent publication: Maia R., Gruson H., Endler J. A., White T. E. (2019) pavo 2: new tools for the spectral and spatial analysis of colour in R. Methods in Ecology and Evolution, 10, 1097-1107.
data(flowers)
di<- sensmodel(c(440, 330))
names(di) <- c("wl", "l", "s")
di_vis<- as.data.frame(vismodel(flowers, visual=di))
head(di_vis)
#> l s lum#> Goodenia_heterophylla 0.9730821 0.0269178704 NA#> Goodenia_geniculata 0.9507922 0.0492078038 NA#> Goodenia_gracilis 0.9247331 0.0752668919 NA#> Xyris_operculata 0.9997937 0.0002062707 NA#> Eucalyptus_sp 0.9796303 0.0203697463 NA#> Faradaya_splendida 0.8829416 0.1170583601 NA
head(colspace(di_vis))
#> Warning: Input data is not a "vismodel" object *and* has more than two columns;#> treating the first two columns as standardized quantum catch for "s", and "l"#> receptors, respectively#> s l x r.vec lum#> Goodenia_heterophylla 0.9730821 0.0269178704 -0.6690392 0.6690392 NA#> Goodenia_geniculata 0.9507922 0.0492078038 -0.6375164 0.6375164 NA#> Goodenia_gracilis 0.9247331 0.0752668919 -0.6006633 0.6006633 NA#> Xyris_operculata 0.9997937 0.0002062707 -0.7068151 0.7068151 NA#> Eucalyptus_sp 0.9796303 0.0203697463 -0.6782996 0.6782996 NA#> Faradaya_splendida 0.8829416 0.1170583601 -0.5415613 0.5415613 NA
In the colspace object, the s and l columns are swapped. This is consistent with the warning but it would be nice if pavo could work with this out of the box.
The text was updated successfully, but these errors were encountered:
Yeah I started to chip away at this as part of a more general attempt at #102, but got tangled up. I suspect it'd be simplest to first refactor out all those data-checks that are duplicated across the colspace functions (hexagon, trispace etc.), then just fix it in the one spot. That change is simple enough — we just need to be smarter about checking the structure of the data — but might take a little effort to get there.
Created on 2020-02-18 by the reprex package (v0.3.0)
In the
colspace
object, thes
andl
columns are swapped. This is consistent with the warning but it would be nice ifpavo
could work with this out of the box.The text was updated successfully, but these errors were encountered: