Using R, can ANYONE help with the last 2 questions ? I need the functions for qu
ID: 3737425 • Letter: U
Question
Using R, can ANYONE help with the last 2 questions ? I need the functions for question 9 and 10 given the arguments that have to be passed into the functions...
9) calcFinalGrades <- function(df,assessmentTypeWeights); This function returns a vector that contains the final grades for all the students.
10) writeReport <- function(df,finalGradesVector,fileName). This function adds a new column (grade) to df and then writes the updated data frame to a file whose name is given by filename.
given:
assessmentTypeWeights <- c(5,15,5,3,2,10,10,10,40)
names(assessmentTypeWeights) <-c("quiz","hw","term1","term2","term3","exam1",
"exam2","exam3","final")
here is the image of th data:
inal 100 100 100 100 hws 25 hw1 hw2 15 23 16 100 100 16 100 25Explanation / Answer
R> functionReturningTwoValues <- function() { return(c(1, 2)) } R> functionReturningTwoValues() [1] 1 2 R> a, b <- functionReturningTwoValues() Error: unexpected ',' in "a," R> c(a, b) <- functionReturningTwoValues() Error in c(a, b) <- functionReturningTwoValues() : object 'a' not R> r <- functionReturningTwoValues()
R> a <- r[1]; b <- r[2]
R> functionReturningTwoValues <- function() {return(list(first=1, second=2))} R> r <- functionReturningTwoValues() R> r$first [1] 1 R> r$second [1] 2
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.