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()
Write R code to perform the following: (a) Sum a matrix over all the columns using apply() (b) Convert strings in a vect
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am