Question
Please solve in R programing language. (1) Given a list X of integers, produce a list Y, whose ith member is 1 or 0 depending
Please solve in R programing language.
(1) Given a list X of integers, produce a list Y, whose ith member is 1 or 0 depending on whether the ith member of X is positive.
(2) Given a list whose every member is either an integer or a string, find how many members of the list are integers.
(3) Given a list whose every member is a list of integers, produce a vector containing the means of the member lists.
(4) Assume we have a vector of 3-letter initials and 2-letter initials, where the letters are separated by spaces. Write a command in R to extract the last initial of each vector component.
Example: For y <- c("J F K", "P Q R", "A B", "S T L", "P L")
the answer should be : "K" "R" "B" "L" "L"
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started