+ Reply to Thread
Results 1 to 2 of 2

Thread: error in loading data in R

  1. #1
    Points: 2,419, Level: 29
    Level completed: 80%, Points required for next Level: 31

    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    error in loading data in R



    Hi,

    I just started to work with R and I am trying to load excel data into a special R package called iTRAQPak with:
    >LoadData("C:\\Laurence\\Rstatisticalanalysis.xls", mod.eval = F, sep = "\t", tags.s1 = c(113, 115, 118, 119), tags.s2 = c(114, 116, 117, 121))

    Then I receive this error message:
    Error in 1:dim(dat)[1] : NA/NaN argument
    In addition: Warning message:
    In read.table(file = file, sep = sep, header = T) :
    incomplete final line found by readTableHeader on 'C:\Laurence\Rstatisticalanalysis.xls'

    I looked for the meaning and solving of this error in different manuals, but I can't find anything. Could someone help me with this?

    Thanks a lot!

  2. #2
    R purist
    Points: 13,351, Level: 75
    Level completed: 26%, Points required for next Level: 299
    TheEcologist's Avatar
    Location
    The Netherlands.
    Posts
    1,282
    Thanks
    112
    Thanked 249 Times in 125 Posts

    Quote Originally Posted by laurencevo View Post
    Hi,

    I just started to work with R and I am trying to load excel data into a special R package called iTRAQPak with:
    >LoadData("C:\\Laurence\\Rstatisticalanalysis.xls", mod.eval = F, sep = "\t", tags.s1 = c(113, 115, 118, 119), tags.s2 = c(114, 116, 117, 121))

    Then I receive this error message:
    Error in 1:dim(dat)[1] : NA/NaN argument
    In addition: Warning message:
    In read.table(file = file, sep = sep, header = T) :
    incomplete final line found by readTableHeader on 'C:\Laurence\Rstatisticalanalysis.xls'

    I looked for the meaning and solving of this error in different manuals, but I can't find anything. Could someone help me with this?

    Thanks a lot!
    some common mistakes:

    You have to make sure there are no empty entries. Fill them with the text 'NA'. Secondly make sure every label you have does not have any spaces in them. Example: if you have a column name like this 'UTM coordinate x' it will work fine in excel but not in the more precise R. You will need to change this to 'UTM.coordinate.x' or similar.

    then copy paste your data field and then type this in R.

    mydataname=read.table('clipboard',header=T)

    or save your datasheet as a .csv file and type:

    mydataname=read.csv(file.choose())

    or depending on if you are from the states or not:

    mydataname=read.csv2(file.choose()) #this is when csv files are semicolon seperated.

    good luck,
    The true ideals of great philosophies always seem to get lost somewhere along the road..

+ Reply to Thread

Similar Threads

  1. Replies: 0
    Last Post: 04-17-2011, 03:06 PM
  2. Replies: 2
    Last Post: 12-20-2010, 04:32 AM
  3. Replies: 0
    Last Post: 05-28-2010, 02:55 PM
  4. Standard error of proportion data
    By tickbite in forum R
    Replies: 1
    Last Post: 04-13-2010, 08:31 AM
  5. Loading data into R
    By gambs in forum R
    Replies: 1
    Last Post: 02-25-2009, 08:02 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts








Advertise on Talk Stats