cont-limno / LAGOSNE

Interface to the LAke multi-scaled GeOSpatial & temporal database :earth_americas:
https://cont-limno.github.io/LAGOSNE/
15 stars 8 forks source link

Pull all columns from table if no columns or categories specified #20

Closed jsta closed 7 years ago

jsta commented 7 years ago

See #15

jsta commented 7 years ago

@limnoliver How do you envision the user specifying a table with no columns? My ideas are one of :

dt_reduced <- lagos_select(dt, table_column_nested = list("epi.nutr" = ""))

dt_reduced <- lagos_select(dt, table_column_nested = list("epi.nutr" = NA))

It would be tricky to do either of the following under the existing selection framework:

dt_reduced <- lagos_select(dt, table_column_nested = list("epi.nutr"))

dt_reduced <- lagos_select(dt, table_column_nested = "epi.nutr")

Because the named list-elements are much different form than the full specification:

list("epi.nutr" = c("doc", "lagoslakeid"))

$epi.nutr [1] "doc" "lagoslakeid

versus

"epi.nutr"

[1] "epi.nutr"

or

list("epi.nutr")

[[1]] [1] "epi.nutr"

limnoliver commented 7 years ago

@jsta - is this getting at when a user wants to pull the whole table (intentionally) or when the user accidentally does not specify the columns. We could have an "all" grouping that the user could specify, which pulls all columns. And an error occurs if there is not some column name or group listed.

jsta commented 7 years ago

This is beyond the current scope of lagos_select. The current strategy for returning entire tables is to just use the native R subsetting routines.