--
You received this message because you are subscribed to the ggplot2 mailing list.
Please provide a reproducible example: http://gist.github.com/270442
To post: email ggp...@googlegroups.com
To unsubscribe: email ggplot2+u...@googlegroups.com
More options: http://groups.google.com/group/ggplot2
sumcr<- read.csv(file.choose())
attach(sumcr)
plot(CumLen, WidthWS)
lines(lowess(CumLen, WidthWS), col="blue", lwd=2)
cor(CumLen, WidthWS)
detach(sumcr)
if i'm using data frame like this :
sumcr<- data.frame (cumLen, WidthWS)
Is that possible and the function of this is it the same?
Data.frames are a fundamental data structure in R. The official
introductory material, accessible at
http://cran.r-project.org/doc/manuals/R-intro.pdf, describes them in
6.3ff and you can also read about them by typing ?data.frame at the
console. If you've been using read.csv and friends, you've probably
already been using data.frames perhaps without knowing so.
It sounds like you are looking for the load() and save() functions
which can save objects in R binary format for easy reuse.
Michael
On Mon, Mar 5, 2012 at 7:01 PM, <iqbalh...@gmail.com> wrote:
> Hi, I'm new here I would like to know, what is data.frame is always mention
> about? Is data.frame like when you save a data from ascii,etc save to be
> package in R? Anyone can help me to know?because I'm searching a data that
> could save like a package or could save in R so that could call them
> everytime beside using read.csv and so on. thank you.
> Sent from my BlackBerry®
> powered by Sinyal Kuat INDOSAT
> ________________________________
The output of read.csv is *already* a data.frame so you don't need to
do anything further. You can check this by using class(sumcr).
Any object, once in R, can be saved using save() and load() -- type
?save and ?load to see how they work.
Michael
> --
> You received this message because you are subscribed to the ggplot2 mailing
> list.
> Please provide a reproducible example: http://gist.github.com/270442
>
> To post: email ggp...@googlegroups.com
> To unsubscribe: email ggplot2+u...@googlegroups.com
> More options: http://groups.google.com/group/ggplot2
This question is really more appropriate for the general R-help list
than the ggplot2 specialty list so I'd ask we continue this there if
the following doesn't clarify things.
Please read what I already said carefully and then consider this: your
command 3 is entirely unnecessary. read.csv has already given you
sumcr *as a data frame* so you don't need to remake the same data
frame or convert anything to a data.frame. The error you are seeing
has nothing to do with csv files or load() or anything complicated:
the problem is that "cumLen" and "CumLen" are not the same to R (note
the capitalization differences).
It's also not generally good practice to use attach() in R as it leads
to lots of problems down the line: the following two lines work just
as well.
sumcr <- read.csv(file.choose())
plot(WidthWS ~ CumLen, data = sumcr)
## or if you want a ggplot2 solution ;-)
qplot(CumLen, WidthWS, data = sumcr)
Michael
On Mon, Mar 5, 2012 at 10:06 PM, muhammad iqbal habibie
There are several potential sources of confusion here, but the main
one is that you're evidently unaware that any aesthetics stated in the
ggplot() call are expected to be present in *every* subsequent layer.
This would be cleaner for your problem:
q2 <- ggplot(df)
q2 + geom_point(aes(x = length, y = count)) +
geom_linerange(aes(x = length, y = count, ymin = c0, ymax = count)) +
geom_vline(xintercept = c(100, 200), color = "red") +
annotate(geom = 'text', x = 100, y = 0, label = 'Text here')
The 'count not found' error in your code comes when you use a new data
frame in an annotation layer that contains no reference to ymin or
ymax. In my code, the aesthetics are defined to be local to the geom
call so no mismatch problems should arise.
As for your other question regarding data frames, I'd suggest that you
take the time to read An Introduction to R, which comes with the
software.
Thirdly, most of us don't use Matlab so we may not know what a 'steam
graph' is in Matlab-speak (I know I don't). It's better to supply an
example picture to illustrate what you want - it's easier to help when
we know what help you need.
Dennis
It sounds like you are looking for the load() and save() functions
which can save objects in R binary format for easy reuse.
Michael
On Mon, Mar 5, 2012 at 7:01 PM, <iqbalh...@gmail.com> wrote:
Any object, once in R, can be saved using save() and load() -- type
?save and ?load to see how they work.
Michael
Please read what I already said carefully and then consider this: your
command 3 is entirely unnecessary. read.csv has already given you
sumcr *as a data frame* so you don't need to remake the same data
frame or convert anything to a data.frame. The error you are seeing
has nothing to do with csv files or load() or anything complicated:
the problem is that "cumLen" and "CumLen" are not the same to R (note
the capitalization differences).
It's also not generally good practice to use attach() in R as it leads
to lots of problems down the line: the following two lines work just
as well.
sumcr <- read.csv(file.choose())
plot(WidthWS ~ CumLen, data = sumcr)
## or if you want a ggplot2 solution ;-)
qplot(CumLen, WidthWS, data = sumcr)
Michael
On Mon, Mar 5, 2012 at 10:06 PM, muhammad iqbal habibie
Michael
On Mon, Mar 5, 2012 at 10:28 PM, muhammad iqbal habibie
<iqbalh...@gmail.com> wrote:
> for this function :
>
>> qplot(CumLen, WidthWS, data = sumcr)
> Error: could not find function "qplot"
>
> I do not have package for qplot. please give me the link...there is some