diff --git a/.github/workflows/quarto-render-publish.yml b/.github/workflows/quarto-render-publish.yml index efdddc8..2df7eea 100644 --- a/.github/workflows/quarto-render-publish.yml +++ b/.github/workflows/quarto-render-publish.yml @@ -4,6 +4,10 @@ on: push: branches: - main + pull_request: + branches: + - main + workflow_dispatch: jobs: build-deploy: @@ -11,10 +15,7 @@ jobs: steps: - name: Check out repository uses: actions/checkout@v3 - - - name: Setup pandoc - uses: r-lib/actions/setup-pandoc@v2 - + - name: Set up Quarto uses: quarto-dev/quarto-actions/setup@v2 with: @@ -25,11 +26,13 @@ jobs: - name: Install R uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true + Ncpus: 2 + extra-repositories: https://rpolars.r-universe.dev - name: Install packages - run: | - Rscript -e 'install.packages(c("rmarkdown","dplyr","tidyr","arrow","data.table","fakir","tictoc","duckdb","DBI","microbenchmark","readr","fs","ggplot2","pryr","dbplyr","forcats"))' - Rscript -e 'install.packages("polars", repos = "https://rpolars.r-universe.dev")' + uses: r-lib/actions/setup-r-dependencies@v2 - name: Render Quarto Project uses: quarto-dev/quarto-actions/render@v2 @@ -37,6 +40,7 @@ jobs: path: book # By default, the current working dir is used i.e `quarto render .` - name: Publish to GitHub Pages (and render) + if: github.event_name != 'pull_request' uses: quarto-dev/quarto-actions/publish@v2 with: path: book diff --git a/DESCRIPTION b/DESCRIPTION new file mode 100644 index 0000000..afd08c8 --- /dev/null +++ b/DESCRIPTION @@ -0,0 +1,35 @@ +Package: cookbookrpolars +Title: Cookbook to provide solutions to common tasks and problemes in using Polars with R +Version: 0.0.1 +Authors@R: + c(person(given = "Damien", + family = "Dotta", + role = c("aut", "cre"), + email = "damien.dotta@live.fr")) +Description: The purpose of this book is to introduce some of the features + of Polars with R. It contains a side-by-side comparison between Polars, + R base and the two most popular packages for data manipulation dplyr + and data.table. +License: file LICENSE +Encoding: UTF-8 +Roxygen: list(markdown = TRUE) +RoxygenNote: 7.3.1 +Imports: + polars, + rmarkdown, + dplyr, + tidyr, + arrow, + data.table, + fakir, + tictoc, + duckdb, + DBI, + microbenchmark, + readr, + fs, + ggplot2, + pryr, + dbplyr, + forcats, + collapse diff --git a/book/content/first_steps/_setup_first_steps.qmd b/book/content/first_steps/_setup_first_steps.qmd index 8bdaa1b..4e164b8 100644 --- a/book/content/first_steps/_setup_first_steps.qmd +++ b/book/content/first_steps/_setup_first_steps.qmd @@ -27,21 +27,15 @@ Until the R polars package is uploaded to CRAN, [the polars package development The most practical one in my opinion at the moment is to use [R-universe](https://r-universe.dev/search/) and install like this: -``` {r} -#| label: installation -#| message: false -#| warning: false -#| results: 'hide' - +```{.r} install.packages("polars", repos = "https://rpolars.r-universe.dev") -library(polars) ``` -To know the version of the `polars` package you have just installed and to have information on which features are enabled, you can use the `polars_info()` method. +To know the version of the `polars` package you have just installed and to have information on which features are enabled, you can use the `polars_info()` function. ```{r} #| label: polars_info-function +library(polars) polars_info() ``` -