-
Notifications
You must be signed in to change notification settings - Fork 2
/
README.Rmd
107 lines (82 loc) · 3.14 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
---
title: "README"
output:
md_document:
variant: markdown_github
params:
NVIpkg: "NVIpretty"
pkg_path: !r usethis::proj_path()
first_copyright_year: "2020"
---
```{r, include = FALSE}
NVIpkg <- params$NVIpkg
pkg_path <- params$pkg_path
NVIpkg_inline <- paste0("`", NVIpkg, "`")
logo_path <- ""
if (file.exists(paste0("./man/figures/", NVIpkg, "_logo.png"))) {
logo_path <- paste0(' <img src="man/figures/', NVIpkg, '_logo.png" align="right" height="138" />')
}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```
`r paste0(NVIpkg, ": ", desc::desc_get_field(key = "Title"), logo_path)`
================
<!-- README.md is generated from README.Rmd. Please edit that file -->
- [Overview](#overview)
- [Installation](#installation)
- [Usage](#usage)
- [Copyright and license](#copyright-and-license)
- [Contributing](#contributing)
# Overview
```{r, include = FALSE}
description <- desc::desc_get_field(key = "Description")
```
`r paste0(NVIpkg_inline,
"",
sub(substr(description,1,1), tolower(substr(description,1,1)), description))`
```{r child=system.file('templates', "README_NVIverse.Rmd", package = "NVIpackager")}
```
`r NVIpkg_inline` provide tools to make R-output pretty in accord with Norwegian Veterinary Institute's (NVI) graphical profile. For products that are not described in the graphical profile, the tools should help standardizing the output and aid in increasing readability and use.
The package is under development. Currently the package comprises functions that standardizes output to Excel and palettes with colour codes for the NVI colours. [Contributions](#contributing) to enhance the package is highly appreciated.
# Installation
```{r child=system.file('templates', "README_installation.Rmd", package = "NVIpackager")}
```
# Usage
```{r child=system.file('templates', "README_usage_attach.Rmd", package = "NVIpackager")}
```
For information on using the colour palettes and the NVI_theme in ggplot2, please have look at the vignette 'Create graphs for NVI'.
NVIpretty can also be used to style an Excel sheet as in the example below.
``` r
# Attach packages and set up with temporary directory
library(NVIpretty)
library(openxlsx)
td <- tempdir()
# Generate Excel-sheet
workbook <- createWorkbook()
# Add a sheet to the workbook
add_formatted_worksheet(iris,
workbook,
sheet = "iris",
wrapHeadlineText = TRUE,
collabels = TRUE,
colwidths = FALSE,
standards = NULL)
#Save the workbook
saveWorkbook(wb = workbook,
file = paste0(td, "/iris.xlsx"),
overwrite = TRUE)
```
```{r child=system.file('templates', "README_usage_help.Rmd", package = "NVIpackager")}
```
# Copyright and license
```{r child=system.file('templates', "README_copyright_and_license.Rmd", package = "NVIpackager")}
```
# Contributing
```{r child=system.file('templates', "README_contributing.Rmd", package = "NVIpackager")}
```
<!-- Code of conduct -->
-----
```{r child=system.file('templates', "README_code_of_conduct.Rmd", package = "NVIpackager")}
```