{"id":661,"date":"2016-05-19T12:53:20","date_gmt":"2016-05-19T02:53:20","guid":{"rendered":"http:\/\/thetravellerslastjourney.com\/shai\/first-impressions-of-r"},"modified":"2019-08-05T09:31:53","modified_gmt":"2019-08-05T09:31:53","slug":"first-impressions-of-r","status":"publish","type":"post","link":"https:\/\/thetravellerslastjourney.com\/shai\/2016\/05\/19\/first-impressions-of-r\/","title":{"rendered":"First impressions of R"},"content":{"rendered":"<p style=\"text-align: justify;\">I&#8217;ve only been studying R<a href=\"#_ftnI\" name=\"_ftnrefI\"><sup>[I]<\/sup><\/a> for a few weeks. It&#8217;s my second programming language, and I&#8217;m only a beginner at my first &#8211; python.<\/p>\n<p style=\"text-align: justify;\">R is strangely strange. It looks a bit like java with all its brackets, but then goes and uses &#8220;&lt;-&#8221; for designating variables, as if the universal &#8220;=&#8221; wasn&#8217;t good enough. In my accumulation of anecdotal evidence, I explain some of these superficial characteristics as effects of the R&#8217;s creation ethos: be a language for non-programmer statisticians, whilst allowing them to use it as a sophisticated language relative to their position on the learning curve.<\/p>\n<p style=\"text-align: justify;\">I&#8217;m sure there are many differences but a few have stood out more than others to these eye&#8217;s first impression:<\/p>\n<p style=\"text-align: justify;\">(A) Writing in R is more dynamic. You can kinda write some variables and functions, and then run them, thereby loading them into the environment. Once they&#8217;re in the environment you can keep playing with them, going back and forth between the code and the shell, perhaps re-running a function if it has been edited, so as to update its reference in the environment.<\/p>\n<p style=\"text-align: justify;\">(B) R doesn&#8217;t have objects. But it has functions that act like objects. Technically they&#8217;re S3 and S4 objects, but from my perspective, it seems to depend on some memory disposal hijinks. In R, function return their last statement, and their internal variables normally thereafter destroyed. But if the returning statement of a function contains pointers\u00a0to variables within the function, then the memory is not recycled, and the internal variables (including functions) can be referenced as if that function were an object.<\/p>\n<p style=\"text-align: justify;\">(C) The variable types are different. There are still character, boolean, and numeric variable types, but arrays are now organized depending on the uniformity of a set&#8217;s data types &#8211; in which case it can form a vector, or else a list, which can be labelled in the manner of a dictionary. The common use of vectors vs lists vs data.frames and the implications and translation from one to the other is very different from Python where typing is often (not always) ignored.<\/p>\n<p style=\"text-align: justify;\">(D) Some of the argument parameters in R seem confusingly flexible. The most obvious instance of this is the use of data.frame filter() that can accept a literal name of column (e.g. name_of_col), or a literal column (e.g. [df[[name_of_col]). This confuses me because its not clear when and how keyword arguments are identified, and when an optional keyword argument can use a variable name (e.g. in the case of conditions when using subset() to test a column name identified by a variable). My thinking at this stage is that it may not matter, that it may have to do with scoping rules (which are different in R to python) and that it may have to do with mechanics of the magic that occurs behind the scenes.<\/p>\n<p style=\"text-align: justify;\"><div class=\"su-divider su-divider-style-dotted\" style=\"margin:15px 0;border-width:2px;border-color:#2341f8\"><\/div>\n<p style=\"text-align: justify;\"><sup><a href=\"#_ftnrefI\" name=\"_ftnI\">[I]<\/a>\u00a0<em>&#8220;<span style=\"font-size: 12pt;\"><strong>R<\/strong>\u00a0is a\u00a0programming language\u00a0and\u00a0free\u00a0software environment for\u00a0statistical computing\u00a0and graphics supported by the R Foundation for Statistical Computing. The R language is widely used among\u00a0statisticians\u00a0and\u00a0data miners\u00a0for developing\u00a0statistical software and\u00a0data analysis&#8221;. For further details see\u00a0<a href=\"https:\/\/en.wikipedia.org\/wiki\/R_(programming_language)\">https:\/\/en.wikipedia.org\/wiki\/R_(programming_language)<\/a>.<\/span><\/em><\/sup><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve only been studying R[I] for a few weeks. It&#8217;s my second programming language, and I&#8217;m only a beginner at my first &#8211; python. R is strangely strange. It looks a bit like java with all its brackets, but then goes and uses &#8220;&lt;-&#8221; for designating variables, as if the universal &#8220;=&#8221; wasn&#8217;t good enough. [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[159,134,90,108,106],"tags":[132,123,144],"metadata":[],"class_list":["post-661","post","type-post","status-publish","format-standard","hentry","category-all-posts","category-autodidactic","category-blog-posts","category-observations","category-the-traveller-is-the-journey","tag-learning","tag-programming","tag-r"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack-related-posts":[{"id":198,"url":"https:\/\/thetravellerslastjourney.com\/shai\/2015\/12\/10\/early-progress-in-python\/","url_meta":{"origin":661,"position":0},"title":"Early progress in Python","author":"Pala","date":"December 10, 2015","format":false,"excerpt":"In a reality and society that are predicated and empowered by numbers, logic, and their interactions, it is enticing to the explorer to research and learn these domains of knowledge and practice. By learning to program I expect to discover many unknown unknowns. By learning to program I also hope\u2026","rel":"","context":"In &quot;All Posts&quot;","block_context":{"text":"All Posts","link":"https:\/\/thetravellerslastjourney.com\/shai\/all-posts\/"},"img":{"alt_text":"python","src":"https:\/\/travelleristhejourney.files.wordpress.com\/2015\/12\/python.jpg?w=350&h=200&crop=1","width":350,"height":200},"classes":[]},{"id":1123,"url":"https:\/\/thetravellerslastjourney.com\/shai\/2016\/08\/08\/personal-statement-rmit-2016\/","url_meta":{"origin":661,"position":1},"title":"Personal Statement RMIT 2016","author":"Pala","date":"August 8, 2016","format":false,"excerpt":"To whom it may concern, A personal statement is not mandatory for my application to a Masters in Analytics but is an opportunity for me to advertise my interest and relevant experience. This letter will comprise a quasi-biographical form since that is the easiest medium for expressing and communicating my\u2026","rel":"","context":"In &quot;All Posts&quot;","block_context":{"text":"All Posts","link":"https:\/\/thetravellerslastjourney.com\/shai\/all-posts\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":802,"url":"https:\/\/thetravellerslastjourney.com\/shai\/2016\/03\/17\/learning-to-make-a-game\/","url_meta":{"origin":661,"position":2},"title":"Learning to make a game","author":"Pala","date":"March 17, 2016","format":false,"excerpt":"Last November I started learning to code python[I]. In 5 weeks I hope to have finished creating a card game. Learning python Briefly: codecadamey, Learn Python The Hard Way, The Python Game Book, Foundations in Python Networking, reddit, stackexchange, python standard library documentation, prolog challenges, codewars, checkio. A review of\u2026","rel":"","context":"In &quot;All Posts&quot;","block_context":{"text":"All Posts","link":"https:\/\/thetravellerslastjourney.com\/shai\/all-posts\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":583,"url":"https:\/\/thetravellerslastjourney.com\/shai\/2016\/04\/01\/a-map-to-a-first-stage-of-learning-python\/","url_meta":{"origin":661,"position":3},"title":"A map to a first stage of learning python","author":"Pala","date":"April 1, 2016","format":false,"excerpt":"The atlas is filled with maps, and the roads twist and turn around short-cuts and panoramic views. Here is the advice of a singular traveller, still a beginner. Where this begins This begins where I did. Knowing about programming, and knowing a little about how to program. About 7 years\u2026","rel":"","context":"In &quot;All Posts&quot;","block_context":{"text":"All Posts","link":"https:\/\/thetravellerslastjourney.com\/shai\/all-posts\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2689,"url":"https:\/\/thetravellerslastjourney.com\/shai\/2013\/11\/19\/tuesday-november-19-2013\/","url_meta":{"origin":661,"position":4},"title":"Tuesday November 19, 2013","author":"Pala","date":"November 19, 2013","format":false,"excerpt":"Here are some things that I wrote. Project \"Project\" [Here I am describing an intention to focus activities by categories defined as projects]. A project can be anything and there can be any number, but practical considerations will double as reasonable constraints in both those instances. A study of a\u2026","rel":"","context":"In &quot;All Posts&quot;","block_context":{"text":"All Posts","link":"https:\/\/thetravellerslastjourney.com\/shai\/all-posts\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2697,"url":"https:\/\/thetravellerslastjourney.com\/shai\/2013\/11\/25\/monday-november-25-2013\/","url_meta":{"origin":661,"position":5},"title":"Monday November 25, 2013","author":"Pala","date":"November 25, 2013","format":false,"excerpt":"\"Now\" keeps changing, leading me to doubt whether it ever is. Contents: Philosopher Brief: Christian Wolff - Take 3\u00a0 Diary: Studying Java and Wibit on programming\u00a0 Some words on Scaruffi: Gaining perspective on chapter 4 - Part 2 Philosopher Brief: Christian Wolff - Take 3 Meta: Title notwithstanding, and long-story\u2026","rel":"","context":"In &quot;All Posts&quot;","block_context":{"text":"All Posts","link":"https:\/\/thetravellerslastjourney.com\/shai\/all-posts\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/padotI-aF","_links":{"self":[{"href":"https:\/\/thetravellerslastjourney.com\/shai\/wp-json\/wp\/v2\/posts\/661","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thetravellerslastjourney.com\/shai\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thetravellerslastjourney.com\/shai\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thetravellerslastjourney.com\/shai\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/thetravellerslastjourney.com\/shai\/wp-json\/wp\/v2\/comments?post=661"}],"version-history":[{"count":0,"href":"https:\/\/thetravellerslastjourney.com\/shai\/wp-json\/wp\/v2\/posts\/661\/revisions"}],"wp:attachment":[{"href":"https:\/\/thetravellerslastjourney.com\/shai\/wp-json\/wp\/v2\/media?parent=661"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thetravellerslastjourney.com\/shai\/wp-json\/wp\/v2\/categories?post=661"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thetravellerslastjourney.com\/shai\/wp-json\/wp\/v2\/tags?post=661"},{"taxonomy":"metadata","embeddable":true,"href":"https:\/\/thetravellerslastjourney.com\/shai\/wp-json\/wp\/v2\/metadata?post=661"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}