Posts Tagged ‘ read.table() ’

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

May 11, 2012
By
An embarrassing admission; Copy pasting tables with text containing spaces from Excel to R

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 →

Read more »

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

March 8, 2012
By
How to create a data frame from text submitted in a textarea with FastRWeb

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

Read more »

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

February 25, 2011
By
Example 8.27: using regular expressions to read data with variable number of words in a field

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...

Read more »

R Tips in Stat 511

March 22, 2010
By
R Tips in Stat 511

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

Read more »

How to Import MS Excel Data into R

September 26, 2009
By
How to Import MS Excel Data into R

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:

Read more »