The following R code sorts each vector in a list (lst) and stores the new list in lst1. The code uses a for loop.
lst <-
list(c1=sample(1:10,10,replace=TRUE),c2=sample(1:20,10,replace=TRUE),c3=sample(1:10,8,replace=TRUE))
lst1 <- list()
for(i in 1:length(lst))
{
lst1[[i]] <- sort(lst[[i]])
}
lst1
Which of the following options does the same thing as the given R code above ?
|
lst <-
list(c1=sample(1:10,10,replace=TRUE),c2=sample(1:20,10,replace=TRUE),c3=sample(1:10,8,replace=TRUE)) |
||
|
lst <-
list(c1=sample(1:10,10,replace=TRUE),c2=sample(1:20,10,replace=TRUE),c3=sample(1:10,8,replace=TRUE)) |
||
|
None of the given options |
||
|
lst <-
list(c1=sample(1:10,10,replace=TRUE),c2=sample(1:20,10,replace=TRUE),c3=sample(1:10,8,replace=TRUE)) |
5 points
QUESTION 2
Match the R code on the left (with loop) to its equivalent one (without loop) on the right.
|
|
15 points
QUESTION 3
Match the R code with the value of x
(Here: try to work out the solution with hand and double check by running the code. Don't just run the code and get the answer without understanding the logic)
|
|
20 points
QUESTION 4
The following R code extracts the unique items in each vector in a list (lst) and stores the new list in lst1. The code uses a for loop.
lst <-
list(c1=sample(1:10,10,replace=TRUE),c2=sample(1:20,10,replace=TRUE),c3=sample(1:10,8,replace=TRUE))
lst1 <- list()
for(i in 1:length(lst))
{
lst1[[i]] <- unique(lst[[i]])
}
lst1
Which of the following options does the same thing as the given R code above ?
|
lst <-
list(c1=sample(1:10,10,replace=TRUE),c2=sample(1:20,10,replace=TRUE),c3=sample(1:10,8,replace=TRUE)) |
||
|
lst <-
list(c1=sample(1:10,10,replace=TRUE),c2=sample(1:20,10,replace=TRUE),c3=sample(1:10,8,replace=TRUE)) |
||
|
None of the given options |
||
|
lst <-
list(c1=sample(1:10,10,replace=TRUE),c2=sample(1:20,10,replace=TRUE),c3=sample(1:10,8,replace=TRUE)) |
5 points
Click Save and Submit to save and submit. Click Save All Answers to save all answers.
In: Computer Science
Cruz Company has gathered the information needed to complete its Form 941 for the quarter ended September 30, 2019. They are a monthly depositor with the following monthly tax liabilities for this quarter:
| July | $7,193.10 |
| August | 7,000.95 |
| September | 7,577.78 |
State unemployment taxes are only paid to California. The company does not use a third-party designee, the tax returns are signed by the president, Carlos Cruz (Phone: 916-555-9739), and the date filed is October 31, 2019.
Complete Parts 2, 4, and 5 of Form 941 for Cruz Company for the third quarter of 2019.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
In: Accounting
Our class has 37 students.
i. Without any calculations, what would you guess is the chance that two people in our class share the
same birthday? In other words, do you think it is likely that two people share a birthday?
ii. How many possible pairs of students are there?
iii. What is the probability that any random pair of students has the same birthday?
iv. What is the probability that all of the pairs have different birthdays?
v. So, what is the probability that there is at least one shared birthday in our class?
In: Statistics and Probability
The data set “UCBAdmissions” in R contains admission decisions by gender at six departments of UC Berkeley. For this data set, carry out appropriate test for independence between the admission decision and gender for each of the departments.
What are your conclusions? Please submit your R script with the answer.
In: Statistics and Probability
Mr. Wimberly engages students in small-group work and in whole-class instruction. List and explain reasons why you think Mr. Wimberly groups students for some activities and not for all activities?
In: Psychology
Lung cancer is the second most common cancer among men and women in the USA. You are hired as a manager-planner by one of the hospitals. The organization is interested in establishing a community outreach program promoting smoking cessation and lung cancer screening. The Board of Directors requested your services in processing the data collected through the prospective cohort study among male and female population visiting local gym. The data set is attached. Please use Excel or Epi Info to process the data. Chose the correct epi tool, provide a graphic representation of the processed data set and offer a conclusion as to the causative relationship between smoking and death. List the potential biases and provide a recommendation as to the study validity and reliability. Inform the Board of Directors (and your peers) about your findings.
In: Nursing
Create a structure array that contains the following information fields concerning the road bridges in a town: bridge location, maximum load (tons), year built, year due for maintenance. Then enter the following data into the array:

In: Mechanical Engineering
Preventing the construction of amino acid cross-bridges between peptidoglycan chains is the mechanism of action of the _____________________________ antibacterial drugs.
Question 38 options:
|
Beta lactams (penicillins) |
|
|
Aminoglycosides |
|
|
Imidazoles (Azoles) |
|
|
Tetracyclines |
|
|
Nucleotide analogues |
In: Biology
Q1: Constraint:
Use concept of dynamic allocation for implementation
Statement:
In a class there are N students. All of them have appeared for the
test. The teacher evaluated
the test and noted marks according to their roll numbers. Marks of
each students has to be incremented
by 5. Print list of marks of students before and after
increment.
In: Computer Science
The VA-TX Company is going to present a new product in Santa Clara,California.In this event,VA-TX will present a seminar with a coffee break. The auditorium’s capacity is 500 people. The cost of renting the place is $4000/day, utilities included. Moreover, the cost of the food and drinks is $5 per person. After some other experiences, the company knows that 50% of the audience buys its product, which is priced at $75. Is Santa Clara a profitable place to do this kind of campaign? Need the answer in excel form please.
In: Finance