Snow Day Make Up Assignment(Cheng)

The course I chose was Foundations of Probability in R

The reason I choose Foundations of Probability in R is that it was a course starting with Chapter 2 when we were learning at that period of time. I could combine this online course with the course that I was taking in the class.  This course is base on the binomial distribution. In this course, I had to do find the normal, Poisson, and geometric distributions by using R Program. I can combine multiple probabilities, such as the probability two events both happen or that at least one happens, and confirm each with random simulations. also, I learned some of the properties of adding and multiplying random variables.

Snow-Day Make-up Assignment on DataCamp

Name: Rumana Hassin Syed

Course: Writing Functions in R.

I chose to do this course by trial and error. I saw the list given on the openlab page. I discarded the idea of doing General programming in R right away because I wanted to do something slightly more difficult. So I looked into other options like Making Reports using R. But soon realized I do not know R enough to do it. So I looked back into the general programming option and looked up the videos available for Intermediate R, Writing Functions in R and Data Visualization. For intermediate R, I thought it was very similar to what we have already done as homework during the semester, just the next level of it. I liked the concept of data visualization too, but I chose to do Writing Functions in R because I thought if functions are said to be the building blocks of R, I better start with the fundamentals and then go step by step from there to get better in R language.

Overall description of the course:

In this course I learnt that like most other programming languages I have been taught in my major classes like C/C++, Java, the fundamental building block for R language is also the Functions. And through this course I got to know more about these fundamental building blocks of R that will eventually help me make my code more readable, avoid coding errors, and automate repetitive tasks.

Following are the topics covered in the course

  • A quick refresher:¬† As the name suggest it was indeed a quick recollection of what we already know. This section of course reviews some of the basic thing like syntax and data types in R. Not only that it also introduced new concepts like writing loops and subsetting in R, that I was not aware of before.
  • When and how you should write a function: Again as the name suggests, this section of the course teaches you when and how to write functions in R efficiently.¬† From here I learnt that I should understand it is better to use a function when I have already copied and pasted a piece of code at least twice. This will not only save my time, but also reduces the chances of making silly errors and any update to the code could be made easily, i.e, if I have to make small change to the code, I have to make it only once unlike the other method where I have to change it as many times as I have copied and pasted.
  • Functional programming: In this sectional I learnt what is functional programming and why do we use it at all. I learnt how to use loop to avoid redundancy. Thereafter also learnt how to convert that loop into a function.
  • Advanced inputs and outputs: In this section of the course we deal with failure. I learnt to write safe functions in R. I learnt about functions that help with failure cases. These are listed below:
    • safely()¬†captures the successful result or the error, always returns a list
    • possible()¬†always succeeds, you give it a default value to return when there is an error
    • quietly()¬†captures printed output, messages, and warnings instead of capturing errors
  • Robust functions: In this section, I learnt about functions whose output was based on the input. Some of them are as follows:
    • df[, vars]
    • subset(df, x == y)
    • data.frame(x = "a")

Description of one topic:

For the detailed description of one topic, I choose to describe the Quick Refresher. Although I found the entire course to be really useful, I thought without this first section, where I got the heads up of what to expect and also reviewed some general topics, the entire course would be meaningless. It would only be a struggle to hunt for answers without understanding a thing. Thus I choose to elaborate more on it.

In the Quick Refresher the following topics were covered:

  • Writing a function
  • Arguments
  • Function output
  • Environments
  • Testing your understanding of scoping (1)
  • Testing your understanding of scoping (2)
  • Testing your understanding of scoping (3)
  • Data structures
  • Subsetting lists
  • Exploring lists
  • for loops

From this part I came to know that functions can be treated like usual R objects. I reviewed that a function is made up of three distinct parts, viz., Argument, the Body and the Environment. I knew about argument and the body but was not sure what is meant by the environment, which I learnt here for the first time. Following are some of the aspects of an environment:

  1. When a function is called a new environment is made for the function to do its work
  2. This new environment is populated with the argument values
  3. Objects are looked for first in this environment
  4. If they are not found they are looked for in the environment that the function was created in

I also learnt that Return value is the last evaluated expression or the first evaluated return() expression. This section also gave me a great review on Data Structures. I got to know The key properties of vectors are its type and the length and there are only two types of vectors in general: Atomic Vectors and Lists. However, Atomic Vectors is subdivided into 6 types namely logical, integer, double, character, complex, raw and List is also called a recursive vector because lists can contain other lists. Lists are very useful because they can contain heterogeneous objects. 

Although I often got stuck and had to get some help by looking things up, I admit that the entire course was worth taking and will be very useful in the long run.

Snow Day Makeup Assignment (Joel Colon)

I picked “Data Visualization in R” for my Datacamp makeup assignment. I chose this course because I plan to become a computer scientist, and because I hope enough about data science to become a data scientist. The first half of the course (I finished 3/5ths of the course) covered the making of many different types of graphs with provided datasets, and how to label and customize these graphs with many different customization parameters like “pch”, which determines the shape of icons used to mark data points. I think the course turned out to be a good starting point for me regarding the study of data science and the use of R to handle data. I got more comfortable with reading R documentation and with the programming syntax. I hope to apply the things I’ve learned in this course to my future studies!

(Joel Colon)

Snow Day Make Up Assignment Intermediate R

I selected Intermediate R as my make up assignment for the day we missed because of the snow storm. The reason I chose this course is because is close to what I’ve done and going to be doing in the future. Manipulating different function to get the result one is looking is something is done in the engineering world. We have to look in the unknown values and see and plot them to see the area of it. We also have to create a function to see if we can control the system or alter it to our own favor. The only difference is the fact we use MATLAB. MATLAB is like data camp but only difference is few different functions. But the idea and concept is the program is the same. I’m going to see if i could finish this course this summer. That is the general idea and understanding of this course.

Ariz Lezama

Snow Day Make Up Intermediate R

The course I chose was Visualization of data in R.

The reason  I chose this course was because I am a bit immersed in data science and the data visualization course provided many algorithms, tools and knowledge on how to organize unstructured data. These tools are of the utmost importance when it comes to data science.

I completed three chapters of the online course and I learned how to plot easy  data with R’s default graphics system to plot complex color graph using the advanced graphic system provided by the R studies.


Gabriel Martinez

Snow Day Makeup- R assignment (Alfaj)

I chose the course ‚Ä̬†Working with the RStudio IDE (Part 1)‚ÄĚ as the assignment and I will briefly go over some of the things I‚Äôve learned from this course.

There are many tabs and panes in Rstudio which can be a little complicated to be beginners. After getting through the basic installation and setup of the software, we quickly move on to learn different functions and codes in the Rstudio. By using examples we also learn the use of the many different tabs and their purpose.  This is as we are introduced different codes and programs. It is good to have the videos as we can go back and re-watch the videos if weren’t certain of the code or what it is asking for.

After completing the Orientation, we move onto programming in Rstudio. In the programming videos we are told about different features we can use in RStudio for programming including code diagnostics and and many keyboard shortcuts. We also learn sourcing scripts as well as finding errors and debugging the codes quickly.

Final Exam Review, with answers and partial solutions

The Final Exam Review problems are here:


The answers and partial solutions are here:


This is the 100% corrected version. Somehow the uncorrected version was the one posted to Piazza, and then Ned tried to fix it and only fixed one of the errors. Sorry about that!


The Final Exam will have only 9 problems: there is some repetition of material in these problems.

You will be provided with a table of critical values for \chi^{2}, since many of your calculators will not compute these for you.

You will be allowed to use one 8.5 by 11 inch sheet of paper containing FORMULAS ONLY, which you should start preparing while you work these problems. Below are my suggestions, but it is up to you to see what formulas you need to recall while working the problems. You sheet must be handed in along with the exam paper.


Bayes’ Theorem, and/or (even better) the two formulas below:

P(A\cap B) = P(A|B)P(B) and P(A\cap B) = P(B|A)P(A)

P(A) = P(A\cap B) + P(A\cap B')

The formulas for the  mean and standard deviations of the special probability distributions.

The formula for a confidence interval for the population mean, if the population standard deviation is known. (It uses Z)

The formula for a confidence interval for a population proportion

The formula for a confidence interval for a population variance


You may also want to include the syntax for computing the special probabilities on your calculator, if you tend to forget. For example, computing a normal probability on the TI-84 has the syntax:

normalcdf(lowerbound, upperbound, mu, sigma)


Snow day makeup R assignment

Baohua Huang

Foundations of Probability in R :

The reason I choose Foundations of Probability in R is because it gave a course in teaching us how to find the probability problems by using R. Some of the topics that are covered in this course are were helpful to the course that I am physically taking in school are the Binomial distribution, Laws of probability, and the Bayesian statistics. In this course, the topics in each section refreshes my memories in finding the expected values and variance in a binomial distribution, and the properties of finding the normal, Poisson, and geometric distributions by using R, which it can help me to solve homework problems faster, and easier.

Extra credit snow day assignment Intermediate to R(steven medina)

The reason as to why I chose Intermediate to R assignment is because it is the fundamental building blocks for R programming. In this tutorial we was able to learn about numerous instructions which are very similar to other programming languages such as C++. R language is very similar to other languages I have learned in my past such as C++ as mentioned before but also Javascript as well. This tutorial is perfect for anyone that wants to learn another programming language its very easy and breaks it down to the point it is very easy for the user to understand and comprehend what is going on even for a first time user learning to program I would definitely recommend it to a friend or colleague.

Snow Day Make Up Intermediate R Muhammad Ahmed

Intermediate R:

The reason I chose this course was because this was a continuation of a course we already took so it was easier to pick up and complete. Some of the commands and functions in this language are similar to the ones i knew from other languages I know (Javascript, etc). I have learned various things from this course such as comparing vectors in coding work and same with matrices. I learned that if and else statements are the same as in R as they are in javascript. Loops are also similar so they were not too difficult to do.¬† Although I don’t plan on using R after this class it is still good to have knowledge of another coding language.