Skip to content

Commit c7252f4

Browse files
committed
update the example
1 parent d92f27c commit c7252f4

File tree

3 files changed

+295
-134
lines changed

3 files changed

+295
-134
lines changed

README.Rmd

Lines changed: 47 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ knitr::opts_chunk$set(
2222

2323
A *data reporting template* is a standardized spreadsheet file (in either xls or xlsx format) used for reporting and processing experimental data. These templates significantly reduce the time required for data analysis and encourage users to present their data in a structured format, minimizing errors and misinterpretations.
2424

25-
The **excelDataGuide** package eliminates the need for users to write and maintain complex code for reading data from intricate spreadsheet DRTs. Additionally, it offers a robust framework for validating data, ensuring the correct data types are utilized, and facilitating data wrangling when necessary. This functionality supports *Interoperability* for DRTs, a key aspect of the [FAIR](https://www.go-fair.org/fair-principles/) principles.
25+
The **excelDataGuide** package eliminates the need for data analysts to write and maintain complex code for reading data from various complex spreadsheet DRTs. Additionally, it offers a robust framework for validating data, ensuring that the correct data types are utilized, and facilitating data wrangling when necessary. This functionality supports *Interoperability* for DRTs, a key aspect of the [FAIR](https://www.go-fair.org/fair-principles/) principles.
2626

2727
The package features a user-friendly interface for extracting data from Excel files and converting it into R objects. It accommodates three types of data structures: key-value pairs, tabular data, and microplate-formatted data. The locations of these structures within the Excel template are specified by a **data guide**, which is a YAML file — a structured format that is both human- and machine-readable.
2828

2929
## Installation
3030

31-
You can install the development version of excelDataGuide from [GitHub](https://github.com/) with:
31+
You can install the development version of excelDataGuide in a recent version of R from GitHub with:
3232

3333
``` r
3434
# install.packages("pak")
@@ -48,6 +48,50 @@ data <- read_data(datafile, guidefile)
4848

4949
The output of the `read_data()` function is a list object the format of which is determined for a large part by the design of the data guide.
5050

51+
## Details
52+
53+
### Data guide
54+
55+
The *data guide* is a human readable and editable file in [YAML](https://yaml.org/spec/1.2.2/) format that specifies the structure and location of the data in the Excel file. It contains a list of data types, each of which is defined by a name and a set of parameters. As the name suggests, the *data guide* is used by the **excelDataGuide** package as a guide to extract all indexed data from the Excel file and convert it into proper R objects. An example of part of a *data guide* is shown below:
56+
57+
```
58+
guide.version: '1.0'
59+
template.name: competition
60+
template.min.version: '9.3'
61+
template.max.version: ~
62+
plate.format: 96
63+
locations:
64+
- sheet: description
65+
type: cells
66+
varname: .template
67+
translate: false
68+
variables:
69+
- name: version
70+
cell: B2
71+
- sheet: description
72+
type: keyvalue
73+
translate: true
74+
atomicclass:
75+
- character
76+
- character
77+
- character
78+
- character
79+
- character
80+
- date
81+
- character
82+
- numeric
83+
- character
84+
- numeric
85+
- character
86+
- numeric
87+
- character
88+
- character
89+
varname: metadata
90+
ranges:
91+
- A10:B21
92+
- A24:B25
93+
```
94+
5195
## Future work
5296

53-
We want to provide guide and template structures for data types without upper size limit, like time series with no pre-determined length.
97+
We want to provide guide and template structures for data types without upper size limit, typically time series with no pre-determined length.

data-raw/create_test_guides.R

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
sourcename <- "guide_competition_1_0_source.yml"
44
targetname <- "guide_competition_1_0.yml"
5+
examplename <- "example_guide.yml"
56

67
source <- yaml::read_yaml(file.path("data-raw", sourcename))
78

@@ -29,6 +30,7 @@ write_yaml_mod <- function(x, file) {
2930

3031
# write the source file to the testdata folder
3132
write_yaml_mod(source, file.path("tests/testthat/testdata", targetname))
33+
write_yaml_mod(source, file.path("inst/extdata", examplename))
3234

3335
# Take a list s and a list of index numbers and/or names x and return
3436
# a vector of index numbers in list s correspond to the index names and or

0 commit comments

Comments
 (0)