[R-sig-teaching] Problem with "attach"
Steven Stoline
sstoline at gmail.com
Mon Dec 29 00:35:57 CET 2014
Dear All:
I do have problem with attach. I believe that I am doing the data.frame
correctly. But it seems that I do have problem with the "attach" statement.
here is what I am doing:
contributions<-c(1000,1500,1200,1800,1600,1100,1000,1250,1500,1800,2000,1200,2000,1700,1800,1900,900,1000,1200,1500,1200,1550,1000,1100)
contributions
### approach<-c(rep(1,8), rep(2,8), rep(3,8))
approach<-c(1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3)
approach
n<-length(contributions)
donations <- data.frame(approach=approach,contributions=contributions)
donations
attach(donations)
the code "*plot(approach~contributions)* " should yield the box-plots, but
it does not.
This what I got from R:
================
> attach(donations)
The following objects are masked _by_ .GlobalEnv:
approach, contributions
The following objects are masked from donations (position 3):
approach, contributions
The following objects are masked from donations (position 5):
approach, contributions
The following objects are masked from donations (position 6):
approach, contributions
The following objects are masked from donations (position 8):
approach, contributions
The following objects are masked from donations (position 10):
approach, contributions
The following objects are masked from donations (position 12):
approach, contributions
The following objects are masked from donations (position 13):
approach, contributions
The following objects are masked from donations (position 14):
approach, contributions
The following objects are masked from donations (position 15):
approach, contributions
The following objects are masked from donations (position 16):
approach, contributions
Any help will be highly appreciated.
with many thanks
Steve
--
Steven M. Stoline
1123 Forest Avenue
Portland, ME 04112
sstoline at gmail.com
[[alternative HTML version deleted]]
More information about the R-sig-teaching
mailing list