Personal blog written from scratch using Node.js, Bootstrap, and MySQL. https://jrtechs.net
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
2.5 KiB

  1. R is a programming language designed for statistical analysis and
  2. graphics. Since R has been around since 1992, it has developed a large
  3. community and has over [13 thousand
  4. packages](https://cran.r-project.org/web/packages/) publicly
  5. available. What is really cool about R is that it is an open source
  6. [GNU](http://www.gnu.org/) project.
  7. # R Syntax and Paradigms
  8. The syntax of R is C esk with its use of curly braces. The type
  9. system of R is similar to Python where it can infer what type you are
  10. using. This "lazy" type system allows for "faster" development since
  11. you don't have to worry about declaring types -- this laziness makes
  12. it harder to debug and read your code. The type system of R is rather
  13. strange and distinctly different from most other languages. For
  14. starters, integers are represented as vectors of length 1. These
  15. things may feel weird at first, but, R's type system is one of the
  16. things that make it a great tool for manipulating data.
  17. ![R Arrays Start at 1](media/r/arrays.jpg)
  18. Did I mention that arrays start at 1? Technically, the thing which we
  19. refer to as an array in Java are really vectors in R. Arrays in R are
  20. data objects which can store data in more than two dimensions. Since R
  21. tries to follow mathematical notation, indexing starts at 1 -- just
  22. like in linear algebra. Using zero based indexing makes sense for
  23. languages like C because the index is used to get at a particular
  24. memory location from a pointer.
  25. <youtube src="s3FozVfd7q4" />
  26. I don't have the time to go over the basic syntax of R in a single
  27. blog post; however, I feel that this youtube video does a pretty good
  28. job.
  29. # R Markdown
  30. One of my favorite aspects of R is its markdown language called Rmd.
  31. Rmd is essentially markdown which has can have embedded R scripts run
  32. in it. The Rmd file is compiled down to a markdown file which is
  33. converted to either a PDF, HTML file, or a slide show using pandoc.
  34. You can provide options for the pandoc render using a YAMAL header in
  35. the Rmd file. This is an amazing tool for creating reports and writing
  36. research papers. The documents which you create are reproducible since
  37. you can share the source code to it. If the data which you are using
  38. changes, you simply have to recompile to document to get an updated
  39. view. You no longer have to re-generate a dozen graphs and update
  40. figures and statistics across your document.
  41. # Resources
  42. - [R for Data Science (Online Book)](https://r4ds.had.co.nz/)
  43. - [R Studio](https://www.rstudio.com/)
  44. - [R Official Website](https://www.r-project.org/)