Displaying 20 results from an estimated 10000 matches similar to: "Plotting data with a fitted curve"
2007 Oct 01
4
how to plot a graph with different pch
I am trying to plot a graph but the points on the graph should be
different symbols and colors. It should represent what is in the legend.
I tried using the points command but this does not work. Is there
another command in R that would allow me to use different symbols and
colors for the points?
Thank you kindly.
data(mtcars)
plot(mtcars$wt,mtcars$mpg,xlab= "Weight(lbs/1000)",
2009 Feb 04
5
ggplot: problem with fill option in stat_smooth()
Hi all,
I am using ggplot2 and continuing to find it very useful and pretty.
However, I am trying to create some graphics for publication that would be
included in an MS Word document (not my choice!) in Windows Vista.
The problem is that I want to use stat_smooth() to add an fitted linear
model line along with its 95% confidence band, but I cannot seem to get the
confidence band in a format
2009 Feb 26
1
bottom legends in ggplot2 ?
Has anyone had success with producing legends to a qplot graph such that the legend is placed on the bottom, under the abcissa rather than to the right hand side ?
The following doesn't move the legend:
library(ggplot2)
qplot(mpg, wt, data=mtcars, colour=cyl, gpar(legend.position="bottom") )
I am using ggplot2_0.8.2.
Thanks in advance,
Avram
2012 Dec 10
1
qplot error -
Dear friends, I'm on windows, R 2.15.1 -
library(ggplot2)
#compiled under 2.15.2
qplot(mpg, wt, data=mtcars, colour=cyl) # directly from the qplot help
Error in rename(x, .base_to_ggplot, warn_missing = FALSE) :
could not find function "revalue"
Is that due to a .1 lack in R
All the best
Troels Ring
2009 Jan 07
1
Fw: Re: R Stacked Histogram
Hi Jason,
> Well, one last questions about stack plot (please forgive the lame example
> below). I thought the below allow me to resize the the "title" of the
> stacked histogram, but no luck. Any suggestions as to the modificaiton
> necessary to get it to work? Right now the title is obscured by the plot
> and my boss will be none too happy. Thanks again.
Yes,
2009 Sep 29
2
ggplot2 box plot notches
Dear List,
I just googled to find out if notched box plots are possible with
ggplot2, but couldn't find a answer to it.
boxplot() has the option: notch = TRUE, e.g.: boxplot(mpg$hwy, notch=TRUE)
My example code (taken from the net) is:
require(ggplot2)
qplot(class, hwy, fill=factor(year), data=mpg, geom="boxplot",
position="dodge")+theme_bw()
Thank you for you help!
2008 Oct 11
1
Download page for mongrel_cluster?
Is there a download page for mongrel_cluster? I see that "gem install
mongrel_cluster" works, but I can''t see where it''s coming from.
Usually gems have some sort of project page somewhere.
--
Paul Lynch
Aquilent, Inc.
National Library of Medicine (Contractor)
2008 Aug 29
1
ggplot2: Changes to grobs not saved to file output
Hello,
Maybe I missed something - most likely .:-(
I create a gplot and then makes some changes to the plot using grid graphics
functions. These changes show up on the display OK, but when I save using
ggsave() the grid changes do not show up. How do I save the plot with these
changes?
Thanks in advance.
--
View this message in context:
2006 Oct 27
2
qplot of ggplot package how to plot different size according to the values and not to the weights?
I have the following Data structure
$ step45 : Factor w/ 2 levels
$ obserror : num 6.2 6.2 5.6 6.6 6.6 ...
$ Mon : num 2.2 2.0 1.0 3.2 2.0 ...
$ inc.comp : num 4 5 2 5 5 5 5 5 4 4 ...
all I wanted to do is plotting Mon against obserror, the colors should
be by step45 and the size of the symbol should be according to inc.comp
so I did this:
2007 Dec 16
2
Changing the origin in polar.plot in plotrix package
I am trying to draw a polar plot, which is easy enough to do in the
plotrix package through the polar.plot function.
However I would like to change the origin of the length vector. For
instance all my length values are between 75 and 85, so instead of
having the origin as 0 (the default) I'd like it to be, say, 50.
Is there any way do to this in the polar.plot function, or if not is
there an
2007 Dec 12
1
two-way categorical anova post-hoc data extraction
Hi list,
I have a question regarding post-hoc extraction of data from a two-way categorical anova.
I have a categorical anova of this form:
width ~ steepness + patchiness (4 steepness levels, 4 patchiness levels)
This simple setup answers if for the widths I collected across different levels of steepness and patchiness significant differences can be found. Is there a way to look at these
2007 Sep 20
1
ggplot and xlim/ylim
Hello everyone,
I am (happily) using ggplot2 for all my plotting now and I wondered
is there is an easy way to specify xlim and ylim somewhere when using
the ggplot syntax, as opposed to the qplot syntax. Eg.
qplot(data=mtcars,y=wt, x=qsec,xlim=c(0,30))
<->
ggplot(mtcars, aes(y=wt, x=qsec)) + geom_point() + ???
Indeed the ggplot syntax is in general more flexible and powerful and
2007 Dec 11
2
ggplot - Setting the y-scale in a bar plot
Dear All (probably Hadley),
I am now trying to customise some plots using a bar geom.
I do not want to use the default binning statistic, but rather
calculate the bar heigths separately. I do manage this, but for
comparison purposes I would like to have a set of plots all with the
same y-axis height. But I do not seem to find out how to fix the
scale of the y-axis in this case.
Any tips?
2020 Apr 16
6
suggestion: "." in [lsv]apply()
Hi,
I would like to make a suggestion for a small syntactic modification of
FUN argument in the family of functions [lsv]apply(). The idea is to
allow one-liner expressions without typing "function(item) {...}" to
surround them. The argument to the anonymous function is simply referred
as ".". Let take an example. With this new feature, the following call
2020 Apr 16
2
suggestion: "." in [lsv]apply()
I'm sure this exists elsewhere, but, as a trade-off, could you achieve
what you want with a separate helper function F(expr) that constructs
the function you want to pass to [lsv]apply()? Something that would
allow you to write:
sapply(split(mtcars, mtcars$cyl), F(summary(lm(mpg ~ wt,.))$r.squared))
Such an F() function would apply elsewhere too.
/Henrik
On Thu, Apr 16, 2020 at 9:30 AM
2017 Mar 26
1
Documentation of model.frame() and get_all_vars()
Hi everyone,
This is about documentation for the model.frame() page. The
get_all_vars() function (added in R 2.5.0) is a great addition, but
the behavior of its '...' argument is different from that of
model.frame() with which it is documented and this creates ambiguity.
The current docs read:
\item{\dots}{further arguments such as \code{data}, \code{na.action},
\code{subset}. Any
2006 Sep 03
2
lm, weights and ...
> lm2 <- function(...) lm(...)
> lm2(mpg ~ wt, data=mtcars)
Call:
lm(formula = ..1, data = ..2)
Coefficients:
(Intercept) wt
37.285 -5.344
> lm2(mpg ~ wt, weights=cyl, data=mtcars)
Error in eval(expr, envir, enclos) : ..2 used in an incorrect context,
no ... to look in
Can anyone explain why this is happening? (Obviously this is a
manufactured example, but it
2003 Jul 22
1
Conditional Statements for Graphing
Dear List
I have math test scores for male and female students where gender is a dummy code (female =1). I also have a variety of other demographic variables.
However to begin, I want to create a very simple stripchart where female math scores are a blue circle and male scores are a red triangle.
I am having difficulty using conditional statements to accomplish this.
Thank you.
------
2009 Aug 16
2
bootstrapped correlation confint lower than -1 ?
Dear R users,
Does the results below make any sense? Can the the interval of the
correlation coefficient be between *-1.0185* and -0.8265 at 95%
confidence level?
Liviu
> library(boot)
> data(mtcars)
> with(mtcars, cor.test(mpg, wt, met="spearman"))
Spearman's rank correlation rho
data: mpg and wt
S = 10292, p-value = 1.488e-11
alternative hypothesis: true rho is not
2008 May 07
1
Not to draw the xaxis ticks in ggplot2
>library(ggplot2)
>(p<- qplot(mpg, wt, data=mtcars))
What I am doing is to set color of the ticks to hide them.
>grid.gedit(gPath("xaxis", "ticks"), gp=gpar(col="white"))
It should be a better way to achieve the purpose. Thanks.