{"id":69,"date":"2015-04-28T12:10:04","date_gmt":"2015-04-28T11:10:04","guid":{"rendered":"http:\/\/pcool.dyndns.org:8080\/statsbook\/?page_id=69"},"modified":"2025-06-24T00:05:53","modified_gmt":"2025-06-23T23:05:53","slug":"open-from-console","status":"publish","type":"page","link":"https:\/\/pcool.dyndns.org\/index.php\/data-into-r\/open-from-console\/","title":{"rendered":"Open RDA Files"},"content":{"rendered":"\n<p>Once imported in R, it is most convenient to save the data as a RDA file (R DAta file). This format stores all the data, including the data type, available for later use or exchange with colleagues (without having to re-import a spreadsheet and define each variable type).<\/p>\n\n\n\n<p>This <a href=\"https:\/\/pcool.dyndns.org:\/wp-content\/data_files\/height10.rda\">RDA file<\/a> contains the heights of 10 people.<\/p>\n\n\n\n<p>To open the data file:<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code><em><mark style=\"background-color:rgba(0, 0, 0, 0);color:#f70202\" class=\"has-inline-color\">load('\/path\/to_file\/height10.rda')\nls()\n<\/mark><mark style=\"background-color:rgba(0, 0, 0, 0);color:#1902f7\" class=\"has-inline-color\"> &#91;1] \"height10\"   <\/mark><mark style=\"background-color:rgba(0, 0, 0, 0);color:#f70202\" class=\"has-inline-color\">                            \nheight10\n<\/mark><mark style=\"background-color:rgba(0, 0, 0, 0);color:#1902f7\" class=\"has-inline-color\">   height\n1     184\n2     146\n3     169\n4     185\n5     160\n6     173\n7     179\n8     171\n9     160\n10    150<\/mark><mark style=\"background-color:rgba(0, 0, 0, 0);color:#f70202\" class=\"has-inline-color\">\nstr(height10)\n<\/mark><mark style=\"background-color:rgba(0, 0, 0, 0);color:#2102f7\" class=\"has-inline-color\">'data.frame':\t10 obs. of  1 variable:\n $ height: num  184 146 169 185 160 173 179 171 160 150<\/mark><\/em><\/code><\/pre>\n\n\n\n<p>The data frame nerve is preserved within the file. To show the data frames that are loaded in the environment, the list function (ls()) can be used.<\/p>\n\n\n\n<p>The variable name and type should already be appropriately set. <em>(but please check with str() before proceeding with analysis)<\/em>.<\/p>\n\n\n\n<p>To save a changed data frame in rda file format:<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code><em><mark style=\"background-color:rgba(0, 0, 0, 0);color:#eb2009\" class=\"has-inline-color\">save(height10, file = '\/path\/to_file\/height10.rda')<\/mark><\/em><\/code><\/pre>\n\n\n\n<p><em>(please edit the \/path\/to_file\/ to the appropriate location of the file)<\/em>.<\/p>\n\n\n\n<p>If the file name is the same as the data frame, it would be easier to find it later! But otherwise the ls() function can be used to recall the data frame.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Once imported in R, it is most convenient to save the data as a RDA file (R DAta file). This format stores all the data, including the data type, available for later use or exchange with colleagues (without having to re-import a spreadsheet and define each variable type). This RDA file contains the heights of [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":61,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"inline_featured_image":false,"footnotes":""},"class_list":["post-69","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/pcool.dyndns.org\/index.php\/wp-json\/wp\/v2\/pages\/69","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pcool.dyndns.org\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/pcool.dyndns.org\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/pcool.dyndns.org\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/pcool.dyndns.org\/index.php\/wp-json\/wp\/v2\/comments?post=69"}],"version-history":[{"count":2,"href":"https:\/\/pcool.dyndns.org\/index.php\/wp-json\/wp\/v2\/pages\/69\/revisions"}],"predecessor-version":[{"id":4345,"href":"https:\/\/pcool.dyndns.org\/index.php\/wp-json\/wp\/v2\/pages\/69\/revisions\/4345"}],"up":[{"embeddable":true,"href":"https:\/\/pcool.dyndns.org\/index.php\/wp-json\/wp\/v2\/pages\/61"}],"wp:attachment":[{"href":"https:\/\/pcool.dyndns.org\/index.php\/wp-json\/wp\/v2\/media?parent=69"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}