Re: [R] read.csv() error

2021-09-02 Thread Rich Shepard
On Thu, 2 Sep 2021, Enrico Schumann wrote: There is no column 'ht'. Enrico, New eyeballs caught my change in variable name that I kept missing. Thanks very much, Rich __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://st

Re: [R] read.csv() error

2021-09-02 Thread Enrico Schumann
On Thu, 02 Sep 2021, Rich Shepard writes: > The first three commands in the script are: > stage <- read.csv('../data/water/gauge-ht.dat', header > = TRUE, sep = ',', stringsAsFactors = FALSE) > stage$sampdate <- as.Date(stage$sampdate) > stage$ht <- as.numeric(stage$ht, length = 6) > > Running the

Re: [R] read.csv() error

2021-09-02 Thread Enrico Schumann
On Thu, 02 Sep 2021, Rich Shepard writes: > The first three commands in the script are: > stage <- read.csv('../data/water/gauge-ht.dat', header > = TRUE, sep = ',', stringsAsFactors = FALSE) > stage$sampdate <- as.Date(stage$sampdate) > stage$ht <- as.numeric(stage$ht, length = 6) > > Running the

[R] read.csv() error

2021-09-02 Thread Rich Shepard
The first three commands in the script are: stage <- read.csv('../data/water/gauge-ht.dat', header = TRUE, sep = ',', stringsAsFactors = FALSE) stage$sampdate <- as.Date(stage$sampdate) stage$ht <- as.numeric(stage$ht, length = 6) Running the script produces this error: source('stage.R') Erro

Re: [R] read.csv fails in R console in Ubuntu terminal but works in RStudio after R 3.6.3 upgrade to R 4.0.2?

2020-07-16 Thread Ista Zahn
On Thu, Jul 16, 2020 at 5:15 PM Ista Zahn wrote: > > On Thu, Jul 16, 2020 at 8:18 AM Rui Barradas wrote: > > > > Hello, > > > > Thanks, but no, download.file still gives 403 Forbidden with both method > > = "libcurl" and method = "wget". > > I think that makes it "not an R question". Ask on > htt

Re: [R] read.csv fails in R console in Ubuntu terminal but works in RStudio after R 3.6.3 upgrade to R 4.0.2?

2020-07-16 Thread Ista Zahn
On Thu, Jul 16, 2020 at 8:18 AM Rui Barradas wrote: > > Hello, > > Thanks, but no, download.file still gives 403 Forbidden with both method > = "libcurl" and method = "wget". I think that makes it "not an R question". Ask on https://unix.stackexchange.com/ maybe? Best, Ista > > Rui Barradas > >

Re: [R] read.csv fails in R console in Ubuntu terminal but works in RStudio after R 3.6.3 upgrade to R 4.0.2?

2020-07-16 Thread Daniel Nordlund
On 7/15/2020 4:02 PM, Rui Barradas wrote: Hello, R 4.0.2 on Ubuntu 20.04 LTS, sessionInfo below. I'm also unable to read the file with Rscript from the Ubuntu terminal but the error is not the same as the OP's. The first try was a file test1.R with the following commands. x<-"https://old.n

Re: [R] read.csv fails in R console in Ubuntu terminal but works in RStudio after R 3.6.3 upgrade to R 4.0.2?

2020-07-16 Thread Rui Barradas
Hello, Thanks, but no, download.file still gives 403 Forbidden with both method = "libcurl" and method = "wget". Rui Barradas Às 05:31 de 16/07/20, Jeff Newmiller escreveu: Perhaps read FAQ 7.43? [1] [1] https://cran.r-project.org/doc/FAQ/R-FAQ.html#How-can-I-enable-secure-https-downloads-

Re: [R] read.csv fails in R console in Ubuntu terminal but works in RStudio after R 3.6.3 upgrade to R 4.0.2?

2020-07-15 Thread Jeff Newmiller
Perhaps read FAQ 7.43? [1] [1] https://cran.r-project.org/doc/FAQ/R-FAQ.html#How-can-I-enable-secure-https-downloads-in-R_003f On July 15, 2020 4:02:27 PM PDT, Rui Barradas wrote: >Hello, > >R 4.0.2 on Ubuntu 20.04 LTS, sessionInfo below. > >I'm also unable to read the file with Rscript from th

Re: [R] read.csv fails in R console in Ubuntu terminal but works in RStudio after R 3.6.3 upgrade to R 4.0.2?

2020-07-15 Thread Rui Barradas
Hello, R 4.0.2 on Ubuntu 20.04 LTS, sessionInfo below. I'm also unable to read the file with Rscript from the Ubuntu terminal but the error is not the same as the OP's. The first try was a file test1.R with the following commands. x<-"https://old.nasdaq.com/screening/companies-by-name.aspx?

Re: [R] read.csv fails in R console in Ubuntu terminal but works in RStudio after R 3.6.3 upgrade to R 4.0.2?

2020-07-15 Thread Bert Gunter
I may be wrong, but probably better posted on r-sig-debian rather than here. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Wed, Jul 15, 2020 at 8:44 AM Sam H

[R] read.csv fails in R console in Ubuntu terminal but works in RStudio after R 3.6.3 upgrade to R 4.0.2?

2020-07-15 Thread Sam H
Hi, I am trying to download some data using read.csv and it works perfectly in RStudio and fails in the R console in the terminal in Ubuntu 18.04 after upgrading from R 3.6.3 to 4.0.2. Before upgrading this worked in the R console in the terminal also without any issues. Why would that be? How to

Re: [R] read.csv and Decimal places

2018-05-07 Thread Bill Poling
-help (r-help@r-project.org) Subject: Re: [R] read.csv and Decimal places ... and see also ?print.data.frame , the "digits" argument. See also ?str It might be worth your while spending time with an R tutorial or two that covers such topics, i.e. distinguishing between an object and v

Re: [R] read.csv and Decimal places

2018-05-07 Thread Bert Gunter
... and see also ?print.data.frame , the "digits" argument. See also ?str It might be worth your while spending time with an R tutorial or two that covers such topics, i.e. distinguishing between an object and various (S3) methods that "represent" it, such as print(), summary(), plot() etc. -- B

Re: [R] read.csv and Decimal places

2018-05-07 Thread Richard M. Heiberger
The stored numbers are correct. They are rounded on printing. print(RevFCast, digits=17) See ?options And scroll down to digits. On Mon, May 7, 2018 at 11:50 Bill Poling wrote: > Hi, Novice UsR here. > > I have a csv file that contains 13 columns of numeric data that have > decimal places (for

[R] read.csv and Decimal places

2018-05-07 Thread Bill Poling
Hi, Novice UsR here. I have a csv file that contains 13 columns of numeric data that have decimal places (for the most part). After reading in the file RevFCast = read.csv("RevAnalysisNov2016_April2018.csv", header=TRUE, dec = ".", stringsAsFactors=FALSE) and viewing the data View(RevFCast) S

Re: [R] read.csv interpreting numbers as factors

2013-12-10 Thread Barry Rowlingson
On Tue, Dec 10, 2013 at 10:06 AM, Jeff Newmiller wrote: > It is bad netiquette to hijack an existing thread for a new topic. Please > start a new email thread when changing topics. > > If your data really consists of what you show, then read.csv won't behave > that way. I suggest that you open t

Re: [R] read.csv interpreting numbers as factors

2013-12-10 Thread Jeff Newmiller
It is bad netiquette to hijack an existing thread for a new topic. Please start a new email thread when changing topics. If your data really consists of what you show, then read.csv won't behave that way. I suggest that you open the file in a text editor and look for odd characters. They may be

[R] read.csv interpreting numbers as factors

2013-12-10 Thread Bill
Why does R interpret a column of numbers in a csv file as a factor when using read.csv() and how can I prevent that. The data looks like 9928 3502 146 404 1831 686 249 I tried kick=read.csv("kick.csv",stringsAsFactors =FALSE) as well as kick=read.csv("kick.csv") Thanks On Mon, Dec 2, 2013 at 5

Re: [R] read.csv timing

2013-06-10 Thread ivo welch
here are some small benchmarks on an i7-2600k with an SSD: input file: 104,126 rows with 76 columns. all numeric. linux> time bzcat bzfile.csv.bz2 > /dev/null --> 1.8 seconds R> d <- read.csv( pipe( bzfile ) ) --> 6.3 seconds R> d <- read.csv( pipe( bzfile ), colClasses="numeric") --> 4.2 s

Re: [R] read.csv and write.csv filtering for very big data ?

2013-06-05 Thread ivo welch
I just tested read.csv with files...it still works. it can read one line at a time (without col.names and with nrows). nice. it loses its type memory across reinvokcations, but this is usually not a problem if one reads a few thousand lines inside a buffer function. this sort of function is use

Re: [R] read.csv and write.csv filtering for very big data ?

2013-06-05 Thread Duncan Murdoch
On 05/06/2013 10:32 AM, ivo welch wrote: I just tested read.csv with files...it still works. it can read one line at a time (without col.names and with nrows). nice. it loses its type memory across reinvokcations, but this is usually not a problem if one reads a few thousand lines inside a

Re: [R] read.csv and write.csv filtering for very big data ?

2013-06-05 Thread Duncan Murdoch
On 13-06-05 12:08 AM, ivo welch wrote: thx, greg. chunk boundaries have meanings. the reader needs to stop, and buffer one line when it has crossed to the first line beyond the boundary. it is also problem that read.csv no longer works with files---readLines then has to do the processing. (st

Re: [R] read.csv and write.csv filtering for very big data ?

2013-06-04 Thread ivo welch
thx, greg. chunk boundaries have meanings. the reader needs to stop, and buffer one line when it has crossed to the first line beyond the boundary. it is also problem that read.csv no longer works with files---readLines then has to do the processing. (starting read.csv over and over again with

Re: [R] read.csv and write.csv filtering for very big data ?

2013-06-04 Thread Greg Snow
Some possibilities using existing tools. If you create a file connection and open it before reading from it (or writing to it), then functions like read.table and read.csv ( and write.table for a writable connection) will read from the connection, but not close and reset it. This means that you c

[R] read.csv and write.csv filtering for very big data ?

2013-06-03 Thread ivo welch
dear R wizards--- I presume this is a common problem, so I thought I would ask whether this solution already exists and if not, suggest it. say, a user has a data set of x GB, where x is very big---say, greater than RAM. fortunately, data often come sequentially in groups, and there is a need to

Re: [R] read.csv quotes within fields

2013-01-28 Thread Tim Howard
Yes! This does this trick. Thank You! Tim >>> peter dalgaard 1/26/2013 11:49 AM >>> On Jan 26, 2013, at 16:32 , Tim Howard wrote: > Duncan, > Good point - I guess I am expecting too much. I'll work on a global replace > before import or chopping with strsplit while importing. > > FYI every

Re: [R] read.csv quotes within fields

2013-01-26 Thread peter dalgaard
On Jan 26, 2013, at 16:32 , Tim Howard wrote: > Duncan, > Good point - I guess I am expecting too much. I'll work on a global replace > before import or chopping with strsplit while importing. > > FYI everyone - these folks with the non-standard csv are the US Feds: > https://oeaaa.faa.gov/oe

Re: [R] read.csv quotes within fields

2013-01-26 Thread Tim Howard
Duncan, Good point - I guess I am expecting too much. I'll work on a global replace before import or chopping with strsplit while importing. FYI everyone - these folks with the non-standard csv are the US Feds: https://oeaaa.faa.gov/oeaaa/external/public/publicAction.jsp?action=showCaseDownload

Re: [R] read.csv quotes within fields

2013-01-26 Thread John Kane
.net > Sent: Fri, 25 Jan 2013 13:42:25 -0800 > To: tghow...@gw.dec.state.ny.us > Subject: Re: [R] read.csv quotes within fields > > > On Jan 25, 2013, at 1:37 PM, Tim Howard wrote: > >> David, >> Thank you again for the reply. I'll try to make readLines() and

Re: [R] read.csv quotes within fields

2013-01-25 Thread Duncan Murdoch
On 13-01-25 4:37 PM, Tim Howard wrote: David, Thank you again for the reply. I'll try to make readLines() and strplit() work. What bugs me is that I think it would import fine if the folks who created the csv had used double quotes "" rather than an escaped quote \" for those pesky internal qu

Re: [R] read.csv quotes within fields

2013-01-25 Thread David Winsemius
On Jan 25, 2013, at 1:37 PM, Tim Howard wrote: > David, > Thank you again for the reply. I'll try to make readLines() and strplit() > work. What bugs me is that I think it would import fine if the folks who > created the csv had used double quotes "" rather than an escaped quote \" for > thos

Re: [R] read.csv quotes within fields

2013-01-25 Thread Tim Howard
David, Thank you again for the reply. I'll try to make readLines() and strplit() work. What bugs me is that I think it would import fine if the folks who created the csv had used double quotes "" rather than an escaped quote \" for those pesky internal quotes. Since that's the case, I'd think

Re: [R] read.csv quotes within fields

2013-01-25 Thread David Winsemius
On Jan 25, 2013, at 11:35 AM, Tim Howard wrote: > Great point, your fix (quote="") works for the example I gave. Unfortunately, > these text strings have commas in them as well(!). Throw a few commas in any > of the text strings and it breaks again. Sorry about not including those in > the e

Re: [R] read.csv quotes within fields

2013-01-25 Thread Tim Howard
Great point, your fix (quote="") works for the example I gave. Unfortunately, these text strings have commas in them as well(!). Throw a few commas in any of the text strings and it breaks again. Sorry about not including those in the example. So, I need to incorporate commas *and* quotes wi

Re: [R] read.csv quotes within fields

2013-01-25 Thread David Winsemius
On Jan 25, 2013, at 10:42 AM, Tim Howard wrote: > All, > > I have some csv files I am trying to import. I am finding that quotes inside > strings are escaped in a way R doesn't expect for csv files. The problem only > seems to rear its ugly head when there are an uneven number of internal > q

Re: [R] read.csv quotes within fields

2013-01-25 Thread Tim Howard
Drat, I forgot to tell you what system I am on: > sessionInfo() R version 2.15.1 (2012-06-22) Platform: i386-pc-mingw32/i386 (32-bit) locale: [1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252 LC_NUMERIC=C

[R] read.csv quotes within fields

2013-01-25 Thread Tim Howard
All, I have some csv files I am trying to import. I am finding that quotes inside strings are escaped in a way R doesn't expect for csv files. The problem only seems to rear its ugly head when there are an uneven number of internal quotes. I'll try to recreate the problem: # set up a matrix,

[R] read.csv returns "no lines available for input"

2013-01-18 Thread Collins, Stephen
Hello, I'm trying to read a file rows at a time, so as to not read the entire file into memory. When reading the connections and readLines help, and R help archive, it seems this should be possible with read.csv and a file connection, making use of the "nrows" argument. >From certain posts,

Re: [R] Read.csv

2012-12-04 Thread Sarah Goslee
Hi Arvin, How are you preparing the data to be read: a spreadsheet? How are you reading the data? How have you verified that the CSV file is correct? How have you verified that the data frame is incorrect? Can you provide a reproducible example using a small portion of your dataset? Sarah On T

Re: [R] Read.csv

2012-12-04 Thread Duncan Murdoch
On 04/12/2012 1:02 PM, Torus Insurance wrote: Hi list, I am using read.csv to read data from csf files, but noticed that the numeric data (those larger than 10 power 9) are rounded to the nearest million (10 power 6). Any solution? What makes you think that is happening? R rounds values for pr

[R] Read.csv

2012-12-04 Thread Torus Insurance
Hi list, I am using read.csv to read data from csf files, but noticed that the numeric data (those larger than 10 power 9) are rounded to the nearest million (10 power 6). Any solution? Thanks Arvin -- Sent from my mobile device __ R-help@r-project.org

Re: [R] read.csv and field containing single quotes

2012-03-27 Thread Rainer M Krug
On 27/03/12 01:09, Benilton Carvalho wrote: > I need to read in csv files, created by 3rd party, with fields > containing single quotes (as shown below). > > "header1","header2","header3","header4" > "field1r1","field2r1","field3r1","field4r1" > "field1r2","field2r2","field3r2PartA), field3r2PartB

Re: [R] read.csv and field containing single quotes

2012-03-27 Thread Benilton Carvalho
Thanks Henrique... giving it a try now, but it'll take a good while, given the file size. Cheers, b On 27 March 2012 02:35, Henrique Dallazuanna wrote: > Benilton, > > Try this: > > read.table(textConnection(gsub('","', "','", gsub('^\"|\"$', "'", > readLines('../teste.csv', sep = ',', quo

Re: [R] read.csv and field containing single quotes

2012-03-26 Thread Henrique Dallazuanna
Benilton, Try this: read.table(textConnection(gsub('","', "','", gsub('^\"|\"$', "'", readLines('../teste.csv', sep = ',', quote = "'", header = TRUE) On Mon, Mar 26, 2012 at 8:09 PM, Benilton Carvalho wrote: > I need to read in csv files, created by 3rd party, with fields > containing sing

[R] read.csv and field containing single quotes

2012-03-26 Thread Benilton Carvalho
I need to read in csv files, created by 3rd party, with fields containing single quotes (as shown below). "header1","header2","header3","header4" "field1r1","field2r1","field3r1","field4r1" "field1r2","field2r2","field3r2PartA), field3r2PartB Very" Long","field4r2" "field1r3","field2r3","field3r3"

Re: [R] read.csv converts "NA" to missing values

2012-02-27 Thread peter dalgaard
On Feb 27, 2012, at 14:15 , nikhil abhyankar wrote: > Hello, > > I have a CSV file with region codes listed in a column. E.g. 'AS' for Asia, > 'AU' for Australia and 'NA' North America. > > However, the data frame created using read.csv shows where the string > variable should have had the val

Re: [R] read.csv converts "NA" to missing values

2012-02-27 Thread R. Michael Weylandt
I believe read.csv(..., na.strings = "") will do it. Michael On Mon, Feb 27, 2012 at 8:15 AM, nikhil abhyankar wrote: > Hello, > > I have a CSV file with region codes listed in a column. E.g. 'AS' for Asia, > 'AU' for Australia and 'NA' North America. > > However, the data frame created using re

[R] read.csv converts "NA" to missing values

2012-02-27 Thread nikhil abhyankar
Hello, I have a CSV file with region codes listed in a column. E.g. 'AS' for Asia, 'AU' for Australia and 'NA' North America. However, the data frame created using read.csv shows where the string variable should have had the value 'NA'. How can I input the value 'NA' present in a column in a CS

Re: [R] read.csv error: invalid multibyte string

2012-02-19 Thread Milan Bouchet-Valat
Le samedi 31 décembre 2011 à 07:05 -0800, Dennis Fisher a écrit : > R version: 2.13.1 > OS X > > Colleagues, > > I am working with a CSV file; for testing purposes, I created an XLS version > of the file. > When I read these files using read.xls (gdata) or read.csv, I encounter an > error: >

Re: [R] read.csv "Duplicate row.names not allowed"

2012-02-06 Thread David Winsemius
On Feb 7, 2012, at 12:39 AM, David Winsemius wrote: On Feb 7, 2012, at 12:22 AM, Hasan Diwan wrote: I'm trying to read in a CSV, with lines looking like: HEADER, Latitude DecDeg, Latitude Hemisphere, Longitude DecDeg, Longitude Hemisphere, Speed knots, Bearing Degrees, fixQualityGga, n

Re: [R] read.csv "Duplicate row.names not allowed"

2012-02-06 Thread David Winsemius
On Feb 7, 2012, at 12:22 AM, Hasan Diwan wrote: I'm trying to read in a CSV, with lines looking like: HEADER, Latitude DecDeg, Latitude Hemisphere, Longitude DecDeg, Longitude Hemisphere, Speed knots, Bearing Degrees, fixQualityGga, noOfSatGga, altGga, heightGga, selectionGsa, fixGsa,

[R] read.csv "Duplicate row.names not allowed"

2012-02-06 Thread Hasan Diwan
I'm trying to read in a CSV, with lines looking like: HEADER, Latitude DecDeg, Latitude Hemisphere, Longitude DecDeg, Longitude Hemisphere, Speed knots, Bearing Degrees, fixQualityGga, noOfSatGga, altGga, heightGga, selectionGsa, fixGsa, pdopGsa, hdopGsa, vdopGsa, noOfSatGsv, Time, *c

Re: [R] read.csv error: invalid multibyte string

2011-12-31 Thread peter dalgaard
On Dec 31, 2011, at 16:05 , Dennis Fisher wrote: > R version: 2.13.1 > OS X > > Colleagues, > > I am working with a CSV file; for testing purposes, I created an XLS version > of the file. > When I read these files using read.xls (gdata) or read.csv, I encounter an > error: > Error in

[R] read.csv error: invalid multibyte string

2011-12-31 Thread Dennis Fisher
R version: 2.13.1 OS X Colleagues, I am working with a CSV file; for testing purposes, I created an XLS version of the file. When I read these files using read.xls (gdata) or read.csv, I encounter an error: Error in type.convert(data[[i]], as.is = as.is[i], dec = dec, na.strings = ch

Re: [R] read.csv behaviour

2011-09-28 Thread Jim Lemon
On 09/28/2011 09:23 AM, Mehmet Suzen wrote: This might be obvious but I was wondering if anyone knows quick and easy way of writing out a CSV file with varying row lengths, ideally an initial data read from a CSV file which has the same format. See example below. I found it quite strange that

[R] read.csv behaviour

2011-09-27 Thread Mehmet Suzen
This might be obvious but I was wondering if anyone knows quick and easy way of writing out a CSV file with varying row lengths, ideally an initial data read from a CSV file which has the same format. See example below. I found it quite strange that R cannot write it in one go, so one must appen

Re: [R] read.csv help

2011-07-19 Thread Peter Ehlers
On 2011-07-19 01:27, psombe wrote: Well yeah it works fine for small data but when i tried the exact same command with a large data set (abt 167 rows and 4000 columns) it gave me a different data frame. either i get the first column as row names and so when i put data[1,1] i get the the first r

Re: [R] read.csv help

2011-07-19 Thread psombe
Well yeah it works fine for small data but when i tried the exact same command with a large data set (abt 167 rows and 4000 columns) it gave me a different data frame. either i get the first column as row names and so when i put data[1,1] i get the the first row second column data (from the origin

Re: [R] read.csv help

2011-07-19 Thread Rainer Schuermann
Original-Nachricht > Datum: Tue, 19 Jul 2011 00:05:30 -0700 (PDT) > Von: psombe > An: r-help@r-project.org > Betreff: [R] read.csv help > Hi, > I'm a new R user and I'm having trouble with the read.csv command. It > somehow treats the first column as

[R] read.csv help

2011-07-19 Thread psombe
Hi, I'm a new R user and I'm having trouble with the read.csv command. It somehow treats the first column as a row name field even though it's not a row name. there are no missing columns/entries and i'm not sure how to resolve this. the format of my data is A, B, C, D,..(3984 columns) 12,

[R] read.csv and FileEncoding in Windows version of R 2.13.0

2011-05-19 Thread Alexander Peterhansl
Dear Help List: read.csv() seems to have changed in R version 2.13.0 as compared to version 2.12.2 when reading in simple CSV files. In reading a 2-column CSV file ("test.csv"), say 1, a 2, b If file is encoded as UTF-8 (on Windows 7), then under R 2.13.0 read.csv("test.csv",fileEncoding="UTF-8

Re: [R] read.csv fails to read a CSV file from google docs

2011-04-30 Thread Tal Galili
Dear Duncan - many thanks for your reply/solution, it works beautifully now. Best wishes, Tal Contact Details:--- Contact me: tal.gal...@gmail.com | 972-52-7275845 Read me: www.talgalili.com (Hebrew) | www.biostatistics.co.il (

Re: [R] read.csv fails to read a CSV file from google docs

2011-04-29 Thread Duncan Temple Lang
Hi Tal You can add ssl.verifypeer = FALSE in the .opts list so that the certificate is simply accepted. Alternatively, you can tell libcurl where to find the certification authority file containing signatures. This can be done via the cainfo option, e.g. cainfo = system.file("CurlSSL", "c

Re: [R] read.csv fails to read a CSV file from google docs

2011-04-29 Thread Tal Galili
Hello Duncan, Thank you for having a look at this. I tried the code you provided but it failed in the getForm stage. running this: > tt = getForm("http://spreadsheets0.google.com/spreadsheet/pub";, + hl ="en", key = "0AgMhDTVek_sDdGI2YzY2R1ZESDlmZS1VYUxvblQ0REE", + sing

Re: [R] read.csv fails to read a CSV file from google docs

2011-04-29 Thread Philipp Pagel
On Fri, Apr 29, 2011 at 06:19:24PM +0300, Tal Galili wrote: > > data_url <- " > http://spreadsheets0.google.com/spreadsheet/pub?hl=en&hl=en&key=0AgMhDTVek_sDdGI2YzY2R1ZESDlmZS1VYUxvblQ0REE&single=true&gid=0&output=csv > " > read.csv(data_url) > Error in file(file, "rt") : cannot open the connection

Re: [R] read.csv fails to read a CSV file from google docs

2011-04-29 Thread Duncan Temple Lang
Thanks David for fixing the early issues. The reason for the failure is that the response from the Web server is a to redirect the requester to another page, specifically https://spreadsheets0.google.com/spreadsheet/pub?hl=en&hl=en&key=0AgMhDTVek_sDdGI2YzY2R1ZESDlmZS1VYUxvblQ0REE&single=true&g

Re: [R] read.csv fails to read a CSV file from google docs

2011-04-29 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of David Winsemius > Sent: Friday, April 29, 2011 10:36 AM > To: Tal Galili > Cc: r-help@r-project.org > Subject: Re: [R] read.csv fails to read a CSV

Re: [R] read.csv fails to read a CSV file from google docs

2011-04-29 Thread David Winsemius
On Apr 29, 2011, at 11:19 AM, Tal Galili wrote: Hello all, I wish to use read.csv to read a google doc spreadsheet. I try using the following code: data_url <- " http://spreadsheets0.google.com/spreadsheet/pub?hl=en&hl=en&key=0AgMhDTVek_sDdGI2YzY2R1ZESDlmZS1VYUxvblQ0REE&single=true&gid=0&outp

[R] read.csv fails to read a CSV file from google docs

2011-04-29 Thread Tal Galili
Hello all, I wish to use read.csv to read a google doc spreadsheet. I try using the following code: data_url <- " http://spreadsheets0.google.com/spreadsheet/pub?hl=en&hl=en&key=0AgMhDTVek_sDdGI2YzY2R1ZESDlmZS1VYUxvblQ0REE&single=true&gid=0&output=csv " read.csv(data_url) Which results in the fo

Re: [R] read.csv does not find my file (windows xp)

2010-06-24 Thread Ralf B
jep! I forgot to use sep="" for paste and introducted a space in front of the filename... damn, 1 hour of my life! Ralf 2010/6/24 Uwe Ligges : > > > On 24.06.2010 19:02, Ralf B wrote: >> >> I try to load a file >> >> myData<- read.csv(file="C:\\myfolder\\mysubfolder\\mydata.csv", >> head=TRUE, se

Re: [R] read.csv does not find my file (windows xp)

2010-06-24 Thread Uwe Ligges
On 24.06.2010 19:02, Ralf B wrote: I try to load a file myData<- read.csv(file="C:\\myfolder\\mysubfolder\\mydata.csv", head=TRUE, sep=";") and get this error: Error in file(file, "rt") : cannot open the connection In addition: Warning message: In file(file, "rt") : cannot open file 'C:\m

[R] read.csv does not find my file (windows xp)

2010-06-24 Thread Ralf B
I try to load a file myData <- read.csv(file="C:\\myfolder\\mysubfolder\\mydata.csv", head=TRUE, sep=";") and get this error: Error in file(file, "rt") : cannot open the connection In addition: Warning message: In file(file, "rt") : cannot open file 'C:\myfolder\mysubfolder\mydata.csv: No such

Re: [R] read.csv and blank character in object name of my data.frame

2010-04-30 Thread arnaud Gaboury
p@r-project.org > Subject: Re: [R] read.csv and blank character in object name of my > data.frame > > See ?read.table and its argument "strip.white". > > Uwe Ligges > > > On 30.04.2010 09:39, arnaud Gaboury wrote: > > Dear group, > > > > Here is

[R] read.csv and blank character in object name of my data.frame

2010-04-30 Thread arnaud Gaboury
Dear group, Here is my data frame: position100415 <- structure(list(DESCRIPTION = structure(1:9, .Label = c(" SUGAR NO.11 Jul/10 ", " SUGAR NO.11 May/10 ", "CORN May/10 ", "COTTON NO.2 Jul/10 ", "CRUDE OIL miNY May/10 ", "ROBUSTA COFFEE (10) Jul/10 ", "SILVER May/10 ", "SOYBEANS Jul/10 ", "WHE

Re: [R] read.csv data frame thousands separator

2010-04-23 Thread Marc Schwartz
On Apr 23, 2010, at 8:00 AM, arnaud Gaboury wrote: > Dear group, > > > > Here is my df, trades1 : > > > > trades1 <- > > structure(list(Instrument.Long.Name = c("CORN", "CORN", "CORN", > "CORN", "CORN", "SOYBEANS", "SOYBEANS", "SOYBEANS", "SOYBEANS", > "SOYBEANS", "SOYBEANS", "STANDARD LE

Re: [R] read.csv data frame thousands separator

2010-04-23 Thread Barry Rowlingson
On Fri, Apr 23, 2010 at 2:00 PM, arnaud Gaboury wrote: > Dear group, > "2,421.5000", "2,448.5000", "1,380.", "1,383.", "1,383.", > > "1,386.", "1,386.", "1,388.", "1,389.", "1,389." > > >>trades1=read.csv2("LSCTrades.csv",dec=".",sep=",",as.is=T,h=T,skip=1) > > >

[R] read.csv data frame thousands separator

2010-04-23 Thread arnaud Gaboury
Dear group, Here is my df, trades1 : trades1 <- structure(list(Instrument.Long.Name = c("CORN", "CORN", "CORN", "CORN", "CORN", "SOYBEANS", "SOYBEANS", "SOYBEANS", "SOYBEANS", "SOYBEANS", "SOYBEANS", "STANDARD LEAD USD", "STANDARD LEAD USD", "SPCL HIGH GRADE ZINC USD", "SPCL HIGH GRA

Re: [R] read.csv to read output of system()?

2009-12-12 Thread Marianne Promberger
David Winsemius 12-Dec-09 17:12: > > txt <- gsub("( [A-Za-z]+),","\\1;",readLines("file.csv")) > > read.csv(textConnection(txt), header=TRUE) >var1 var2 var3 > 1 onetwo three > 2 one this is a comment;with commas. three Wonderful, tha

Re: [R] read.csv to read output of system()?

2009-12-12 Thread David Winsemius
On Dec 12, 2009, at 12:01 PM, Marianne Promberger wrote: Thanks for both replies. Let me start by giving a better minimal example, although indeed the regex replacement is not my problem. system("echo \"var1,var2,var3\none,two,three\none,this is a comment,with commas.,three\" > file.csv")

Re: [R] read.csv to read output of system()?

2009-12-12 Thread Marianne Promberger
Thanks for both replies. Let me start by giving a better minimal example, although indeed the regex replacement is not my problem. system("echo \"var1,var2,var3\none,two,three\none,this is a comment,with commas.,three\" > file.csv") > On 12/12/09 11:02, David Winsemius wrote: > > > > You ne

Re: [R] read.csv to read output of system()?

2009-12-12 Thread Jonathan Baron
On 12/12/09 11:02, David Winsemius wrote: > > On Dec 12, 2009, at 7:54 AM, Marianne Promberger wrote: > > > Dear list, > > > > I have a file that is comma delimited but contains some erroneous > > non-delimiter commas. I would like to replace these commas with > > semicolons and then read the cor

Re: [R] read.csv to read output of system()?

2009-12-12 Thread David Winsemius
On Dec 12, 2009, at 7:54 AM, Marianne Promberger wrote: Dear list, I have a file that is comma delimited but contains some erroneous non-delimiter commas. I would like to replace these commas with semicolons and then read the correct file into R as a data frame. I want to do this from within

[R] read.csv to read output of system()?

2009-12-12 Thread Marianne Promberger
Dear list, I have a file that is comma delimited but contains some erroneous non-delimiter commas. I would like to replace these commas with semicolons and then read the correct file into R as a data frame. I want to do this from within R, without changing the original data file. My current idea

Re: [R] "Read.csv" in R with dynamic file (1st) argument

2009-09-10 Thread Don MacQueen
Alternatives to sprintf() include formatC() or prettyNum(), which would have to be used in combination with paste(). In Carl's solution, the file.path() function should be considered, since it automatically uses the correct path separators for the OS. Furthermore, eval() is not necessary.

Re: [R] "Read.csv" in R with dynamic file (1st) argument

2009-09-10 Thread Steven Kang
Oh strange, as it worked for me.. Thanks for providing alternative method in solving the problem! On Fri, Sep 11, 2009 at 9:01 AM, Carl Witthoft wrote: > That will not work (or at least doesn't work for me. > > This does work: > > fnam<-'thefilename.csv' #or build the name however you like > f

Re: [R] "Read.csv" in R with dynamic file (1st) argument

2009-09-10 Thread Carl Witthoft
That will not work (or at least doesn't work for me. This does work: fnam<-'thefilename.csv' #or build the name however you like fpath <- 'macintoshhd/users/me/myfolder/ # or whatever you need read.csv(eval(paste(fpath,fnam,sep="")) #worked for me Carl --- Try this: read.csv(s

Re: [R] "Read.csv" in R with dynamic file (1st) argument

2009-09-09 Thread Henrique Dallazuanna
Try this: read.csv(sprintf("D://R//Data//%04d//%04d.csv", x, x), header = TRUE) On Wed, Sep 9, 2009 at 9:32 PM, Steven Kang wrote: > Dear R users, > > > I have numerous data sets (csv files) saved in the folder which has the > same > name as individual data. > (i.e data x1 saved in x1 folder, da

[R] "Read.csv" in R with dynamic file (1st) argument

2009-09-09 Thread Steven Kang
Dear R users, I have numerous data sets (csv files) saved in the folder which has the same name as individual data. (i.e data x1 saved in x1 folder, data x2 in x2 folder etc) I would like to read in the desired data set name using 'scan' function and assign this inputted value to an object so th

Re: [R] read.csv from a remote machine

2009-08-05 Thread Olga Lyashevska
Thanks for your suggestions Mark, On 04.08.2009, at 19:16, Mark Wardle wrote: Alternatively, can't you copy the data to the Linux box using sftp first? This is perhaps the easiest option. I have established sftp connection. Now I simply add all files I need to use. So the problem is solve

Re: [R] read.csv from a remote machine

2009-08-04 Thread Mark Wardle
I would use sshfs or an alternatively remote file system access. Ssh to your Linux box and then mount the mac os x filesystem via sshfs, or afs for example. Alternatively, can't you copy the data to the Linux box using sftp first? -- Dr. Mark Wardle Specialist registrar, Neurology (Sent fro

Re: [R] read.csv from a remote machine

2009-08-04 Thread Olga Lyashevska
Thanks Barry and Steve, I am trying to import data with read.csv and my file is on remote machine. I believe that I need to open a connection, not sure about syntax though. Probably works with ftp: too. How remote is it? In fact it is a bit more complicated. I am working on a Mac machine,

Re: [R] read.csv from a remote machine

2009-08-04 Thread Barry Rowlingson
On Tue, Aug 4, 2009 at 3:37 PM, Olga Lyashevska wrote: > Dear all, > > I am trying to import data with read.csv and my file is on remote machine. > I believe that I need to open a connection, not sure about syntax though. If it's on an HTTP server then you don't need to faff with connections, jus

Re: [R] read.csv from a remote machine

2009-08-04 Thread Steve Lianoglou
Hi, On Aug 4, 2009, at 10:37 AM, Olga Lyashevska wrote: Dear all, I am trying to import data with read.csv and my file is on remote machine. I believe that I need to open a connection, not sure about syntax though. I would appreciate any suggestions, Look at the different ways you can

[R] read.csv from a remote machine

2009-08-04 Thread Olga Lyashevska
Dear all, I am trying to import data with read.csv and my file is on remote machine. I believe that I need to open a connection, not sure about syntax though. I would appreciate any suggestions, Thanks! Olga __ R-help@r-project.org mailing list

Re: [R] read.csv greater than

2009-07-23 Thread stephen sefick
here is the solution x <- subset(read.csv("foo.csv"), VALUE>0) On Thu, Jul 23, 2009 at 11:28 AM, stephen sefick wrote: > I have a csv file that I am trying to read in and know that values <0 > are erroneous - is there a way to read only value grater than 0. > > thanks, > > -- > Stephen Sefick > >

[R] read.csv greater than

2009-07-23 Thread stephen sefick
I have a csv file that I am trying to read in and know that values <0 are erroneous - is there a way to read only value grater than 0. thanks, -- Stephen Sefick Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us

Re: [R] read.csv, header=TRUE but skip the first line

2009-06-28 Thread Mark Knecht
On Sun, Jun 28, 2009 at 2:38 PM, Ted Harding wrote: > More explicitly, it could be written: > >    skip: integer: the number of lines of the data file to skip before >          beginning to read the lines in the file. > > Hoping this helps! > Ted. It does! More questions coming once I do some mor

Re: [R] read.csv, header=TRUE but skip the first line

2009-06-28 Thread Ted Harding
On 28-Jun-09 21:05:59, Mark Knecht wrote: > Hi, > Complete newbie to R here. Just getting started reading manuals and > playing with data. > > I've managed to successfully get my *.csv files into R, however I > have to use header=FALSE because the real header starts in line #2. > The file format l

Re: [R] read.csv, header=TRUE but skip the first line

2009-06-28 Thread Mark Knecht
On Sun, Jun 28, 2009 at 2:18 PM, Peter Dalgaard wrote: > Mark Knecht wrote: >> >> Hi, >>   Complete newbie to R here. Just getting started reading manuals and >> playing with data. >> >>   I've managed to successfully get my *.csv files into R, however I >> have to use header=FALSE because the real

  1   2   >