Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A. Create and store this data frame as dframe in your R workspace: person Stan Francine Steve Roger Hayley Klaus sex funny M High F

A. Create and store this data frame as dframe in your R workspace:

person

Stan Francine Steve Roger Hayley Klaus 

sex funny

M High F Med M Low M High F Med M Med

The variables person, sex, and funny should be identical in nature to the variables in the mydata object studied throughout Section 5.2. That is, person should be a character vector, sexshould be a factor with levels F and M, and funny should be a factor with levels Low, Med, and High.

  1. Stan and Francine are 41 years old, Steve is 15, Hayley is 21, and Klaus is 60. Roger is extremely old1,600 years. Append these data as a new numeric column variable in dframe called age.

  2. Use your knowledge of reordering the column variables based on column index positions to overwrite dframe, bringing it in line with mydata. That is, the first column should be person, the second column age, the third column sex, and the fourth column funny.

  3. Turn your attention to mydata as it was left after you included theage.mon variable in Section 5.2.2. Create a new version of mydatacalled mydata2 by deleting the age.mon column.

  4. Now, combine mydata2 with dframe, naming the resulting objectmydataframe.

Please answer the question as code that would be inserted into R

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

1. Organize and support your main points

Answered: 1 week ago

Question

3. Move smoothly from point to point

Answered: 1 week ago

Question

5. Develop a strong introduction, a crucial part of all speeches

Answered: 1 week ago