An embarrassing admission; Copy pasting tables with text containing spaces from Excel to R

May 11, 2012
By

I can’t believe I didn’t learn how to do it earlier, but I never knew how to accurately copy tables from excel that had text with spaces in them, and paste into a data frame in R without generating confusion … Continue reading →

How to create a data frame from text submitted in a textarea with FastRWeb

March 8, 2012
By

In this article, I show you how to create a data.frame from a text submitted in a textarea field with FastRWeb. Requirements FastRWeb installed Knowledge of webforms ?read.table Experience in HTML5 Submit This example needs two scripts. The first one contains the webform. I wrote a FastRWeb script in order to work in /var/FastRWeb/web.R/. This

Example 8.27: using regular expressions to read data with variable number of words in a field

February 25, 2011
By

A more or less anonymous reader commented on our last post, where we were reading data from a file with a varying number of fields. The format of the file was:1 Las Vegas, NV --- 53.3 --- --- 12 Sacramento, CA --- 42.3 --- --- 2The complication in the...

R Tips in Stat 511

March 22, 2010
By
$\reverse C(X'X)^{-1}X'$

Here are some (trivial) R tips in the course Stat 511. I’ll update this post till the semester is over. Formatting R Code Reading code is pain, but the well-formatted code might alleviate the pain a little bit. The function tidy.source() in the animation package can help us format our R code automatically. By default

How to Import MS Excel Data into R

September 26, 2009
By

s Sir Francis Bacon said, “Histories make men wise; poets witty; the mathematics subtile; natural philosophy deep; moral grave; logic and rhetoric able to contend.” And Windows stupid. He should have added the last sentence if he were a Windows user in this age. 1. Avoid Using M\$ Excel A lot of R users often ask this question: