Lab 2: Means and Beyond- More Descriptive Statistics, Defining and Making Your Own Functions That Can be Reused, and Using R Packages + Lab 3: Confidence Interval of a Proportion Flashcards
Can the letter c be used both as a built-in R function and object?
YES
What will determine whether the letter c is used a built-in R function or as an object?
Its location in the code!
- If it precedes the arrow, it's being defined as an object - If it comes after the arrow, it's being used as a built-in R function
If you define an object and then try to define it again with the same letter, what will happen? How would this effect the mean/median
- That object will be overwritten and will now be replaced/ contain the new data set.
- The mean/ median will change to be representative of the new data set
An object is always determined by what?
Its newest definition
What are two ways in which an exponent can be inputted into R?
Using either the carrot(EX: 10^5) or e method (1e+5) with positive (+) numbers
What are two ways in which an exponent can be inputted into r?
Using either the carrot(EX: 10^5) or e method (1e+5) with negative (-) numbers
If there is no built-in R function for performing certain statistical analyses, what can you do?
Either define your own R function or download reproducible codes in some fundamental units made by other people called R packages.
What is another good way to think of an R package?
Like an extra toolbox that contains a variety of tools to add to built- in tools that come with base R
Do people usually upload the packages they developed and share them with all R users?
YES
What are the two ways in which we can install an R package?
Type in the R command or use the pull- down manual
What is the function you should use to install an R package?
install. packages(“ “)
- With a lowercase i and packages being plural
What are the “CRAN mirrors?”
Mirror sites with the repositories of the package
What will happen if you try to install a package into base R using command lines and what do you have to do?
The “CRAN mirrors” window will pop up and you’ll have to scroll down and highlight to select “USA (PA 1)” to install?
What will happen if you try to install a package into the code editor R Studio using command lines and what do you have to do?
The “CRAN mirrors” window will NOT pop up and you won’t have to do anything else, as the package will automatically be installed after hitting enter/return.
How do you install an R package in base R, using the pull- down manual?
Follow the selection: “Packages”-> Install Package(s)-> select “raster”
How do you install an R package in base R, using the pull- down manual?
- There is a tab named “Packages” in the lower-right quadrant/panel, click it
- Click “install”
- In the pop-up window, type “raster” in the space below the sentence that reads “Packages separate multiple with space or comma)”
- Click “install”
What function must you use to activate a newly installed R package?
library(name of package) with a lowercase l and NO QUOTATION MARKS
If you stay in the same R session, do you need to reactive the newly installed R package before using it again?
NO
If you close and restart a new R session, do you need to reactivate the newly installed R package before attempting to use it again?
YES
What package are the geometric and harmonic mean function found in?
The “psych” package
What package is the coefficient of variation function found in?
The “raster” package
What function would you use to find the geometric mean?
geometric.mean( )