diff --git a/.Rbuildignore b/.Rbuildignore index 159f392c..b56a59b9 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -2,3 +2,7 @@ ^\.Rproj\.user$ ^LICENSE\.md$ ^README\.Rmd$ +^_pkgdown\.yml$ +^docs$ +^pkgdown$ +^\.github$ diff --git a/.github/.gitignore b/.github/.gitignore new file mode 100644 index 00000000..2d19fc76 --- /dev/null +++ b/.github/.gitignore @@ -0,0 +1 @@ +*.html diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml new file mode 100644 index 00000000..ed7650c7 --- /dev/null +++ b/.github/workflows/pkgdown.yaml @@ -0,0 +1,48 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help +on: + push: + branches: [main, master] + pull_request: + branches: [main, master] + release: + types: [published] + workflow_dispatch: + +name: pkgdown + +jobs: + pkgdown: + runs-on: ubuntu-latest + # Only restrict concurrency for non-PR jobs + concurrency: + group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }} + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + permissions: + contents: write + steps: + - uses: actions/checkout@v3 + + - uses: r-lib/actions/setup-pandoc@v2 + + - uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::pkgdown, local::. + needs: website + + - name: Build site + run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) + shell: Rscript {0} + + - name: Deploy to GitHub pages 🚀 + if: github.event_name != 'pull_request' + uses: JamesIves/github-pages-deploy-action@v4.4.1 + with: + clean: false + branch: gh-pages + folder: docs diff --git a/.gitignore b/.gitignore index 565f2b6a..8ff9bf4f 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,5 @@ .Rdata .httr-oauth .DS_Store +inst/doc +docs diff --git a/DESCRIPTION b/DESCRIPTION index 45a989cc..35d16e06 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: qSIP2 Title: qSIP Analysis -Version: 0.3.4 +Version: 0.4.0 Authors@R: person("Jeff", "Kimbrel", , "kimbrel1@llnl.gov", role = c("aut", "cre"), comment = c(ORCID = "YOUR-ORCID-ID")) @@ -10,6 +10,8 @@ Encoding: UTF-8 Roxygen: list(markdown = TRUE) RoxygenNote: 7.2.3 Suggests: + knitr, + rmarkdown, testthat (>= 3.0.0) Config/testthat/edition: 3 Imports: @@ -18,5 +20,10 @@ Imports: ggplot2, glue, S7 -URL: https://github.com/jeffkimbrel/qSIP2 +URL: https://github.com/jeffkimbrel/qSIP2, + https://jeffkimbrel.github.io/qSIP2/ BugReports: https://github.com/jeffkimbrel/qSIP2/issues +VignetteBuilder: knitr +Depends: + R (>= 2.10) +LazyData: true diff --git a/R/qsip_sample_object.R b/R/qsip_sample_object.R index 261d18c7..0a937b00 100644 --- a/R/qsip_sample_object.R +++ b/R/qsip_sample_object.R @@ -15,10 +15,10 @@ qsip_sample_object <- S7::new_class("qsip_sample_object", properties = list( data = S7::class_data.frame, - isotope = S7::class_character, - isotopolog = S7::class_character, + isotope = S7::new_property(S7::class_character, default = "isotope"), + #isotopolog = S7::class_character, isotopolog_label = S7::class_character, - isotopolog_approach = S7::class_character, + #isotopolog_approach = S7::class_character, gradient_position = S7::new_property(S7::class_character, default = "gradient_position"), gradient_pos_density = S7::new_property(S7::class_character, default = "gradient_pos_density"), gradient_pos_amt = S7::new_property(S7::class_character, default = "gradient_pos_amt"), @@ -26,9 +26,9 @@ qsip_sample_object <- S7::new_class("qsip_sample_object", source_mat_id = S7::new_property(S7::class_character, default = "source_mat_id") ), validator = function(self) { - qSIP2::isotope_validation(self@data %>% pull(self@isotope)) - qSIP2::gradient_pos_density_validation(self@data %>% pull(self@gradient_pos_density)) - qSIP2::gradient_position_validation(self@data %>% pull(self@gradient_position)) + qSIP2::isotope_validation(self@data |> dplyr::pull(self@isotope)) + qSIP2::gradient_pos_density_validation(self@data |> dplyr::pull(self@gradient_pos_density)) + qSIP2::gradient_position_validation(self@data |> dplyr::pull(self@gradient_position)) } ) diff --git a/_pkgdown.yml b/_pkgdown.yml new file mode 100644 index 00000000..d206eb1e --- /dev/null +++ b/_pkgdown.yml @@ -0,0 +1,4 @@ +url: https://jeffkimbrel.github.io/qSIP2/ +template: + bootstrap: 5 + diff --git a/data/sample_data_MISIP.rda b/data/sample_data_MISIP.rda new file mode 100644 index 00000000..3a37dc9a Binary files /dev/null and b/data/sample_data_MISIP.rda differ diff --git a/man/qsip_sample_object.Rd b/man/qsip_sample_object.Rd index 91c2941e..387cc95f 100644 --- a/man/qsip_sample_object.Rd +++ b/man/qsip_sample_object.Rd @@ -7,9 +7,7 @@ qsip_sample_object( data = class_missing, isotope = class_missing, - isotopolog = class_missing, isotopolog_label = class_missing, - isotopolog_approach = class_missing, gradient_position = class_missing, gradient_pos_density = class_missing, gradient_pos_amt = class_missing, diff --git a/vignettes/.gitignore b/vignettes/.gitignore new file mode 100644 index 00000000..097b2416 --- /dev/null +++ b/vignettes/.gitignore @@ -0,0 +1,2 @@ +*.html +*.R diff --git a/vignettes/sample_data.Rmd b/vignettes/sample_data.Rmd new file mode 100644 index 00000000..2ca2ea9f --- /dev/null +++ b/vignettes/sample_data.Rmd @@ -0,0 +1,37 @@ +--- +title: "sample_data" +output: rmarkdown::html_vignette +vignette: > + %\VignetteIndexEntry{sample_data} + %\VignetteEncoding{UTF-8} + %\VignetteEngine{knitr::rmarkdown} +editor_options: + chunk_output_type: console +--- + +```{r, include = FALSE} +knitr::opts_chunk$set( + collapse = TRUE, + comment = "#>" +) +``` + +```{r setup} +library(qSIP2) +``` + +# Sample Data + +The `qSIP2` package comes with a basic example tibble called `sample_data_MISIP`, and some of the columns are already formatted with proper MISIP headers. + +# Make a qSIP sample data object + +The `qsip_sample_object` constructor builds a sample data object from a dataframe. + +```{r} +qdf = qsip_sample_object(sample_data_MISIP) +``` + +And that's that, for now. + +