Blog Archives

Announcing CGPfunctions 0.3 – April 20, 2018

April 19, 2018
By
Announcing CGPfunctions 0.3 – April 20, 2018

As I continue to learn and grow in using R I have been trying to develop the habit of being more formal in documenting and maintaining the various functions and pieces of code I write. It’s not that I think they are major inventions but they are useful and I like having them stored in one place that I...

Read more »

Writing better R functions part four – April 17, 2018

April 16, 2018
By
Writing better R functions part four – April 17, 2018

In my last four posts I have been working at automating a process, that I am likely to repeat many times, by turning it into a proper R function. In my last post I overcame some real performance problems, combined two sub-functions into one and generally had a workable piece of code. In the final post in this series...

Read more »

Writing better R functions part three – April 13, 2018

April 12, 2018
By
Writing better R functions part three – April 13, 2018

In my last post I worked on two functions that took pairs of variables from a dataset and produced some nice useful ggplot plots from them. We started with the simplest case, plotting counts of how two variables cross-tabulate. Then we worked our way up to being able to automate the process of plotting lots of pairings of variables...

Read more »

Writing better R functions part two – April 10, 2018

April 9, 2018
By
Writing better R functions part two – April 10, 2018

In my last post I started to build two functions that took pairs of variables from a dataset and produced some nice useful ggplot plots from them. We started with the simplest case, plotting counts of how two variables cross-tabulate. Then we worked our way up to being able to automate the process of plotting lots of pairings of...

Read more »

Writing better R functions part one – April 6, 2018

April 5, 2018
By
Writing better R functions part one – April 6, 2018

One of the nicest things about working with R is that with very little effort you can customize and automate activities to produce the output you want – just the way you want it. You can contrast that with more monolithic packages that may allow you to do a bit of scripting, but for the most part, the price...

Read more »

Fun with M&M’s – April 3, 2018

April 2, 2018
By
Fun with M&M’s – April 3, 2018

In this post we’re going to explore the Chi Squared Goodness of Fit test using M&M’s as our subject material. From there we’ll take a look at simultaneous confidence intervals a.k.a. multiple comparisons. On the R side of things we’ll make use of some old friends like ggplot2 and dplyr but we’ll also make use of two packages that...

Read more »

Writing functions for dplyr and ggplot2 – April 2, 2018

April 1, 2018
By
Writing functions for dplyr and ggplot2 – April 2, 2018

In my last two posts I have been writing about the task of using R to “drive” MS Excel. The first post focused on just the basic mechanics of getting my colleague what she needed. The second post picked up with some ugly inefficient code and made it better using lapply and a for loop, just good old fashioned...

Read more »

Using functions to be more efficient – March 28, 2018

March 27, 2018
By
Using functions to be more efficient – March 28, 2018

In yesterday’s post I focused on the task of using R to “drive” MS Excel. I deliberately ended the post with a fully functioning (pun intended) but very ugly set of code. Why “ugly”? Well, because the last set of code wound up repeating 4 lines of code 12 times!

Read more »

Using R to ‘drive’ MS Excel – 3/27/2018

March 27, 2018
By
Using R to ‘drive’ MS Excel – 3/27/2018

I have until recently made it a habit to draw a clear distinction about using R for data analysis and Microsoft Excel for other office productivity tasks. I know there are people who use Excel to process data and even (gasp) to teach statistics with it. But I’m a bit snobbish that way and to date all my efforts...

Read more »

Introducing the CGPfunctions package – March 22, 2018

March 21, 2018
By
Introducing the CGPfunctions package – March 22, 2018

Overview This package includes functions that I find useful for teaching statistics as well as actually practicing the art. They typically are not “new” methods but rather wrappers around either base R or other packages and concepts I’m trying...

Read more »

Search R-bloggers


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)