This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#' Run a summary of functions and the associated description | |
#' for a loaded package | |
#' | |
#' @param package_name String providing the name of the loaded package, e.g. surveytoolbox | |
#' | |
#' @examples | |
#' \dontrun{ | |
#' pkg_summary("surveytoolbox") | |
#' pkg_summary("wpa") | |
#' pkg_summary("rwa") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## This is a minimal example to show how you can create a | |
## function that generates HTML reports using RMarkdown. | |
## | |
## This uses a list-pmap workflow so you can input lists | |
## as arguments and dynamically produce a RMarkdown that | |
## is only limited by the length of your lists. | |
## | |
## The example below outputs a table and two plots from | |
## `iris`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
library(networkD3) | |
## Nodes data frame describing all the nodes in the network | |
## The first entry in nodes dataframe is node 0, the next entry is node 1 and so on. | |
## The nodes dataframe must be sorted according to this sequence. | |
## This is the only way to tie the nodes dataframe to the links dataframe. | |
TestNodes <- data.frame(name = c("Alpha", | |
"Beta", | |
"Cat", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
paste(rep("l", exp(10)), collapse = "o") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lsf.str("package:wpa") %>% | |
as.list() %>% | |
unlist() %>% | |
as_tibble() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/modernizr/2.8.3/modernizr.min.js" type="text/javascript"></script> | |
</head> | |
<style> | |
body { | |
background: #000; | |
font-family: arial, san-serif; | |
color: #fff; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
iris %>% | |
rowwise() %>% | |
mutate(any = any(c(Sepal.Length, Sepal.Width) > 5)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
library(FactoMineR) | |
iris %>% | |
select(-Species) %>% | |
PCA(graph = FALSE) -> res | |
# FactoMineR does not return the loadings but the coordinates of the variables | |
# You can divide the results of PCA by the square root of the eigenvalue of each dimension to recover the loadings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
time 16:00:00 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
library(rCharts) # https://ramnathv.github.io/rCharts/ | |
HairEyeColor %>% | |
as_tibble() %>% | |
filter(Sex == "Male") %>% | |
nPlot(n ~ Hair, | |
group = 'Eye', | |
data = ., | |
type = 'multiBarChart') |