Quantcast

incomplete final line

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

incomplete final line

mipplor

Hi,

I work like this:

> data<‐read.table('E:/my documents/r/consumer.xls',header=TRUE)
Warning message:
In read.table("E:/my documents/r/consumer.xls", header = TRUE) :
  incomplete final line found by readTableHeader on 'E:/my documents/r/consumer.xls'

could someone shoot the trouble for me ? thx

sorry for trouble ,im a newbie.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: incomplete final line

Joshua Wiley-2
Hi,

On Wed, Feb 16, 2011 at 10:11 AM, mipplor <[hidden email]> wrote:

> Hi,
>
> I work like this:
>
>> data<‐read.table('E:/my documents/r/consumer.xls',header=TRUE)
> Warning message:
> In read.table("E:/my documents/r/consumer.xls", header = TRUE) :
>  incomplete final line found by readTableHeader on 'E:/my
> documents/r/consumer.xls'
>
> could someone shoot the trouble for me ? thx

Le'me, just get my six shooter....

Although there is some ability to read Excel spreadsheets directly
into R, I think the easiest solution would be to first open the file
in Excel and then save it in a format more amenable to R such as .txt
or .csv.  CSV files have the attractive feature that you can use
read.csv() so its even easier to read in.  The R Import/Export manual
provides more details:

(1) http://cran.r-project.org/doc/manuals/R-data.html#Reading-Excel-spreadsheets

(2) Also see the documentation, which you can access at the console by typing

?read.table

Once you're done with that, I also highly recommend reading

(3) http://cran.r-project.org/doc/manuals/R-intro.html

(4) Install the "sos" package, which provides some very helpful
searching functions.
install.packages("sos")

(5) You can now use findFn() from the R console to look for packages
or functions related to Excel and it will give you a nicely formatted
table.
findFn("Excel")

(6) Once you've done the other steps, check out the R Inferno by
Patrick Burns.  It is an entertaining and informative guide to help
familiarize you with using R.
http://www.burns-stat.com/pages/Tutor/R_inferno.pdf

That ought to send your trouble for a ride on the three legged horse,

Josh

>
> sorry for trouble ,im a newbie.
> --
> View this message in context: http://r.789695.n4.nabble.com/incomplete-final-line-tp3309405p3309405.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> [hidden email] 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.

"If we try ridin' instead of thinkin'... Well, we'd end up hangin' by
a rope by nightfall."


--
Joshua Wiley
Ph.D. Student, Health Psychology
University of California, Los Angeles
http://www.joshuawiley.com/

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: incomplete final line

mipplor
thx for your suggestions , i have made it csv file,and it looks:


> data<‐read.table('E:/my documents/r/1.csv',header=TRUE)
Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings,  :
  line 1 did not have 2 elements


is there wrong with the data?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: incomplete final line

Joshua Wiley-2
On Thu, Feb 17, 2011 at 12:35 AM, mipplor <[hidden email]> wrote:
>
> thx for your suggestions , i have made it csv file,and it looks:
>
>
>> data<‐read.table('E:/my documents/r/1.csv',header=TRUE)

It looks like you could benefit from (re)reading my previous email.
You either need to specify the sep = argument in read.table() or use
read.csv(), which is a wrapper for read.table() with defaults for CSV
files.

Josh

> Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings,
> :
>  line 1 did not have 2 elements
>
>
> is there wrong with the data?
> --
> View this message in context: http://r.789695.n4.nabble.com/incomplete-final-line-tp3309405p3310357.html
> Sent from the R help mailing list archive at Nabble.com.

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: incomplete final line

mipplor
yepp,i have done as you said and run my test. but it seems something wrong with "sources" file.
what it does mean?

> model1<‐siarmcmcdirichletv4(data,sources,tef,concdep=0,500000,50000)
Error in the sources file - check this is numeric.
 
Problems with inputs: siar has not been run.
Warning message:
In as.vector(data) : NAs introduced by coercion

thx , bon weekend!
Loading...