We have the Iris dataset saved into a data package. There are two resources: the data and the code list for the ‘Species’ variable:
> library(datapackage)
> dp <- opendatapackage("iris")
> dp
[iris]
Location: <./>
We have the Iris dataset saved into a data package. There are two resources: the data and the code list for the ‘Species’ variable:
> library(datapackage)
> dp <- opendatapackage("iris")
> dp
[iris]
Location: <./>
// This example adds handling stylus input to the Custom Drawing example | |
// from the GTK4 Getting Started. | |
// See: https://docs.gtk.org/gtk4/getting_started.html#custom-drawing | |
#include <gtk/gtk.h> | |
/* Surface to store current scribbles */ |
#include <cstring> | |
#include <cstdlib> | |
#include <R.h> | |
#include <Rdefines.h> | |
double jaro(const char* a, const char* b, double range = 0.5, double match_weight = 1.0, | |
double trans_weight = 1.0) { | |
unsigned int la = strlen(a); | |
unsigned int lb = strlen(b); | |
// create a buffers; these store for each character in a and b which have |
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.box = "ubuntu-14.04" | |
config.vm.box_url = "http://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box" |
library(lpSolve) | |
pairs_select <- function(x, y, w, n = 1, m = 1) { | |
d <- data.frame(x=as.numeric(as.factor(x)), y=as.numeric(as.factor(y)), w=w) | |
nx <- length(unique(d$x)) | |
ny <- length(unique(d$y)) | |
C <- cbind(c(d$x, d$y + nx), seq_len(nrow(d))) | |
C <- cbind(C, 1) | |
res <- lp("max", d$w, dense.const = C, const.dir = rep("<=", nx+ny), | |
const.rhs = c(rep(n, nx), rep(m, ny)), all.bin=TRUE, use.rw=TRUE) |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<script src="http://d3js.org/d3.v3.min.js"></script> | |
</head> | |
<body> | |
<div id="vis"> | |
</div> |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<script src="http://d3js.org/d3.v3.min.js"></script> | |
<style> | |
.orbit { | |
stroke : #000000; |