Answered step by step
Verified Expert Solution
Question
1 Approved Answer
2 Make a set of R lines based on the following guidelines. ( each one has 4 points) Make some simple vectors of data (numerical
2 Make a set of R lines based on the following guidelines. ( each one has 4 points)
- Make some simple vectors of data (numerical or text) using the c() command.
- Use the scan() command to enter numerical data; this is quicker as the items can be separated by simple spaces (spaces are the default but other separators can be used).
- Use the scan() command to enter some text; this requires an extra instruction, what = character. Items still only require separation with space and do not need to be enclosed in quotes.
- Text items are dealt with similarly to step 3: you use the what = character instruction.
- Now show how to use the scan() command to read a simple text file.
- This is a convenient time to show how to alter the working directory using the setwd() command. The dir() command can also be demonstrated.
- Now show how to read larger, and potentially more complicated data from disk using the read.csv() command.
- Use files in a variety of formats (comma delimited, tab, space) to give your class some practice at using the read.csv() command and the variants such as read.table()
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started