Skip to content

Commit

Permalink
Adding example of an inst file and vignettes
Browse files Browse the repository at this point in the history
  • Loading branch information
gvegayon committed Nov 26, 2024
1 parent c6bd05a commit 0389bc9
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,21 @@ plot(pressure)
```

In that case, don't forget to commit and push the resulting figure files, so they display on GitHub and CRAN.


## Installing from source

You can install this package from the source using the following commands from the command line:

```bash
R CMD build .
R CMD INSTALL egpkg2024_1.0.tar.gz
```

The first command builds a tar.gz file that can be shared. This is what you share when you submit to CRAN. The second command installs the package in your computer. Notice that this approach builds the vignettes, making them available to your R session. Recall you can access vignettes using the `vignette` command like this:

```{r}
vignette(package="dplyr")
```

Which will list the vignettes available to the dplyr R package (learn more typing `?vignette` in your R console).
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,26 @@ You can also embed plots, for example:

In that case, don’t forget to commit and push the resulting figure
files, so they display on GitHub and CRAN.

## Installing from source

You can install this package from the source using the following
commands from the command line:

``` bash
R CMD build .
R CMD INSTALL egpkg2024_1.0.tar.gz
```

The first command builds a tar.gz file that can be shared. This is what
you share when you submit to CRAN. The second command installs the
package in your computer. Notice that this approach builds the
vignettes, making them available to your R session. Recall you can
access vignettes using the `vignette` command like this:

``` r
vignette(package="dplyr")
```

Which will list the vignettes available to the dplyr R package (learn
more typing `?vignette` in your R console).
2 changes: 2 additions & 0 deletions inst/analysis-scripts/analysis.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
setwd("george/akjdalk")

Binary file modified man/figures/README-pressure-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions vignettes/not-cool-package.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,12 @@ knitr::include_graphics(
```

![](`r system.file("R_logo.svg.png", package = "egpkg2024")`)


You can see a full featured R script that uses the package under the following path:

```r
system.file("analysis-scripts/analysis.R", package="egpkg2024")
```

(which will vary depending on where you installed the package).

0 comments on commit 0389bc9

Please sign in to comment.