September 2018

Binary, beta, beta-binomial

September 10, 2018 | Keith Goldfeld

I’ve been working on updates for the simstudy package. In the past few weeks, a couple of folks independently reached out to me about generating correlated binary data. One user was not impressed by the copula algorithm that is already implemented. I’ve added an option to use an ...
[Read more...]

riddles on a line [#2]

September 10, 2018 | xi'an

A second Riddle(r), with a puzzle related with the integer set Ð={,12,3,…,N}, in that it summarises as Given a random walk on Ð, starting at the middle N/2, with both end states being absorbing states, and a uniform random move left or right of the current value to the (integer) ...
[Read more...]

Pivoting on Text in R (vs. Excel)

September 10, 2018 | George Mount

This post follows a previous tutorial on pivoting on text in Excel. In this post I will reproduce the exercise in R. This way you begin to see the similarities and differences of the program and begin to diversify your data skill base.   Related: 5 Things Excel Users Should Know About ... [Read more...]

A Quick Appreciation of the R transform Function

September 10, 2018 | John Mount

R users who also use the dplyr package will be able to quickly understand the following code that adds an estimated area column to a data.frame. suppressPackageStartupMessages(library("dplyr")) iris %__% mutate( ., Petal.Area = (pi/4)*Petal.Width*Petal.Length) %__% head(.) ## Sepal.Length Sepal.Width Petal.Length Petal.Width Species Petal.... [Read more...]

Naïve Numerical Sums in R

September 10, 2018 | ntguardian

Introduction The Kolmogorov distribution (which I call ) is as follows: There is no known simpler form and we have to work with this sum as it is. This is an infinite sum. How can we compute the value of this infinite sum numerically? Naïvely we can do the following: ...
[Read more...]

Exploring San Francisco Bay Area’s Bike Share System

September 9, 2018 | Tony Lin

Congested streets and slow-crawling traffic are a fact of life in many metropolitan areas, such as New York City, Los Angeles, and Chicago. Bike sharing is an innovative solution for such problems, and it works by dispersing a large fleet of publicly-available bikes throughout crowded cities for personal transport. Implemented ...
[Read more...]

Use `purrr` to feed four cats

September 9, 2018 | Roel M. Hogervorst

Use purrr to feed four cats In this example we will show you how to go from a ‘for loop’ to purrr. Use this as a cheatsheet when you want to replace your for loops. Imagine having 4 cats. (like this one:) Four real cats who need food, care and love ...
[Read more...]

survHE update

September 9, 2018 | R on Gianluca Baio

Because I have been preparing an extended presentation on (Bayesian) survival analysis in health economic evaluation, I took the opportunity to make some tweaks to survHE — nothing major, but I was aware of couple of imprecisions in the code or things I wanted to make a bit better, so while ... [Read more...]

sabre: or how to compare two maps?

September 9, 2018 | Rstats on Jakub Nowosad's website

Creating or determination of regions is a useful way to describe the world. Regionalization does not only allow for a quicker understanding of spatial patterns but also can influence how regions are managed. Regions are created in various disciplines. We can delineate regions based on a single property (e.g. ...
[Read more...]

survHE update

September 9, 2018 | R on Gianluca Baio

Because I have been preparing an extended presentation on (Bayesian) survival analysis in health economic evaluation, I took the opportunity to make some tweaks to survHE — nothing major, but I was aware of couple of imprecisions in the code or things I wanted to make a bit better, so while ... [Read more...]

Fitting exponential decays in R, the easy way

September 9, 2018 | R on Programming notes

Updated in May 2020 to show a full example with qplot. Exponential decays can describe many physical phenomena: capacitor discharge, temperature of a billet during cooling, kinetics of first order chemical reactions, radioactive decay, and so on. They are very useful functions, but can be tricky to fit in R: you’...
[Read more...]

Fitting exponential decays in R, the easy way

September 9, 2018 | R on Programming notes

Exponential decays can describe many physical phenomena: capacitor discharge, temperature of a billet during cooling, kinetics of first order chemical reactions, radioactive decay, and so on. They are very useful functions, but can be tricky to fit in R: you’ll quickly run into a “singular gradient” error. Thankfully, self-starting ... [Read more...]

Playing Map() and Reduce() in R – Subsetting

September 8, 2018 | statcompute

In the previous post (https://statcompute.wordpress.com/2018/09/03/playing-map-and-reduce-in-r-by-group-calculation), I’ve shown how to employ the MapReduce when calculating by-group statistics. Actually, the same Divide-n-Conquer strategy can be applicable to other use cases, one of which is the subsetting operation. In the example below, let’s still use the same ...
[Read more...]
1 9 10 11 12 13 15

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)