Publications by learnr

directlabels: Adding direct labels to ggplot2 and lattice plots

03.01.2010

Sometimes it is preferable to label data series instead of using a legend. This post demonstrates one way of using labels instead of legend in a ggplot2 plot. > library(ggplot2) > p <- ggplot(dfm, aes(month, value, group = City, colour = City)) + geom_line(size = 1) + opts(legend.position = "none") > p + geom_text(data = dfm[dfm$mont...

1611 sym R (530 sym/7 pcs) 8 img 7 tbl

New Features in ggplot2 version 0.8.5

06.01.2010

Just before Christmas ggplot2 version 0.8.5 was released, closely following the release of version 0.8.4 a week or so earlier. Whilst both versions included included numerous bugfixes (25 in 0.8.4 and 17 in 0.8.5), the latest version also incorporated some new features. As ggplot2 is all about graphical display, so I went through the list of new ...

2245 sym R (1071 sym/15 pcs) 26 img 15 tbl

ggplot2: Crayola Crayon Colours

21.01.2010

Statistical Algorithms blog attempted to recreate a graph depicting the growing colour selection of Crayola crayons in ggplot2 (original graph below via FlowingData). He also asked the following questions: Is there an easier way to do this? How can I make the axes more like the original? What about the white lines between boxes and the gradual ch...

1887 sym R (1461 sym/11 pcs) 16 img 11 tbl

ggplot2: Quick Heatmap Plotting

25.01.2010

A post on FlowingData blog demonstrated how to quickly make a heatmap below using R base graphics. This post shows how to achieve a very similar result using ggplot2. Data Import FlowingData used last season’s NBA basketball statistics provided by databasebasketball.com, and the csv-file with the data can be downloaded directly from its websit...

1876 sym R (823 sym/8 pcs) 12 img 8 tbl

ggplot2: Plotting Dates, Hours and Minutes

24.02.2010

Plotting timeseries with dates on x-axis and times on y-axis can be a bit tricky in ggplot2. However, with a little trick this problem can be easily overcome. Let’s assume that I wanted to plot when the sun rises in London in 2010. sunriset function in maptools package calculates the sunrise times using algorithms provided by the National Ocea...

1568 sym R (870 sym/7 pcs) 8 img 7 tbl

ggplot2: Changing the Default Order of Legend Labels and Stacking of Data

23.03.2010

“How to change the order of legend labels” is a question that gets asked relatively often on ggplot2 mailing list. A variation of this question is how to change the order of series in stacked bar/lineplots. While these two questions seem to be related, in fact they are separate as the legend is controlled by scales, whereas stacking is contro...

1590 sym R (625 sym/6 pcs) 12 img 6 tbl

ggplot2: Waterfall Charts

10.05.2010

Waterfall charts are often used for analytical purposes in the business setting to show the effect of sequentially introduced negative and/or positive values. Sometimes waterfall charts are also referred to as cascade charts. In the next few paragraphs I will show how to plot a waterfall chart using ggplot2. Data A very small fictional dataset d...

1730 sym R (2485 sym/9 pcs) 10 img 9 tbl

Consultants’ Chart in ggplot2

16.08.2010

Excel Charts Blog posted a video tutorial of how to create a circumplex or rose or dougnut chart in Excel. Apparently this type of chart is very popular in the consulting industry, hence the “Consultants’ Chart”. It is very easy to make this chart in Excel 2010, but it involves countless number of clicks and formulas to format both the sou...

1607 sym R (1441 sym/6 pcs) 12 img 6 tbl

Subsetting data from Data Frame in R with references to SQL commands – Part 1

07.06.2020

Hello there, welcome to my blog post. The reason behind this post is to practice R and R markdown and share my work with the audience. I would make references to SQL/relational database commands while working with R. If you are not familiar with SQL then please ignore SQL parts, SQL references are just for easy understanding. The primary focus of...

8375 sym R (7096 sym/15 pcs)

Test

22.07.2020

Online Training Software Related To leave a comment for the author, please follow the link and comment on their blog: R Language – LearnR. R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job. Want to share your cont...

460 sym