Page 1 of 1

Write R code to perform the following: (a) Sum a matrix over all the columns using apply() (b) Convert strings in a vect

Posted: Sat Jul 09, 2022 11:49 am
by answerhappygod
Write R code to perform the following:
(a) Sum a matrix over all the columns using apply()
(b) Convert strings in a vector from lower case to upper case using lapply)
(c) Find number of characters in each string in a vector using sapplyO
(d) Find the sum of first elements, second elements upto last elements across
three vectors using mapply()
(e) In iris dataset, Species is a factor with 3 values namely Setosa, versicolor and virginica. Find the mean of sepal lengthofthese 3 species(subsets) using tapply()