+ Reply to Thread
Results 1 to 7 of 7

Thread: reading excel file /text file in R

  1. #1
    Points: 122, Level: 2
    Level completed: 44%, Points required for next Level: 28

    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    reading excel file /text file in R




    I am naive programmer..i am working on regression analysis. when i say
    read.table("filename.txt",header=FALSE)..where does R searches for the file? In which type of folder?

  2. #2
    Devorador de queso
    Points: 95,540, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Awards:
    Posting AwardCommunity AwardDiscussion EnderFrequent Poster
    Dason's Avatar
    Location
    Tampa, FL
    Posts
    12,930
    Thanks
    307
    Thanked 2,629 Times in 2,245 Posts

    Re: reading excel file /text file in R

    In your working directory. You can check which folder that currently is with

    Code: 
    getwd()
    You can change it with the setwd() function

    Code: 
    setwd("C:/Users/scuby/Rfiles/blargcats")
    I don't have emotions and sometimes that makes me very sad.

  3. #3
    Human
    Points: 12,666, Level: 73
    Level completed: 54%, Points required for next Level: 184
    Awards:
    Master Tagger
    GretaGarbo's Avatar
    Posts
    1,360
    Thanks
    455
    Thanked 462 Times in 402 Posts

    Re: reading excel file /text file in R

    Or you can look at the never ending story.

    (51 post now for one line of code!)

  4. #4
    Points: 122, Level: 2
    Level completed: 44%, Points required for next Level: 28

    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: reading excel file /text file in R

    Thank you! but i am working on MAC.
    Sorry i should have specified

  5. #5
    Devorador de queso
    Points: 95,540, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Awards:
    Posting AwardCommunity AwardDiscussion EnderFrequent Poster
    Dason's Avatar
    Location
    Tampa, FL
    Posts
    12,930
    Thanks
    307
    Thanked 2,629 Times in 2,245 Posts

    Re: reading excel file /text file in R

    Advice still applies... just use an appropriate location in setwd.
    I don't have emotions and sometimes that makes me very sad.

  6. #6
    Points: 122, Level: 2
    Level completed: 44%, Points required for next Level: 28

    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: reading excel file /text file in R

    Error in file(file, "rt") : cannot open the connection
    Last edited by scuby; 09-17-2015 at 09:43 PM.

  7. #7
    Human
    Points: 12,666, Level: 73
    Level completed: 54%, Points required for next Level: 184
    Awards:
    Master Tagger
    GretaGarbo's Avatar
    Posts
    1,360
    Thanks
    455
    Thanked 462 Times in 402 Posts

    Re: reading excel file /text file in R


    Quote Originally Posted by scuby View Post
    Error in file(file, "rt") : cannot open the connection
    Make a short reproducible example!

+ Reply to Thread

           




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