{"id":1039,"date":"2025-02-28T20:07:39","date_gmt":"2025-02-28T20:07:39","guid":{"rendered":"https:\/\/adrianbell.me\/?p=1039"},"modified":"2025-02-28T20:07:39","modified_gmt":"2025-02-28T20:07:39","slug":"r","status":"publish","type":"post","link":"https:\/\/adrianbell.me\/?p=1039","title":{"rendered":"R"},"content":{"rendered":"\n<p>I've recently discovered how useful R is. Compared to Excel or Sheets it's a joy to use, especially if you're on Linux. Installing it is the tricky bit, there are a lot of dependencies. I'm on Linux Mint (Ubuntu\/Debian), so:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt-get install -y r-base-core libxml2-dev libcurl4-openssl-dev libssl-dev libfreetype6-dev libpng-dev libtiff5-dev libjpeg-dev libharfbuzz-dev libfribidi-dev<\/code><\/pre>\n\n\n\n<p>I know. There's a lot. But all of that will let you do the following and more...<\/p>\n\n\n\n<p>First, get this public csv file:<\/p>\n\n\n\n<div class=\"wp-block-file\"><a id=\"wp-block-file--media-911f7f28-3420-4bd4-aafb-25a0a239a83d\" href=\"https:\/\/adrianbell.me\/wp-content\/uploads\/2025\/02\/worksheet1.csv\">worksheet1<\/a><a href=\"https:\/\/adrianbell.me\/wp-content\/uploads\/2025\/02\/worksheet1.csv\" class=\"wp-block-file__button wp-element-button\" download aria-describedby=\"wp-block-file--media-911f7f28-3420-4bd4-aafb-25a0a239a83d\">Download<\/a><\/div>\n\n\n\n<p>In the folder with your new csv file, enter R with:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>R<\/code><\/pre>\n\n\n\n<p>Then from within this new R session, type the following to import your csv file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>work1 = read.csv(\"worksheet1.csv\", header = TRUE)<\/code><\/pre>\n\n\n\n<p>Now we'd like to see a histogram of the \"Wellbeing\" column, so:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>hist(work1$Wellbeing)<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I've recently discovered how useful R is. Compared to Excel or Sheets it's a joy to use, especially if you're on Linux. Installing it is the tricky bit, there are a lot of dependencies. I'm on Linux Mint (Ubuntu\/Debian), so: I know. There's a lot. But all of that will let you do the following &hellip; <a href=\"https:\/\/adrianbell.me\/?p=1039\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">R<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,50,49,15],"tags":[],"class_list":["post-1039","post","type-post","status-publish","format-standard","hentry","category-maths","category-r","category-software","category-statistics"],"_links":{"self":[{"href":"https:\/\/adrianbell.me\/index.php?rest_route=\/wp\/v2\/posts\/1039","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/adrianbell.me\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/adrianbell.me\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/adrianbell.me\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/adrianbell.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1039"}],"version-history":[{"count":1,"href":"https:\/\/adrianbell.me\/index.php?rest_route=\/wp\/v2\/posts\/1039\/revisions"}],"predecessor-version":[{"id":1041,"href":"https:\/\/adrianbell.me\/index.php?rest_route=\/wp\/v2\/posts\/1039\/revisions\/1041"}],"wp:attachment":[{"href":"https:\/\/adrianbell.me\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1039"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/adrianbell.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1039"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/adrianbell.me\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1039"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}