In file 'R-Factor-Basics.docx', page 4, use the factor() command to modify the column dat$Group so that the control group is plotted last.

New Perspectives on HTML5, CSS3, and JavaScript
6th Edition
ISBN:9781305503922
Author:Patrick M. Carey
Publisher:Patrick M. Carey
Chapter7: Designing A Web Form: Creating A Survey Form
Section7.1: Visual Overview: Structure Of A Web Form
Problem 2QC
icon
Related questions
Question
3. In file 'R-Factor-Basics.docx', page 4, use the factor() command to modify the column
dat$Group so that the control group is plotted last.e
Transcribed Image Text:3. In file 'R-Factor-Basics.docx', page 4, use the factor() command to modify the column dat$Group so that the control group is plotted last.e
# Create the data frame.
emp.data <- data.frame (e
emp_id = c (1:5),
emp name = c("Rick","Dan","Michelle","Ryan","Gary"),-
salary = c(623.3,515.2,611.0,729.0,843.25),
start date =
as. Date (c ("2012-01-01", "2013-09-23", "2014-11-15",
"2014-05-11",e
"2015-03-27")),
stringsAsFactors = FALSE
# Add the "dept" coulmn.e
emp.data$dept <- c("IT","Operations","IT","HR","Finance")e
v <- emp.datae
print (v) e
When we execute the above code, it produces the following result
emp_id
emp_name
Rick
salary
start date
depte
1.
1
623.30
2012-01-01
IT-
2
Dan
515.20
2013-09-23
Operationse
3
3
Michelle
611.00
2014-11-15
IT-
4
4
Ryan
729.00
2014-05-11
HR
5
Gary
843.25
2015-03-27
Finance
Transcribed Image Text:# Create the data frame. emp.data <- data.frame (e emp_id = c (1:5), emp name = c("Rick","Dan","Michelle","Ryan","Gary"),- salary = c(623.3,515.2,611.0,729.0,843.25), start date = as. Date (c ("2012-01-01", "2013-09-23", "2014-11-15", "2014-05-11",e "2015-03-27")), stringsAsFactors = FALSE # Add the "dept" coulmn.e emp.data$dept <- c("IT","Operations","IT","HR","Finance")e v <- emp.datae print (v) e When we execute the above code, it produces the following result emp_id emp_name Rick salary start date depte 1. 1 623.30 2012-01-01 IT- 2 Dan 515.20 2013-09-23 Operationse 3 3 Michelle 611.00 2014-11-15 IT- 4 4 Ryan 729.00 2014-05-11 HR 5 Gary 843.25 2015-03-27 Finance
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
New Perspectives on HTML5, CSS3, and JavaScript
New Perspectives on HTML5, CSS3, and JavaScript
Computer Science
ISBN:
9781305503922
Author:
Patrick M. Carey
Publisher:
Cengage Learning
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L
CMPTR
CMPTR
Computer Science
ISBN:
9781337681872
Author:
PINARD
Publisher:
Cengage