Question

R-Studio (R Programming Language) 5. Create and store a sequence of values from 6 to -8...

R-Studio (R Programming Language)

5. Create and store a sequence of values from 6 to -8 that progresses in steps of 0.4, name it `xseq`


```{r}
#insert your code
```

6. reverse the order of `xseq` using `sort` function.


```{r}
#insert your code
```

7. Repeat the vector `c(-1,2,-3,4,-5)` twice, with each element repeated 7 times, and store the result in `xrep`.
Display the result sorted from largest to smallest.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

5 ANS

xseq <- seq(6,-8, by =- 0.4)

print(xseq)

6 ANS

xseq <- seq(6,-8, by =- 0.4)

yseq <- sort(xseq,decreasing = FALSE)
  
print(yseq)

7 ANS

xrep <- rep(c(-1,2,-3,4,-5),times = 2, each = 7)
# To repeat vector twice, we used times = 2 in rep function
#To repeat values 7 times, we used each = 7 in rep function

sort (xrep,decreasing = TRUE)
# To sort and print in descending order

Add a comment
Know the answer?
Add Answer to:
R-Studio (R Programming Language) 5. Create and store a sequence of values from 6 to -8...
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
  • R-Studio (R Programming Language) 9. The conversion from a temperature measurement in degrees Fahrenheit F to...

    R-Studio (R Programming Language) 9. The conversion from a temperature measurement in degrees Fahrenheit F to Celsius C is performed using the following equation `C = 5/ 9 (F - 32)` Use vector-oriented behavior in R to convert the temperatures `45, 77, 20, 19, 101, 120, and 212` in degrees Fahrenheit x_fahren` to degrees Celsius `x_cel`. ```{r} #insert your code ``` 10. Use the function `paste` to create the following character vectors of length 25: `("label 1", "label 2", .....,...

  • Assignment #2: List - Array Implementation Review pages 6-7 in "From Java to C++" notes. Due...

    Assignment #2: List - Array Implementation Review pages 6-7 in "From Java to C++" notes. Due Friday, February 9th, 2017 @ 11:59PM EST Directions Create a List object. Using the following definition (List.h file is also in the repository for your convenience) for a list, implement the member functions (methods) for the List class and store the implementation in a file called List.cpp. Use an array to implement the list. Write the client code (the main method and other non-class...

  • Assembly Language Programming Assignment program must be in: MASM assembly language / x86 architecture / irvine...

    Assembly Language Programming Assignment program must be in: MASM assembly language / x86 architecture / irvine library procedures Objectives: 1. using register indirect addressing 2. passing parameters 3. generating “random” numbers 4. working with arrays Description: Write and test a MASM program to perform the following tasks: 1. Introduce the program. 2. Generate ARRAYSIZE random integers in the range [LO = 10 .. HI = 29], storing them in consecutive elements of an array. ARRAYSIZE should be set to 200....

  • PLEASE HELP!!! C PROGRAMMING CODE!!! Please solve these functions using the prototypes provided. At the end...

    PLEASE HELP!!! C PROGRAMMING CODE!!! Please solve these functions using the prototypes provided. At the end please include a main function that tests the functions that will go into a separate driver file. Prototypes int R_get_int (void); int R_pow void R Jarvis int start); void R_fill_array(int arrayll, int len); void R_prt_array (int arrayl, int len) void R-copy-back (int from[], int to [], int len); int R_count_num (int num, int arrayll, int len) (int base, int ex) 3. Build and run...

  • CSC 142 Music Player You will complete this project by implementing one class. Afterwards, your program...

    CSC 142 Music Player You will complete this project by implementing one class. Afterwards, your program will play music from a text file. Objectives Working with lists Background This project addresses playing music. A song consists of notes, each of which has a length (duration) and pitch. The pitch of a note is described with a letter ranging from A to G.   7 notes is not enough to play very interesting music, so there are multiple octaves; after we reach...

  • please help fill out the class menu create a prototype that will display information about housing...

    please help fill out the class menu create a prototype that will display information about housing data1. In this prototype you will use dynamic array data structures to store the data and compute metrics. For the requirements of the prototype, your client has given you a list of metrics and operations. The user interface will be a menu that displays this list and prompts the user to choose which option to execute.You will create two classes. First you will create...

  • Use the C programming language to complete #include <stdio.h> #include <stdlib.h> #include <float.h> // Declare Global...

    Use the C programming language to complete #include <stdio.h> #include <stdlib.h> #include <float.h> // Declare Global variables here. void array_stats() { // Insert your solution here. } #include <stdlib.h> #include <time.h> int main() { // Simulate the test setup process. srand( time( NULL ) ); for ( int i = 0; i < 32; i++ ) { val[i] = rand(); } val_count = rand(); val_mean = rand(); val_min = rand(); val_max = rand(); // Call submitted code. array_stats(); // Display...

  • Using Merge Sort: (In Java) (Please screenshot or copy your output file in the answer) In...

    Using Merge Sort: (In Java) (Please screenshot or copy your output file in the answer) In this project, we combine the concepts of Recursion and Merge Sorting. Please note that the focus of this project is on Merging and don't forget the following constraint: Programming Steps: 1) Create a class called Art that implements Comparable interface. 2) Read part of the file and use Merge Sort to sort the array of Art and then write them to a file. 3)...

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