Re: [R] Cleaning up messy Excel data

2012-03-03 Thread John Kane
Seconded John Kane Kingston ON Canada > -Original Message- > From: rolf.tur...@xtra.co.nz > Sent: Sat, 03 Mar 2012 13:46:42 +1300 > To: 538...@gmail.com > Subject: Re: [R] Cleaning up messy Excel data > > On 03/03/12 12:41, Greg Snow wrote: > > >&g

Re: [R] Cleaning up messy Excel data

2012-03-03 Thread Greg Snow
Sometimes we adapt to our environment, sometimes we adapt our environment to us. I like fortune(108). I actually was suggesting that you add a tool to your toolbox, not limit it. In my experience (and I don't expect everyone else's to match) data manipulation that seems easier in Excel than R is

Re: [R] Cleaning up messy Excel data

2012-03-03 Thread John C Nash
> From: jim holtman > To: Greg Snow <538...@gmail.com> > Cc: r-help > Subject: Re: [R] Cleaning up messy Excel data > Message-ID: > > Content-Type: text/plain; charset=ISO-8859-1 > > Unfortunately they only know how to use Excel and Word. They are not > fo

Re: [R] Cleaning up messy Excel data

2012-03-02 Thread jim holtman
Unfortunately they only know how to use Excel and Word. They are not folks who use a computer every day. Many of them run factories or warehouses and asking them to use something like Access would not happen in my lifetime (I have retired twice already). I don't have any problems with them "mess

Re: [R] Cleaning up messy Excel data

2012-03-02 Thread Rolf Turner
On 03/03/12 12:41, Greg Snow wrote: It is possible to do the right thing in Excel, but Excel does not encourage (let alone force) you to do the right thing, but makes it easy to do the wrong thing. Fortune! cheers, Rolf Turner __ R-h

Re: [R] Cleaning up messy Excel data

2012-03-02 Thread Jim Lemon
Unfortunately, a lot of people who use MS Office don't have or know how to use MS Access. Where I work now (as in the past) I have to tie someone to their chair, give them a few pokes with the cattle prod and then show them that a CSV file will load straight into Excel before I can convince the

Re: [R] Cleaning up messy Excel data

2012-03-02 Thread Greg Snow
Try sending your clients a data set (data frame, table, etc) as an MS Access data table instead. They can still view the data as a table, but will have to go to much more effort to mess up the data, more likely they will do proper edits without messing anything up (mixing characters in with number

Re: [R] Cleaning up messy Excel data

2012-03-01 Thread jim holtman
But there are some important reasons to use Excel. In my work there are a lot of people that I have to send the equivalent of a data.frame to who want to look at the data and possibly slice/dice the data differently and then send back to me updates. These folks do not know how to use R, but do ha

Re: [R] Cleaning up messy Excel data

2012-02-29 Thread Rolf Turner
On 01/03/12 04:43, John Kane wrote: (mydata<- as.factor(c("1","2","3", ">2", "5", ">2"))) str(mydata) newdata<- as.character(mydata) newdata[newdata==">2"]<- 0 newdata<- as.numeric(newdata) str(newdata) We really need to keep Excel (and other spreadsheets) out of peoples hands. Amen, bro'!!!

Re: [R] Cleaning up messy Excel data

2012-02-29 Thread John Kane
d other spreadsheets) out of peoples hands. John Kane Kingston ON Canada > -Original Message- > From: noahsilver...@ucla.edu > Sent: Tue, 28 Feb 2012 13:27:13 -0800 > To: r-help@r-project.org > Subject: [R] Cleaning up messy Excel data > > Unfortunately, some d

Re: [R] Cleaning up messy Excel data

2012-02-28 Thread Stephen Sefick
Just replace that value with zero. If you provide some reproducible code I could probably give you a solution. ?dput good luck, Stephen On 02/28/2012 03:27 PM, Noah Silverman wrote: Unfortunately, some data I need to work with was delivered in a rather messy Excel file. I want to import int

Re: [R] Cleaning up messy Excel data

2012-02-28 Thread Noah Silverman
That's exactly what I need. Thank You!! -- Noah Silverman UCLA Department of Statistics 8117 Math Sciences Building Los Angeles, CA 90095 On Feb 28, 2012, at 1:42 PM, jim holtman wrote: > First of all when reading in the CSV file, use 'as.is = TRUE' to > prevent the changing to factors. > > N

Re: [R] Cleaning up messy Excel data

2012-02-28 Thread Robert Baer
-Original Message- From: Noah Silverman Sent: Tuesday, February 28, 2012 3:27 PM To: r-help Subject: [R] Cleaning up messy Excel data Unfortunately, some data I need to work with was delivered in a rather messy Excel file. I want to import into R and clean up some things so that I can

Re: [R] Cleaning up messy Excel data

2012-02-28 Thread jim holtman
First of all when reading in the CSV file, use 'as.is = TRUE' to prevent the changing to factors. Now that things are character in that column, you can use some pattern expressions (gsub, regex, ...) to search for and change your data. E.g., sub("<.*", "0", yourCol) should do it for you. On Tue

[R] Cleaning up messy Excel data

2012-02-28 Thread Noah Silverman
Unfortunately, some data I need to work with was delivered in a rather messy Excel file. I want to import into R and clean up some things so that I can do my analysis. Pulling in a CSV from Excel is the easy part. My current challenge is dealing with some text mixed in the values. i.e. 118