A Shiny input widget using hodf, allowing collection of data.frame objects with variable column widths.
You can install directly from GitHub:
devtools::install_github('shuttlethread/hodfr')
Somewhere in the UI definition, include a hodfr element with::
hodfr::hodfr(
"catch_at_age",
fields = list(type = "bins", max = 10),
values = list(type = "year", min = 2000, max = 2010)),
...then in server.R, input$catch_at_age
will be a data.frame with the
contents of the table.
fields
and values
give a range for the data.frame rows and columns
respectively. These exactly match the values for a hodf template, see the
template documentation
for more detail and examples.
You can also update the data.frame contents from R with:
hodfr::updateHodfrInput(session, "catch_at_age", new_data)
For a complete example, look at the demo/hodfr.R script.
The package includes precompiled javascript sources, to make any changes to
javascript you need to re-build this as well as the package with either make build
, or make install
to rebuild and install the built R package.
Developed as part of FarFish, which has received funding from the European Union’s Horizon 2020 research and innovation programme under grant agreement no. 727891.