Skip to content

Commit

Permalink
first commit - add united template
Browse files Browse the repository at this point in the history
  • Loading branch information
bblodfon committed Feb 17, 2020
0 parents commit ff4fdb5
Show file tree
Hide file tree
Showing 13 changed files with 188 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
^.*\.Rproj$
^\.Rproj\.user$
^LICENSE\.md$
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.Rproj.user
.Rhistory
.RData
.Ruserdata
11 changes: 11 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Package: rtemps
Type: Package
Title: My personal R templates
Version: 0.1.0
Authors@R: person("John", "Zobolas", role = c("aut", "cph", "cre"),
email = "[email protected]", comment = c(ORCID = "0000-0002-3609-8674"))
Description: A collection of R templates. My personal favourites!
License: MIT + file LICENSE
URL: https://github.com/bblodfon/r-temps
Encoding: UTF-8
LazyData: true
2 changes: 2 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
YEAR: 2020
COPYRIGHT HOLDER: John
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# MIT License

Copyright (c) 2020 John

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
exportPattern("^[[:alpha:]]+")
3 changes: 3 additions & 0 deletions R/hello.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
hello = function() {
print("Hello, world!")
}
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# r-templates

My personal favourite R templates :)

## Install

Run:
```r
devtools::install_github("bblodfon/rtemps")
```

Once the templates are installed, they will be available within the R Markdown templates in RStudio!
69 changes: 69 additions & 0 deletions inst/rmarkdown/templates/united_html/skeleton/skeleton.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
---
title: "Title"
author: "[John Zobolas](https://github.com/bblodfon)"
date: "Last updated: `r format(Sys.time(), '%d %B, %Y')`"
output:
html_document:
css: style.css
theme: united
toc: true
toc_float:
collapsed: false
smooth_scroll: true
toc_depth: 4
number_sections: false
code_folding: hide
code_download: true
---

## Intro {-}

Nulla auctor egestas [tincidunt](#Sub-analysis).

## Conclusion {-}

<div class="green-box">
- *Cras tincidunt* felis venenatis pretium iaculis[<sup>1</sup>](#footnote1).
- Curabitur in **tortor at tellus** fermentum elementum vel quis sem.
</div>
<br>
<div class="orange-box">
Be careful, be gentle, be brave!
</div>

## Input {-}

Loading libraries:
```{r Load libraries, message = FALSE}
library(xfun)
library(DT)
```

<div id="table1">A nice table example:</div>
```{r}
DT::datatable(mtcars, options = list(pageLength = 3))
```

## Analysis {-}

`Vestibulum` imperdiet[<sup>2</sup>](#footnote2), ex vel sodales facilisis, nibh tellus imperdiet massa, sit amet scelerisque orci velit vel tellus. Ut consequat justo tincidunt porttitor varius. Suspendisse erat ipsum, feugiat vitae rhoncus non, molestie ac purus. Morbi aliquet, elit eget blandit suscipit, est lacus facilisis turpis, nec fermentum nunc felis et lorem.

### Sub-analysis {-}

Suspendisse potenti. Cras pulvinar ligula ac nisi porttitor, volutpat congue orci tincidunt. Pellentesque non mi congue, porta enim eget, venenatis sem. Integer suscipit vulputate tellus, eget commodo dolor gravida vel. Suspendisse gravida gravida ligula, in interdum sapien molestie ut.

#### S2-analysis {-}

<div class="blue-box">
In ut vehicula risus.
</div>

## R session info {-}

```{r session info, comment=""}
xfun::session_info()
```

----
1. <div id="footnote1">Nullam quis sem nunc</div>
2. <div id="footnote2">In eget eros sit amet leo feugiat consequat</div>
26 changes: 26 additions & 0 deletions inst/rmarkdown/templates/united_html/skeleton/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
body {
font-size: 1.6rem;
text-align: justify;
}

h1,h2,h3,h4,h5 {
text-align: left;
}

.blue-box {
background-color: #e6f0ff;
border-radius: 5px;
padding: 20px;
}

.green-box {
background-color: #d9ffe9;
border-radius: 5px;
padding: 20px;
}

.orange-box {
background-color: #ffeedf;
border-radius: 5px;
padding: 20px;
}
4 changes: 4 additions & 0 deletions inst/rmarkdown/templates/united_html/template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
name: United HTML Document
description: >
A single-document template using the united bootstrap theme
create_dir: FALSE
12 changes: 12 additions & 0 deletions man/hello.Rd
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
\name{hello}
\alias{hello}
\title{Hello, World!}
\usage{
hello()
}
\description{
Prints 'Hello, world!'.
}
\examples{
hello()
}
20 changes: 20 additions & 0 deletions rtemps.Rproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Version: 1.0

RestoreWorkspace: Default
SaveWorkspace: Default
AlwaysSaveHistory: Default

EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 2
Encoding: UTF-8

RnwWeave: Sweave
LaTeX: pdfLaTeX

AutoAppendNewline: Yes
StripTrailingWhitespace: Yes

BuildType: Package
PackageUseDevtools: Yes
PackageInstallArgs: --no-multiarch --with-keep.source

0 comments on commit ff4fdb5

Please sign in to comment.