Question

Please give me the R code for the following questions. Create a variable named x1 which...

  • Please give me the R code for the following questions.
    • Create a variable named x1 which contains five equally spaced numbers. You may NOT use the c() function to do this.
    • Find the mean of all elements of x1 except the second.
    • Create a list My.List where the first list element is a two-column data frame containing x1 and the vector [2, 1, 4, 7, 8], and the second list element is the logical vector [T, F, NA, T, F].
    • Use the lapply() function to add elementwise the 2 columns of the first element in My.List
0 0
Add a comment Improve this question Transcribed image text
Answer #1

`Hey,

Note: If you have any queries related the answer please do comment. I would be very happy to resolve all your queries.

1&2)

x1=seq(from = 1, to = 5)
print("X1 is");
print(x1);
M=mean(x1);
print("Mean is");
print(M);

Note: Brother According to Chegg's policy we are only allowed to answer first 2 part if there are many. So, I request you to post other part as separate posts

Kindly revert for any queries

Thanks.

Add a comment
Know the answer?
Add Answer to:
Please give me the R code for the following questions. Create a variable named x1 which...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • using matlab Create the following matrix B. [18 17 16 15 14 13] 12 11 10...

    using matlab Create the following matrix B. [18 17 16 15 14 13] 12 11 10 9 8 7 6 5 4 3 2 1 Use the matrix B to: (a) Create a six-element column vector named va that contains the elements of the second and fifth columns of B. (6) Create a seven-element column vector named vb that contains elements 3 through 6 of the third row of B and the elements of the second column of B. Create...

  • 4. Create a variable N that is a column vector with seven equally spaced elements in...

    4. Create a variable N that is a column vector with seven equally spaced elements in which the first element is 44 and the last element is 23. 5. Create the following three row vector: a=[5 8-10 2], b=[4 19 -2 3], and c=[-35 06 1]. a) Use the three vectors in Matalb command to creat 3x5 matrix in which the rows are the vectors c, b and a, respectively. b) Use the three vectors in a Matalb command to...

  • Problem 5 Create the following matrix by typing elements explicitly one command. Do not type individual...

    Problem 5 Create the following matrix by typing elements explicitly one command. Do not type individual 0 00 0 0 o o 0 0 0 0 0 1 2 3 F=0 01 10 20 0 0 2 8 26 0 0 3 6 32 E 0 045 6 0 0 7 8 9 Problem 6 Create two row vectors: a -4 10 0.5 1.8 -2.3 7, b [0.7 9 -53-0.6 12 (a) Use the two vectors in a MATLAB command...

  • Please help me with writing this code, it's R. Summarizing data 11 Now that you've seen...

    Please help me with writing this code, it's R. Summarizing data 11 Now that you've seen the function sapply() , you'll practice writing your own functions to apply! The first step is defining a function that ouputs summary statistics. Packaging common operations into functions allows you to avoid repeating yourself. To define your own function in R, you'll use the syntax function_name <- function(args, more_args) { } where the is replaced with whatever operations using args and more_args you want...

  • Please Provide me all Necessary Screenshot with copy able code. Thanks Write a scheme function named...

    Please Provide me all Necessary Screenshot with copy able code. Thanks Write a scheme function named up-to-first-number that takes a list as its input and returns a list containing all the elements up to the first numeric element in the input list. You can use the number? predicate function to determine whether an element is a number or not. Sample runs: (up-to-first-number '(a b c d 1 2 3 )) returns (a b c d) (up-to-first-number '(d e f 7))...

  • Open BlueJ and create a new project (Project->New Project...). Create a new class named ListsDemo. Open the source code and delete all the boilerplate code. Type in the code to type (code to type...

    Open BlueJ and create a new project (Project->New Project...). Create a new class named ListsDemo. Open the source code and delete all the boilerplate code. Type in the code to type (code to type with bigger font) exactly as shown, filling in your name and the date in the places indicated. The code is provided as an image because you should type it in rather than copy-paste. If you need the code as text for accessibility, such as using a...

  • Plz help me with the code. And here are the requirement. Thanks!! You are required to...

    Plz help me with the code. And here are the requirement. Thanks!! You are required to design and implement a circular list using provided class and interface. Please filling the blank in CircularList.java. This circular list has a tail node which points to the end of the list and a number indicating how many elements in the list. And fill out the blank of the code below. public class CircularList<T> implements ListInterface<T> { protected CLNode<T> tail; // tail node that...

  • Create a Java code that includes all the methods from the Lecture slides following the ADTs...

    Create a Java code that includes all the methods from the Lecture slides following the ADTs LECTURE SLIDES Collect/finish the Java code (interface and the complete working classes) from lecture slides for the following ADTS: 4) Queue ADT that uses a linked list internally (call it LQueue) Make sure you keep the same method names as in the slides (automatic testing will be performed)! For each method you develop, add comments and estimate the big-O running time of its algorithm....

  • Question 1. Show the correct jQuery code for each of the following UI tasks: a) Select...

    Question 1. Show the correct jQuery code for each of the following UI tasks: a) Select all elements with class="name" and give each of them a unique id in the form "name-0", "name-1", "name-2"… and so on b) Anytime an element with class="trackClick" is clicked (using the "click" event), output the text "element clicked" to the console (using console.log()). This must work for all present and future elements with the class "trackClick". Question 2. Assume that there is only one...

  • Matlab code assistance - task 1 and 6 I think I am right and just need...

    Matlab code assistance - task 1 and 6 I think I am right and just need to be pointed in the right direction if I should change anything %% Task 1 % create the 3 row vectors shown in Ex 8 using 3 different approaches Ex 8 = using the colon operator and also the linspace function, create the following row vectors -5 -4 -3 -2 -1 5 7 9 8 6 4 % 1. list the values explicitly (square...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT