Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jhan
    Junior Member
    • Aug 2012
    • 6

    #1

    Saving files in R workspace

    Hi,

    I need some help here.

    I am using R in Linux. What's the best way to save data from R process. I did 'save the workspace' when i exit R but this doesn't update the output file when I use another machine.

    What's the good way to do this?

    Jun
  • pallevillesen
    Member
    • May 2012
    • 19

    #2
    I suggest you check

    ?save
    ?load

    for saving specific R objects/data

    Comment

    • jhan
      Junior Member
      • Aug 2012
      • 6

      #3
      Thanks for the response.

      I thought the 'Save workspace image' did the same as the 'save.image'function.

      > q()
      Save workspace image? [y/n/c]: y

      aren't they the same?

      Comment

      • TiborNagy
        Senior Member
        • Mar 2010
        • 329

        #4
        When you save your workspace R creates two hidden files: .Rhistory and .RData
        Using save.image you can change this default behaviour and save to an alternative file.

        Comment

        • pallevillesen
          Member
          • May 2012
          • 19

          #5
          ...and load that file again on a different machine... (after using save.image())

          But saving specific/required objects only will make your code nicer (and memory requirements smaller).

          Comment

          • jhan
            Junior Member
            • Aug 2012
            • 6

            #6
            thanks the answering from both.

            So when I quit R the .RData saved in my working directory is a hidden file I can't see.

            Now I start saving my specific/required files using
            save(myresult, file="myresult.RData").

            This way I can see the files saved. Does that mean I can also save them as .txt or .csv to open in other environment (not R)?

            And what's the difference between save.image() and save()?

            Comment

            • TiborNagy
              Senior Member
              • Mar 2010
              • 329

              #7
              save.image() is a shortcut for save().
              You can use ascii=T options to save the images as a human readable file, but it is contains more data than you need (all objects, system settings). If you would like to save only a specific variable, use write.table() (or write.csv) instead.

              Comment

              • jhan
                Junior Member
                • Aug 2012
                • 6

                #8
                thanks for the response.

                Comment

                • Sebastiann
                  Junior Member
                  • Aug 2012
                  • 6

                  #9
                  Originally posted by TiborNagy View Post
                  save.image() is a shortcut for save().
                  You can use ascii=T options to save the images as a human readable file, but it is contains more data than you need (all objects, system settings). If you would like to save only a specific variable, use write.table() (or write.csv) instead.
                  Thnx for providing the solution i hadn't asked but was suffering with the same problem...
                  click here

                  Comment

                  • Jeremy
                    Senior Member
                    • Nov 2009
                    • 190

                    #10
                    I usually just use write(...) or write.table(...)
                    to get information about them type into R:
                    help(write)
                    and then
                    help(write.table)
                    or
                    help('whatever function you want information on')

                    Comment

                    Latest Articles

                    Collapse

                    • SEQadmin2
                      Multiomic Liquid Biopsy: What DNA/RNA Panels Reveal That DNA Alone Can’t
                      by SEQadmin2



                      Tumors contain complex mixtures of cell populations that evolve in response to treatment and host-specific factors. Tissue biopsies provide only static snapshots of a tumor’s state. But what if we could follow that evolution over time using a minimally invasive technique?

                      Liquid biopsies can detect tumor-derived material circulating in the bloodstream, providing a way to study treatment response, detect emerging resistance, and discover new biomarkers. Circulating
                      ...
                      10-14-2026, 09:55 AM
                    • SEQadmin2
                      New Genomics Technologies Take Aim at Long-Standing Limits
                      by SEQadmin2


                      Researchers using sequencing and genomics tools often have to make trade-offs. They can choose between speed or scale, short reads or long-range information, or targeted panels or a view of the whole transcriptome. New technologies that have been released this year are built to address those tough choices.

                      We asked six companies the same four questions to learn about their latest products. The new technologies bring a lot to the table, including rethinking sequencing
                      ...
                      09-28-2026, 10:25 AM

                    ad_right_rmr

                    Collapse

                    News

                    Collapse

                    Topics Statistics Last Post
                    Started by SEQadmin2, 10-22-2026, 11:13 AM
                    0 responses
                    26 views
                    0 reactions
                    Last Post SEQadmin2  
                    Started by SEQadmin2, 10-22-2026, 10:48 AM
                    0 responses
                    20 views
                    0 reactions
                    Last Post SEQadmin2  
                    Started by SEQadmin2, 10-15-2026, 10:52 AM
                    0 responses
                    36 views
                    0 reactions
                    Last Post SEQadmin2  
                    Started by SEQadmin2, 10-14-2026, 05:39 AM
                    0 responses
                    43 views
                    0 reactions
                    Last Post SEQadmin2  
                    Working...