Blog Archives

Display element ids for debugging Shiny apps

April 19, 2016
By
Display element ids for debugging Shiny apps

My current Shiny project contains at least five tables and I constantly forget how they are called. So I whipped up a little bookmarklet that uses jQuery to show the id of each div and input. Some of those can be ignored as they are internal names set ...

Read more »

New R package: a dictionary with arbitrary keys and values

March 11, 2016
By

Coming from Python, the absence of a real dictionary in R has annoyed me for quite some time. Now, I actually needed to use vectors as keys in R:> library(dict)> d ->> d] > d] > d] > d] 42> d] "Hello!"Under the hood, separate C++ dictionaries (unordered_map) are created for the different types of keys....

Read more »

Avoiding unnecessary memory allocations in R

March 8, 2016
By

As a rule, everything I discover in R has already been discussed by Hadley Wickham. In this case, he writes:The reason why the C++ function is faster is subtle, and relates to memory management. The R version needs to create an intermediate vector the ...

Read more »

Creating composite figures with ggplot2 for reproducible research

March 10, 2015
By
Creating composite figures with ggplot2 for reproducible research

So far, I have been preparing composite figures by plotting the data using ggplot2, and then putting the panels together in OmniGraffle or Adobe Illustrator. Of course, every time the data is updated, I would need to go back to the vector editing progr...

Read more »

Introducing parallelRandomForest: faster, leaner, parallelized

September 23, 2013
By
ffffffffffffforst

Together with other members of Andreas Beyer's research group, I participated in the DREAM 8 toxicogenetics challenge. While the jury is still out on the results, I want to introduce my improvement of the R randomForest package, namely parall...

Read more »

2D plot with histograms for each dimension (2013 edition)

April 22, 2013
By
2D plot with histograms for each dimension (2013 edition)

In 2009, I wrote about a way to show density plots along both dimensions of a plot. When I ran the code again to adapt it to a new project, it didn't work because ggplot2 has become better in the meantime. Below is the updated code. Using the gridExtra...

Read more »

ggplot2: Determining the order in which lines are drawn

August 11, 2011
By
ggplot2: Determining the order in which lines are drawn

In a time series, I want to plot the values of an interesting cluster versus the background. However, if I'm not careful, ggplot will draw the items in an order determined by their name, so background items will obscure the interesting cluster: Corr...

Read more »

Comparing two-dimensional data sets in R; take II

March 10, 2011
By
Comparing two-dimensional data sets in R; take II

David commented on yesterday's post and suggested to put the continuous fitted distribution in the background and the discrete, empirical distribution in the foreground. This looks quite nice, although there's a slight optical illusion that makes the c...

Read more »

Comparing two-dimensional data sets in R; take II

March 10, 2011
By
Comparing two-dimensional data sets in R; take II

David commented on yesterday's post and suggested to put the continuous fitted distribution in the background and the discrete, empirical distribution in the foreground. This looks quite nice, although there's a slight optical illusion that makes the c...

Read more »

Comparing two-dimensional data sets in R

March 9, 2011
By
Comparing two-dimensional data sets in R

I wanted to fit a continuous function to a discrete 2D distribution in R. I managed to do this by using nls, and wanted to display the data. I discovered a nice way to compare the actual data and the fit using ggplot2, where the background is the real ...

Read more »

Sponsors

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)