Skip to content

Molina-Valero/workshop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Creation of R Packages as a Reserch Tool

R package development

For attending this workshop you should follow the following guidelines:

In this link you will fine some of the workshop materials.

GitHub

Create a GitHub account and install the GitHub Desktop

R

You should have both R and RStudio already installed in your PC.

Rtools43 for Windows

Please, also install Rtools43 in C:/.

R code

#### Packages installation ####

install.packages("devtools")
install.packages("roxygen2")
install.packages("usethis")

#### New package ####

usethis::create_package("C:/workshop")


#### Create R files ####

usethis::use_r("linReg")


# Run code and edit...


#### NAMESPACE ####

# Rebuild docs and NAMESPACE

devtools::document()


#### Data ####

data <- data.frame(y = c(1:100) + rnorm(100), x = c(1:100) + rnorm(100))

usethis::use_data(data)


#### DESCRIPTION ####

usethis::use_gpl3_license()

usethis::use_package("plotly")


#### Load code ####

devtools::load_all("C:/workshop")


#### Check complete package ####

devtools::check()


#### BUILD ####

devtools::build_manual(path = "C:/test")

devtools::build(path = "C:/test")


#### INSTALLATION ####

installed.packages("C:/test/...")


# GitHub ----

# Download the R package from GitHub

remotes::install_github("...", dependencies = TRUE)

About

R package development

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published