Re: [R] R import glitch "missing data"

From: Struckmeier, Nathanael <NStruckmeier_at_harryanddavid.com>
Date: Thu, 26 May 2011 11:07:07 -0700

That is the strange thing... I DON'T get a warning message. R behaves as if all data is being imported successfully. I don't receive a memory warning, or warning of any kind. I've scanned my data for potential problems and I do not have any ('). However...

The .txt version of my file does use (") around some of my dollar values...here are all ways in which values on my .txt file are expressed.
900
-900
$900
"900"
"(900)"

The .csv version of my file uses:
900
-900
$900

StatBat2

-----Original Message-----
From: Peter Langfelder [mailto:peter.langfelder_at_gmail.com] Sent: Thursday, May 26, 2011 10:59 AM
To: Struckmeier, Nathanael
Cc: r-help_at_r-project.org
Subject: Re: [R] R import glitch "missing data"

On Thu, May 26, 2011 at 10:03 AM, StatBat2 <NStruckmeier_at_harryanddavid.com> wrote:
> Hello!
>
> I am trying import data into R and im running into a snag.
>
> GOAL:
> Import a 4 column, 8,000 row table into R including headers.
>
> WHAT I'VE ATTEMPTED:
> Original data was in Excel format.
> Converted data to both a .txt and .csv (to see which worked better)
> Imported data into R via commands as object "demand" (see below)
>
> Please excuse the long file path.
> demand=read.delim("C:\\Documents and Settings\\E066582\\My
> Documents\\R\\R-2.13.0\\bin\\demand.txt")
>
> demand=read.csv(("C:\\Documents and Settings\\E066582\\My
> Documents\\R\\R-2.13.0\\bin\\demand.csv", header=True)
>
> In both cases, about half to three fourths of my data shows up as
object
> "demand". My headers also fail to appear. I get about 4000 lines of my
table
> as well as missing headers. I've tried different variations on the
synatx of
> how i go about importing, with or without headers designated, with or
> without .csv ',' designation, but nothing changes. I'm at a loss as to
what
> is incorrect.

Do you get any error or warning messages?

Are there any apostrophes (') in your data? These can cause mayhem. If you have any, use the argument
quote = "\"".

HTH, Peter



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Thu 26 May 2011 - 18:11:08 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 26 May 2011 - 18:20:09 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive