MGG Exam 8 oct . 19/35 Questions and Answers A+ Ra
MGG Exam 8 oct . 19/35 Questions and Answers A+ Ra
MGG Exam 8 oct . 19/35 Questions and Answers A+ Ra
All documents for this subject (1)
Seller
Follow
Victorious23
Reviews received
Content preview
MGG Exam 8 oct . 19/35 Questions
and Answers A+ Rated
what does a conditional statement set - - first sets a condition, then a
consequent action
-condition
-action
-other
if(condition){
action statement
}else{
second action statement
}
- curly braces surround - - each action statement
- example of conditional statement with Bactcount - - 1. set up empty
vector to hold inputted values that conditional statement feeds
BactCount <- c()
2. load sample
Sample<- 110
- How do you test for more than one condition? - - use
else if
how do you show greater than or Equal to?
else if (120<=systolicData & systolicData < 130)
, this is asked if the number is greater than or equal to 120 AND less than 130
what do you use at the end of conditional statements
else
(for all other data that doesn't fit any of the other parameters)
- What does a For Loop allow you to do? - - lets you perform an action on
every element in your vector. You do this "interactively" or element by
element
you assign the element to a temporary variable and then use this variable in
the action statement
- how do you format a for loop? - - vector1 <- c(1,2,3,4,5)
for (i in vector1){
a<- 2*i
print(a)
}
prints all the numbers where the value was multiplied by 2 for each value in
the vector
-can do the same thing w BactCount example, only difference is load all
values into Samples
and then code is
for ( i in samples){
if .....
- what is a function? - - a function is a block of code that you can apply with
a single word no matter how long it is
example is R function "sum"
- How do you create your own functions? - - FunctionName <-
function(argument1, argument2, etc.){
block of code
}
block of code- usually something like
print(argument1/argument2)
this would be for the divide function since the arguments are dividing
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller Victorious23. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for $10.49. You're not tied to anything after your purchase.