Re: [R] Data import R: some explanatory variables not showing up correctly in summary

2017-06-01 Thread William Dunlap via R-help
Re-importing the data with read.table's strip.white=TRUE argument may be an easier way to deal with the problem (if the problem is leading or trailing whitespace). Bill Dunlap TIBCO Software wdunlap tibco.com On Thu, Jun 1, 2017 at 9:17 AM, David Winsemius wrote: > > > On Jun 1, 2017, at 8:57 A

Re: [R] Data import R: some explanatory variables not showing up correctly in summary

2017-06-01 Thread Charles C. Berry
On Thu, 1 Jun 2017, Rui Barradas wrote: Hello, In order for us to help we need to know how you've imported your data. What was the file type? What instructions have you used to import it? Did you use base R or a package? Give us a minimal but complete code example that can reproduce your sit

Re: [R] Data import R: some explanatory variables not showing up correctly in summary

2017-06-01 Thread David Winsemius
> On Jun 1, 2017, at 8:57 AM, William Dunlap via R-help > wrote: > > Check for leading or trailing spaces in the strings in your data. > dput(dataset) would show them. This function would strip any leading or trailing spaces from a column: trim <- function (s) { s <- as.charac

Re: [R] Data import R: some explanatory variables not showing up correctly in summary

2017-06-01 Thread David L Carlson
: Thursday, June 1, 2017 11:07 AM To: Ulrik Stervbo ; Rui Barradas ; Tara Adcock ; r-help@r-project.org Cc: William Dunlap via R-help Subject: Re: [R] Data import R: some explanatory variables not showing up correctly in summary It looks like your printouts are based on the R summary() function

Re: [R] Data import R: some explanatory variables not showing up correctly in summary

2017-06-01 Thread David L Carlson
[mailto:r-help-boun...@r-project.org] On Behalf Of Ulrik Stervbo Sent: Thursday, June 1, 2017 10:50 AM To: Rui Barradas ; Tara Adcock ; r-help@r-project.org Subject: Re: [R] Data import R: some explanatory variables not showing up correctly in summary Hi Tara, It seems that you categorise and

Re: [R] Data import R: some explanatory variables not showing up correctly in summary

2017-06-01 Thread William Dunlap via R-help
Check for leading or trailing spaces in the strings in your data. dput(dataset) would show them. Bill Dunlap TIBCO Software wdunlap tibco.com On Thu, Jun 1, 2017 at 8:49 AM, Ulrik Stervbo wrote: > Hi Tara, > > It seems that you categorise and count for each category. Could it be that > the met

Re: [R] Data import R: some explanatory variables not showing up correctly in summary

2017-06-01 Thread Ulrik Stervbo
Hi Tara, It seems that you categorise and count for each category. Could it be that the method you use puts everything that doesn't match the predefined categories in Other? I'm only guessing because without a minimal reproducible example it's difficult to do anything else. Best wishes Ulrik R

Re: [R] Data import R: some explanatory variables not showing up correctly in summary

2017-06-01 Thread Rui Barradas
Hello, In order for us to help we need to know how you've imported your data. What was the file type? What instructions have you used to import it? Did you use base R or a package? Give us a minimal but complete code example that can reproduce your situation. Hope this helps, Rui Barradas

Re: [R] Data Import to R

2014-11-14 Thread Jeff Newmiller
If your data uses a special marker such as "--" or "n/a" to indicate not available then once you have identified those markers (using any method, though Don's procedure below is what I use) then you can specify them with the na.strings parameter to read.csv. (See the help for read.table for many

Re: [R] Data Import to R

2014-11-14 Thread MacQueen, Don
Petr is almost certainly correct. A further suggestion: Continue to import using stringsAsFactors = FALSE On one of the columns that should be numeric, use as.numeric(), find the NA's in the result of that, and then look at those rows of the data. There will be something there that is non-numeric

Re: [R] Data Import to R

2014-11-14 Thread theo
i think you can set: options(stringsAsFactor=FALSE) which will apply globally or use read.csv(..., stringsAsFactor=FALSE) when imporing. have a look at the documentation ?read.csv good luck. On 11/14/2014 09:44 AM, David Winsemius wrote: > > On Nov 13, 2014, at 4:28 PM, Ramesh Gautam wrote: > >

Re: [R] Data Import to R

2014-11-13 Thread PIKAL Petr
Hi Your original numeric data probably contain something which prevents read.* to accept them as numeric (decimal point, white space) what is result of str(imported.data) Petr Pikal > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On B

Re: [R] Data Import to R

2014-11-13 Thread David Winsemius
On Nov 13, 2014, at 4:28 PM, Ramesh Gautam wrote: > While importing .csv files into R, all data are converted to factor-by > default. But, how can I preserve the original format of the data like > numeric to numeric, integer to integer, character to character etc while > importing from csv to R e

Re: [R] data import: strange experience

2013-08-22 Thread jwd
On Wed, 21 Aug 2013 10:35:53 -0400 SH wrote: It looks like your problem has already been answered, however, as a rule of thumb anytime you see a peculiarity like this you should look for minor variations between what you expected to export and what Excel really exported as delimited text. Occasi

Re: [R] data import: strange experience

2013-08-21 Thread David Carlson
ot;" David From: SH [mailto:empti...@gmail.com] Sent: Wednesday, August 21, 2013 10:14 AM To: dcarl...@tamu.edu; peter dalgaard Cc: r-help Subject: Re: [R] data import: strange experience Thanks Peter.  It works with read.delim.   David: Thanks for your comments.  To answer your questions.  I don

Re: [R] data import: strange experience

2013-08-21 Thread SH
Thanks Peter. It works with read.delim. David: Thanks for your comments. To answer your questions. I don't have 'NA' and all balanced. The number of mssing levels were 4 and it happened only to those four levels. Yes, there is commas embedded and some characters (e.g., '-', space, some wired

Re: [R] data import: strange experience

2013-08-21 Thread SH
Hi Sarah, Thanks for a prompt feedback. I knew it will be very vague without example. However, I only used two commands to import data and had no 'apparent' errors. The original data have about 19000 obs and I was able to reduce about 3200. I wonder if I can attach the data file (size: 109K) w

Re: [R] data import: strange experience

2013-08-21 Thread David Carlson
This is not really enough information to diagnose the problem. What are the missing factor levels? Were the missing levels combined with another level or do you have missing values (NA) for those observations? Do the extra factor levels include embedded commas? There are differences between read.ta

Re: [R] data import: strange experience

2013-08-21 Thread peter dalgaard
On Aug 21, 2013, at 16:46 , Sarah Goslee wrote: > Hi, > > We don't know anything about your data or your file, so it's utterly > impossible to offer useful suggestions. > > The very best thing you can do is condense your problem into a > reproducible example, with fake data if necessary. Otherw

Re: [R] data import: strange experience

2013-08-21 Thread Sarah Goslee
Hi, We don't know anything about your data or your file, so it's utterly impossible to offer useful suggestions. The very best thing you can do is condense your problem into a reproducible example, with fake data if necessary. Otherwise you're limited by the ability of the list to guess what you'

Re: [R] Data import

2011-09-27 Thread B77S
I see what you mean. Sorry and thanks for pointing that out to me Ben. bbolker wrote: > > B77S auburn.edu> writes: > >> >> I have never used that function, but I know that with read.csv() you can >> do >> the following to select only the columns you want: >> >> chosen_vars <- read.csv("Workb

Re: [R] Data import

2011-09-26 Thread sassorauk
Thanks for your responses. Ben is right that I am looking for a way to import a subset of data from SPSS into R. If I could do this it would mean not having to save large datasets which takes a long time and would mean duplicating a lot of the same information each time. I find SPSS slow to produc

Re: [R] Data import

2011-09-26 Thread Ben Bolker
B77S auburn.edu> writes: > > I have never used that function, but I know that with read.csv() you can do > the following to select only the columns you want: > > chosen_vars <- read.csv("Workbook1.csv", header=T)[c("variable1", > "variable3")] > This is not actually selectively importing:

Re: [R] Data import

2011-09-26 Thread Jan van der Laan
You can with the routines in the memisc library. You can open a file using spss.system.file and then import a subset using subset. Look in the help pages of spss.system.file for examples. HTH Jan On 09/25/2011 11:56 PM, sassorauk wrote: Is it possible to import only certain variables from a

Re: [R] Data import

2011-09-25 Thread B77S
I have never used that function, but I know that with read.csv() you can do the following to select only the columns you want: chosen_vars <- read.csv("Workbook1.csv", header=T)[c("variable1", "variable3")] HTH sassorauk wrote: > > Is it possible to import only certain variables from a SPSS fi

Re: [R] Data import

2011-09-25 Thread Daniel Malter
Why would that be preferable to dropping the variables after importing the whole dataset? Daniel sassorauk wrote: > > Is it possible to import only certain variables from a SPSS file. > > I know that read.spss in the foreign library will bring the data into R > but can I choose to important on

Re: [R] Data import export zipped files from URLs

2010-01-24 Thread Henrique Dallazuanna
The same error for me: "Not Found The requested object does not exist on this server. The link you followed is either outdated, inaccurate, or the server has been instructed not to let you have it. Please inform the site administrator of the referring page." On Sun, Jan 24, 2010 at 3:14 PM, Pete

Re: [R] Data import export zipped files from URLs

2010-01-24 Thread Peter Ehlers
That's not the case for me: Not Found The requested object does not exist on this server. The link you followed is either outdated, inaccurate, or the server has been instructed not to let you have it. Firefox 3.6 -Peter Ehlers Velappan Periasamy wrote: http://nseindia.com/content/equitie

Re: [R] Data import export zipped files from URLs

2010-01-23 Thread Velappan Periasamy
http://nseindia.com/content/equities/scripvol/datafiles/01-01-2010-TO-23-01-2010RCOMXN.csv the url is correct. it is not zipped file. copy the url in the browser window you will get the this .. Symbol,Series,Date, Prev Close,Open Price,High Price,Low Price,Last Price,Close Price,Average Pr

Re: [R] Data import export zipped files from URLs

2010-01-23 Thread Henrique Dallazuanna
Your url is wrong. is missing ".zip" in the end. See the code again. On Sat, Jan 23, 2010 at 6:37 AM, Velappan Periasamy wrote: >  cannot open: HTTP status was '404 Not Found' while running the > following commands > > f <- tempfile() > download.file("http://nseindia.com/content/equities/scripvo

Re: [R] Data import export zipped files from URLs

2010-01-23 Thread Velappan Periasamy
The same link works and dowloads data while copying and pasteing the link in firebox address box. the file is there and the server is active. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting gu

Re: [R] Data import export zipped files from URLs

2010-01-23 Thread Velappan Periasamy
cannot open: HTTP status was '404 Not Found' while running the following commands f <- tempfile() download.file("http://nseindia.com/content/equities/scripvol/datafiles/01-01-2010-TO-23-01-2010RCOMXN.csv";, f) myData <- read.csv(f) On 1/19/10, Henrique Dallazuanna wrote: > Try this: > > f <- t

Re: [R] Data import export zipped files from URLs

2010-01-19 Thread Henrique Dallazuanna
Try this: f <- tempfile() download.file("http://nseindia.com/content/historical/EQUITIES/2010/JAN/cm15JAN2010bhav.csv.zip";, f) myData <- read.csv(unzip(f)) On Tue, Jan 19, 2010 at 2:56 PM, Velappan Periasamy wrote: > How to unzip this file?. > >> mydata <- >> unzip("http://nseindia.com/content

Re: [R] Data import export zipped files from URLs

2010-01-19 Thread Velappan Periasamy
How to unzip this file?. > mydata <- > unzip("http://nseindia.com/content/historical/EQUITIES/2010/JAN/cm15JAN2010bhav.csv.zip";) Warning message: In unzip("http://nseindia.com/content/historical/EQUITIES/2010/JAN/cm15JAN2010bhav.csv.zip";) : error 1 in extracting from zip file >

Re: [R] Data import export zipped files from URLs

2010-01-19 Thread Gabor Grothendieck
If you need an example of this look at the yacasInstall function in this file: http://ryacas.googlecode.com/svn/trunk/R/yacasInstall.R from the Ryacas package. It downloads, unzips and installs yacas and associated files for Windows users. On Tue, Jan 19, 2010 at 3:10 AM, Dieter Menne wrote:

Re: [R] Data import export zipped files from URLs

2010-01-19 Thread Duncan Temple Lang
Dieter Menne wrote: > > Velappan Periasamy wrote: >> I am not able to import zipped files from the following link. >> How to get thw same in to R?. >> mydata <- >> read.csv("http://nseindia.com/content/historical/EQUITIES/2010/JAN/cm15JAN2010bhav.csv.zip";) >> > > As Brian Ripley noted in > >

Re: [R] Data import export zipped files from URLs

2010-01-19 Thread Dieter Menne
Velappan Periasamy wrote: > > I am not able to import zipped files from the following link. > How to get thw same in to R?. > mydata <- > read.csv("http://nseindia.com/content/historical/EQUITIES/2010/JAN/cm15JAN2010bhav.csv.zip";) > As Brian Ripley noted in http://markmail.org/message/7dsau

Re: [R] Data import from .csv-file with numeric header

2009-09-25 Thread Duncan Murdoch
Tobias Ruff wrote: Hello everybody out there using R, How can I import data with a numeric header from a .csv-file? My file example.csv has the following content (a duplicate measurement of potentials for three different currents): 1; 2; 6 1.0; 2.1; 5.9 1.1; 2.0; 6.0 I try to import the data b

Re: [R] Data import from .csv-file with numeric header

2009-09-25 Thread Henrique Dallazuanna
Try this: measurement <- read.table("example.csv", sep = ";", header = TRUE, check.names = FALSE) plot(mean(measurement), names(measurement), xaxt = 'n') axis(1, names(measurement)) On Fri, Sep 25, 2009 at 3:53 AM, Tobias Ruff wrote: > Hello everybody out

Re: [R] data import

2008-09-11 Thread jim holtman
You can use a "connection" and read a portion of the data in at a time and process it. Do you need all the data at once? If so, I would agree that you either need more memory (and possibly a 64-bit version of the system), or you come up with a different approach to your processing. You have not i

Re: [R] data import

2008-09-11 Thread Richard . Cotton
> I have a data set containing 2,122,164 records and 38198952 fields. > I can not import this data due to "momory problem". > Is there a way to solve this problem? 1. Filter the data before you import it. Do you really need all 38 million fields? Can you ignore some of the 2 million records?

Re: [R] Data import error: duplicate "row.names"

2007-12-07 Thread Gabor Grothendieck
Read your file in without row names and check for duplicates: DF <- read.table(myfile, skip = 1, header = FALSE) myfile[duplicated(DF[[1]]), ] # list rows with duplicated column 1 On Dec 7, 2007 11:22 AM, Fan Yang <[EMAIL PROTECTED]> wrote: > Hi, > > I am trying to import a tab delimited file

Re: [R] Data import error: duplicate "row.names"

2007-12-07 Thread tintin_et_milou
I had the same problem one time. It was because I did a copy paste under excel that is to say i put some data from an other file at the following of the file, and R thought it was duplicate row.names. So i did two exports on R and after i did a rbind... I don't know if you did a copy paste like i