You are here:
Vanderbilt Biostatistics Wiki
>
Main Web
>
IntroStatR
>
IntroStatRhomeWork1
(10 Jul 2008,
JohnHarrell
)
(raw view)
E
dit
A
ttach
---+++++Introduction to Statistics Using R - Homework 1 1. a) Read the file attitude.dat using read.table. Download file [[%ATTACHURL%/attitude.dat][attitude.dat]]. b) The "-99" values denote missing data. Replace these with the appropriate missing value. c) Save the editted data frame to a file using save(). Choose a file name other than the default .RData. (e.g., homework1.Rdata). d) quit R (without saving the workspace), and restart it. e) Read the saved data file using load (e.g., load("homework1.Rdata") f) Save the data frame using dump(), and take a look at the saved file. This format is very useful for transporting R objects across different computing platforms. You can retrieve it using source(). g) Look at the help page count.fields(), and use it for the attitude.dat file. This function can be very helpful for diagnosing problems when reading data. 2) Repeat step 1 a. using scan(). 3) Create a function that inserts a specified value between two elements of a vector at a given position. For example, insert the character "a" between the 4th and 5th elements of 1 2 3 4 5 6 7 8 -- Main.DeanBillheimer - 05 Mar 2004
Attachments
1
Attachments
1
Topic attachments
I
Attachment
Action
Size
Date
Who
Comment
dat
attitude.dat
manage
1.0 K
05 Mar 2004 - 11:55
DeanBillheimer
example frauda file
E
dit
|
A
ttach
|
P
rint version
|
H
istory
: r2
<
r1
|
B
acklinks
|
V
iew topic
|
Edit
w
iki text
|
M
ore topic actions
Topic revision: r2 - 10 Jul 2008,
JohnHarrell
Main
Department Home Page
Biostatistics Graduate Program
Vanderbilt University Medical Center
Main Web
Main Web Home
Search
Recent Changes
Changes
Topic list
Biostatistics Webs
Archive
Main
Sandbox
System
Register
|
Log In
Copyright © 2013-2022 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Vanderbilt Biostatistics Wiki?
Send feedback