File: arff.Rout.save

package info (click to toggle)
foreign 0.8.50-1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 1,416 kB
  • sloc: ansic: 7,372; asm: 4; makefile: 1
file content (36 lines) | stat: -rw-r--r-- 1,516 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36

R version 2.5.0 Under development (unstable) (2007-03-25 r40887)
Copyright (C) 2007 The R Foundation for Statistical Computing
ISBN 3-900051-07-0

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library("foreign")
> df <- read.arff("contact-lenses.arff")
> summary(df)
             age       spectacle-prescrip astigmatism tear-prod-rate
 pre-presbyopic:8   hypermetrope:12       no :12      normal :12    
 presbyopic    :8   myope       :12       yes:12      reduced:12    
 young         :8                                                   
 contact-lenses
 hard: 4       
 none:15       
 soft: 5       
> str(df)
'data.frame':	24 obs. of  5 variables:
 $ age               : Factor w/ 3 levels "pre-presbyopic",..: 3 3 3 3 3 3 3 3 1 1 ...
 $ spectacle-prescrip: Factor w/ 2 levels "hypermetrope",..: 2 2 2 2 1 1 1 1 2 2 ...
 $ astigmatism       : Factor w/ 2 levels "no","yes": 1 1 2 2 1 1 2 2 1 1 ...
 $ tear-prod-rate    : Factor w/ 2 levels "normal","reduced": 2 1 2 1 2 1 2 1 2 1 ...
 $ contact-lenses    : Factor w/ 3 levels "hard","none",..: 2 3 2 1 2 3 2 1 2 3 ...
> q()