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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!