library(alm)
Remember to get your api key, pass it in in the key parameter. Notice that we are passing the base url for the Crossref API, whereas the default is for the PLOS url http://alm.plos.org/api/v3/articles
belief | y2015 | y2014 | |
---|---|---|---|
Improves the security posture of my organization | 0.75 | 0.71 | |
Improves the security posture of the nations critical infrastructure | 0.63 | 0.64 | |
Reduces the cost of detecting and preventing cyber attacks | 0.22 | 0.21 | |
Improves situational awareness | 0.60 | 0.54 | |
Fosters collaboration among peers and industry groups | 0.48 | 0.51 | |
Enhances the timeliness of threat data | 0.11 | 0.16 | |
Makes threat data more actionable | 0.21 | 0.24 |
diverge0 <- function(p, ramp) { | |
# p: a trellis object resulting from rasterVis::levelplot | |
# ramp: the name of an RColorBrewer palette (as character), a character | |
# vector of colour names to interpolate, or a colorRampPalette. | |
require(RColorBrewer) | |
require(rasterVis) | |
if(length(ramp)==1 && is.character(ramp) && ramp %in% | |
row.names(brewer.pal.info)) { | |
ramp <- suppressWarnings(colorRampPalette(brewer.pal(11, ramp))) | |
} else if(length(ramp) > 1 && is.character(ramp) && all(ramp %in% colors())) { |
# Function to rarefy point data in any number of dimensions. The goal here is to | |
# take a large data set and reduce it in size in such a way as to approximately maximize the | |
# difference between points. For instance, if you have 2000 points but suspect a lot of | |
# spatial autocorrelation between them, you can pass in your data frame, the names (or indices) | |
# of the lat/lon columns, and the number 200, and you get back 200 points from your original data | |
# set that are chosen to be as different from each other as possible given a randomly chosen | |
# starting point | |
# Input is: | |
# |
--- | |
title: "A few methods for making tables in rmarkdown" | |
output: html_document | |
--- | |
Updates: | |
Packages that have appeared since my original look into this, and seem great: | |
https://github.com/yihui/printr |
library('devtools') | |
library('utils') | |
library('httr') | |
update_github <- | |
function(ask = TRUE, ...){ | |
installed <- installed.packages() | |
oldVersion <- installed[,'Version'] | |
urls <- sapply(names(oldVersion), function(x){ | |
d <- packageDescription(x) |
Which documents belong to each topic? | |
Documents don't belong to a single topic, there is a distribution of topics | |
over each document. | |
But we can Find the topic with the highest proportion for each document. | |
That top-ranking topic might be called the 'topic' for the document, but note | |
that all docs have all topics to varying proportions | |
Assume that we start with `topic_docs` from the output of the mallet package |
#Title: An example of the correlation of x and y for various distributions of (x,y) pairs | |
#Tags: Mathematics; Statistics; Correlation | |
#Author: Denis Boigelot | |
#Packets needed : mvtnorm (rmvnorm), #RSVGTipsDevice (devSVGTips) | |
#How to use: output() | |
# | |
#This is an translated version in R of an Matematica 6 code by Imagecreator. | |
# from http://en.wikipedia.org/wiki/File:Correlation_examples2.svg | |
library(mvtnorm) |
Notes:
I've tried to break up in to separate pieces, but it's not always possible: e.g. knowledge of data structures and subsetting are tidy intertwined.
Level of Bloom's taxonomy listed in square brackets, e.g. http://bit.ly/15gqPEx. Few categories currently assess components higher in the taxonomy.
# Author: Joona Lehtomäki <[email protected]> | |
# Updated: 13.11.2011 | |
# Version: 0.0.1 | |
if (!require("rgdal")) { | |
install.packages("rgdal") | |
} | |
if (!require("raster")) { | |
install.packages("raster") |