2008

speed issue in R computing: apply() vs a loop

April 23, 2008 | Yu-Sung Su

In R, apply() is NOT faster than a loop!!I don't know where I pick up this perception about apply() being faster than a loop in R. For a long time, I always think that apply() runs a function (for example, mean()) on a data structure (row or column) i... [Read more...]

An R Wiki

April 21, 2008 | nsaunders

It’s been ages since I visited the R website, so I don’t know how long they’ve had a wiki. It’s built using DokuWiki, one of my personal favourites. This is a great leap forward for R documentation, which is somewhat notorious for being (a) difficult to ... [Read more...]

Heteroscedasticity

April 6, 2008 | vikasrawal

If a model is estimated using the following code: lm(y~x1+x2)-__p 1. bptest(p) does the Breuch Pagan test to formally check presence of heteroscedasticity. To use bptest, you will have to call lmtest library. 2. If the test is positive (low p value), you should see if ... [Read more...]

Results of the St. Pat’s 10 Miler and 5K

March 23, 2008 | Chris

Recently I ran the St. Pat’s 10 Miler in Atlantic City, Nj. It was my first official running event ever and I enjoyed it lot. Shortly after the race the official results have been posted on the Internet. The data did not only include the number and times of the ...
[Read more...]

Plotting contours

March 18, 2008 | Forester

Plenty of packages allow you to plot contours of a "z" value; however, I wanted to be able to plot a specific density contour of a sample from a bivariate distribution over a plot that was a function of the x and y parameters. The example only plots th... [Read more...]

Writing Rd files in Vim

March 3, 2008 | Michal

I have made a small “translation” of a portion of “Writing R Extensions” manual about the Rd files to a vimhelp format. You can find it on vim.org, under this link http://www.vim.org/scripts/script.php?script_id=2177. If that does not work just search for a ... [Read more...]

Drop unused factor levels

February 4, 2008 | Forester

When creating a subset of a dataframe, I often exclude rows based on the level of a factor. However, the "levels" of the factor remain intact. This is the intended behavior of R, but it can cause problems in some cases. I finally discovered how to clean up levels in ... [Read more...]

R package: codetools

February 4, 2008 | Yu-Sung Su

Since the release of R_2.6.0, R package developers were advised to use the ``codetools" package to check potential bugs. However, as I am not familiar with computer language, I found the warning messages a bit confusing. For example:__ checkUsage(glm.fit): no visible binding for global variable ‘n’I don't ... [Read more...]

New material on the GGobi book web page

January 30, 2008 | Di Cook

The GGobi book is now available from Springer and Amazon, after quite a delay. Getting the figures printed correctly was difficult. Solutions to the exercises in the back of each chapter are available for instructors by emailing Springer.The movies on ... [Read more...]

Shading overlapping area of curves in R

January 28, 2008 | Yu-Sung Su

I was trying to plot figure in R like the one below, which is basically the veto player model of Tsebelis. Based on my knowledge of R now, I encountered 2 major problems:I don't know if there is a function that can draw archs, or at least partial curves from ... [Read more...]
1 3 4 5 6

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)