ropensci / EML

Ecological Metadata Language interface for R: synthesis and integration of heterogenous data
https://docs.ropensci.org/EML
Other
97 stars 33 forks source link

Possible Inclusion of a Shiny Attribute Table Builder #243

Open maier-m opened 6 years ago

maier-m commented 6 years ago

Hello, I built some tools for the Arctic Data Center at NCEAS to help build attribute tables in an R shiny environment. A demonstration of the tools is shown below. Essentially the tools use R shiny and handsontableJS to create an opinionated tabular environment for building attributes. Enumerated domain factors and custom units are also built simultaneously. Additionally there are tools built using the udunits2 library to help users with converting to EML units (e.g. inputting "m" will automatically correct to "meter"). I built these for the NCEAS ADC data support team but feel they may have utility to EML users at large. Please let me know if there is any interest including versions of these tools here.

create_attributes_table

cboettig commented 6 years ago

@maier-m This looks really cool! Have you taken a look at https://github.com/cboettig/eml2 ? eml2 uses a JSON structure on the backend to represent EML (which can be rendered into schema-valid XML), which I think make it much easier to build upon than original EML. (e.g. you can get a light-weight version of this just by using the json editor from the listviewer package), and might be easier to work with from handsontable as well? (Since my development effort is now more on eml2 I'm also just trying to get more eyes on it and would love if you could take a look; I think it addresses some of the more frustrating aspects of working with the EML package, like getting rid of all the @[[1]] and as(... nonsense.)

But really like the interface and the integration with udunits2 to build and export the attributes table, and I think other users would find that valuable. I'd certainly welcome a PR here and/or at eml2.

maier-m commented 6 years ago

Great. Yeah, these tools don't actually build any EML class objects. They just build data.frames which readily can be transformed into EML objects with existing EML, and from what it appears, eml2 tools. I will take a deeper look at eml2 and create a PR. Thanks.

cboettig commented 6 years ago

Right, so it creates the attribute table in .csv format independent of any subsequent tooling that turns that table into an EML structure. That makes perfect sense. Incidentally, have you found the table format sufficient for the data the Arctic team encounters? Obviously it's not quite as flexible as the attribute definitions of native EML, but I hope it hits the most use cases. Looks like you are also highlighting which fields are required?

maier-m commented 6 years ago
cboettig commented 5 years ago

This was merged into https://github.com/cboettig/eml2/pull/10 , which has now been merged back here.

@maier-m it would be wonderful if you might update / replace the current working-with-units vignette to reflect these tools (both the cli and shiny interface)? Or did we have that vignette and I misplace it in all the merging and moving?

maier-m commented 5 years ago

Hi Carl,

I agree. Let me take a look and I can see if I can update these. It might take me a couple days to get around to it, but will make a note. I don't think a clear vignette was ever made.

Cheers,

On Tue, Nov 27, 2018 at 11:56 AM Carl Boettiger notifications@github.com wrote:

This was merged into cboettig/eml2#10 https://github.com/cboettig/eml2/pull/10 , which has now been merged back here.

@maier-m https://github.com/maier-m it would be wonderful if you might update / replace the current working-with-units vignette to reflect these tools (both the cli and shiny interface)? Or did we have that vignette and I misplace it in all the merging and moving?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ropensci/EML/issues/243#issuecomment-442195168, or mute the thread https://github.com/notifications/unsubscribe-auth/AP78jLR7IAP2Gm9KX_RpNDvjDmn0_eloks5uzZjqgaJpZM4TcrPw .

cboettig commented 5 years ago

@maier-m Thanks Mitchell! A vignette, maybe with a screenshot of the shiny app, would be awesome.

Also, I had some trouble on the get_unit_id tests recently that really confused me, two tests seemed to expect additional behavior simplifying the unit notation. I couldn't reproduce the expected behavior so those tests are currently turned off: https://github.com/ropensci/EML/blob/master/tests/testthat/test_get_unit_id.R#L80-L106

maybe you can take a quick look at that as well? Thanks much.

maier-m commented 5 years ago

Ok, good to know. There may be something funny happening there, I can take a look as well.

On Tue, Nov 27, 2018 at 1:10 PM Carl Boettiger notifications@github.com wrote:

@maier-m https://github.com/maier-m Thanks Mitchell! A vignette, maybe with a screenshot of the shiny app, would be awesome.

Also, I had some trouble on the get_unit_id tests recently that really confused me, two tests seemed to expect additional behavior simplifying the unit notation. I couldn't reproduce the expected behavior so those tests are currently turned off: https://github.com/ropensci/EML/blob/master/tests/testthat/test_get_unit_id.R#L80-L106

maybe you can take a quick look at that as well? Thanks much.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/ropensci/EML/issues/243#issuecomment-442218010, or mute the thread https://github.com/notifications/unsubscribe-auth/AP78jKO2vDDXqy_VjEL8MkFIMJ7mjiSNks5uzao7gaJpZM4TcrPw .

trashbirdecology commented 4 years ago

It's not clear how to use the EML::shiny_attributes() to build the tables, as demonstrated by OP.

When I open EML::shiny_attributes(), I am left with a screen that allows only the following options:

Here is a screenshot of what I see when I run EML::shiny_attributes() image

This screenshot shows the app being "greyed" out, which reflects what I am seeing when running the app. Not sure what's going on there, either.

jeanetteclark commented 4 years ago

Hi @TrashBirdEcology do you mind sharing your session info? when I run t <- shiny_attributes() I see this: Screen Shot 2020-06-11 at 9 47 47 AM

Note that you can also run shiny_attributes assigning the data argument to a data.frame with your data, which will pre-fill some information.