The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Jul 2017 |
| Last Sign in: | 304 Weeks Ago, 5 Days Ago |
| Questions Answered: | 15833 |
| Tutorials Posted: | 15827 |
MBA,PHD, Juris Doctor
Strayer,Devery,Harvard University
Mar-1995 - Mar-2002
Manager Planning
WalMart
Mar-2001 - Feb-2009
Need this answered in R, I need this in a R studio
Managing and Understanding Data (Class Exercise)
R data structures:
1. Generate 3 student name, gender, gpa and grade vectors. You could use names such as "Henry Grant", "Amy Becker", "Bessie Kim"; use gender such as "male","female", "female"; use gpa such as 3.5, 3.7, 3.2; use grades such as "senior", "sophomore", "junior".
2. Access the gender of second student and access the first two students’ grades.
3. Change vector gender into a factor vector with levels female and male; also change vector grade into a factor vector with levels freshman, sophomore, junior and senior.
4. Create a data frame using student information you generated above with stringsAsFactors set to False; Display the data frame and see how many rows and how many columns does this data frame have?
5. Access student gpa column; get student name and grade by specifying a vector of names.
6. Access student information in row 1 and column 2. What is it?
7. Access student information in row 2 & column 3 and in row 3 & column 4 together using vectors. What does the output look like?
8. Output student information in column 2 (all rows), then in row 3 (all columns) and then all rows & all columns.
9. Create a 4*2 matrix M using characters from ‘a’ to ‘h’; Create a 3*3 matrix N usingcharacter from ‘a’ to ‘i’.
10. Extract values from matrix. What character in M do you have in row 2 and column 1? What character in N do you have in row 3 and column 2?
11. Extract the second row (all columns) of matrix M; extract the third column (all rows) of matrix N.
----------- Â ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly