Displaying 20 results from an estimated 1000 matches similar to: "adding layers in ggplot2 (data and code included)"
2008 Sep 19
1
reproduce this graph in ggplot2 (code and data included)
How can I reproduce this graph in ggplot2 (regression lines and data
point superimposed). Thanks, Juliet
filename="http://personality-project.org/r/datasets/heating.txt"
heating=read.table(filename,header=TRUE)
symb=c(19,25,3,23)
colors=c("black","red","green","blue")
2008 Sep 22
1
R-help Digest, Vol 67, Issue 23
Warranty on Accuracy, Precision, Legality, ... of R in Research
(These questions may well have been raised.)
What is the implied warranty of using R for research & publications, consulting, etc.?
Alternately, how does one obtain such a warranty?
Your answers will be much appreciated.
Perhaps you can point me to some websites which discussed this subject in the past.
Thanks & regards
2008 Aug 23
3
graphs for pretest data
Is there an easy way to make graphs for the following data. I have
pretest and posttest scores for men and
women. I would like to form a 'titlted segment' plot for the data.
That is, make segments joining the scores,
with different types of segments for men and women.
Example data:
menpre <- c(43,42,26,39,60,60,46)
menpost <- c(40,41,36,42,54,58,43)
womenpre <-
2008 Jul 09
3
randomly select duplicated entries
Using this data as an example
dat <- read.table(textConnection("Id myvar
12 1
12 2
12 6
34 9
34 4
34 8
65 15
65 23"), header = TRUE)
closeAllConnections()
how can I create another data set that does not have duplicate entries
for 'Id', but the included values
are randomly selected from the available ones.
Thanks!
Juliet
2009 Mar 07
6
using a noisy variable in regression (not an R question)
Hi, This is not an R question, but I've seen opinions given on non R
topics, so I wanted
to give it a try. :)
How would one treat a variable that was measured once, but is known to
fluctuate a lot?
For example, I want to include a hormone in my regression as an
explanatory variable. However, this
hormone varies in its levels throughout a day. Nevertheless, its levels differ
substantially
2010 Jul 15
2
replace negative numbers by smallest positive value in matrix
Hi Group,
I have a matrix, and I would like to replace numbers less than 0 by
the smallest minimum number. Below is an
small matrix, and the loop I used. I would like to get suggestions on
the "R way" to do this.
Thanks,
Juliet
# example data set
mymat <- structure(c(-0.503183609420937, 0.179063475173256, 0.130473004669938,
-1.80825226960127, -0.794910626384209, 1.03857280868547,
2009 Mar 02
3
ways to put multiple graphs on single page (using ggplot2)
Hi, Here are three plots:
library(ggplot2)
data(diamonds)
randind <- sample(nrow(diamonds),1000,replace=FALSE)
dsmall <- diamonds[randind,]
qplot(carat, data=dsmall, geom="histogram",binwidth=1)
qplot(carat, data=dsmall, geom="histogram",binwidth=.1)
qplot(carat, data=dsmall, geom="histogram",binwidth=.01)
What are ways to put these three plots on a single
2012 Mar 15
2
ggplot2: goem_smooth and suppress messages
Hi
When I run my script using ggplot and geom_smooth I get messages that I
would like to suppress:
p <- ggplot(dataSubset)
p <- p + aes(x = as.Date(factor(key),format="%Y%m%d")) + geom_line()
p <- p + geom_smooth(span=0.2,se=FALSE,size=0.7)
The messages look like this:
geom_smooth: method="auto" and size of largest group is <1000, so using
loess. Use 'method
2012 Oct 30
4
Error unary operator
Hi R - listers,
I am receiving an error. Does anyone know what this means? J
ggplot(subset(foo, Rayos != "Rayos.NA"), aes(x=HTL, y=DevelopIndex,
colour=TotalEggs)) +geom_point() +geom_jitter() +
facet_grid(Aeventexhumed ~ Rayos)
+ geom_smooth(method="lm", fill=NA) + ylim(c(0, 7))
Error in +geom_smooth(method = "lm", fill = NA) :
invalid argument to unary
2023 Aug 12
2
geom_smooth
Colleagues,
Here is my reproducible code for a graph using geom_smooth
set.seed(55)
scatter_data <- tibble(x_var = runif(100, min = 0, max = 25)
?????????????????????? ,y_var = log2(x_var) + rnorm(100))
library(ggplot2)
library(cowplot)
ggplot(scatter_data,aes(x=x_var,y=y_var))+
? geom_point()+
? geom_smooth(se=TRUE,fill="blue",color="black",linetype="dashed")+
2012 Mar 21
2
glmnet: obtain predictions using predict and also by extracting coefficients
All,
For my understanding, I wanted to see if I can get glmnet predictions
using both the predict function and also by multiplying coefficients
by the variable matrix. This is not worked out. Could anyone suggest
where I am going wrong?
I understand that I may not have the mean/intercept correct, but the
scaling is also off, which suggests a bigger mistake.
Thanks for your help.
Juliet Hannah
2009 Aug 18
1
ggplot2: geom_smooth and legend
Hi all,
Is that possible to remove the grey colour in the legend key that goes
with the geom_smooth? In my case it doesn't ease the reading of the
legend.
http://www.4shared.com/file/125864977/e10644f8/desorb.html
Cordialement / Regards
-------------------------------------------
Benoit Boulinguiez
Ecole de Chimie de Rennes (ENSCR) Bureau 1.20
Equipe CIP UMR CNRS 6226 "Sciences
2009 Apr 20
3
what is R best for; what should one learn in addition to R
Hi,
I've been working with R for a couple of years, and I've
been able to get most of the things done that I needed (sometimes in
a roundabout way). A few experienced statisticians told me that
R is best for interactive data analysis, but for large-scale
computations, one needs something else.
I understand that this all depends on what you are trying to
accomplish, and R offers many ways
2009 Jan 24
2
how to prevent duplications of data within a loop
Hi All,
I had posted a question on a similar topic, but I think it was not
focused. I am posting a modification that I think better accomplishes
this.
I hope this is ok, and I apologize if it is not. :)
I am looping through variables and running several regressions. I have
reason to believe that the data is being duplicated because I have
been
monitoring the memory use on unix.
How can I avoid
2008 Nov 19
2
ggplot2; dot plot, jitter, and error bars
With this data
x <- c(0,0,1,1,2,2)
y <- c(5,6,4,3,2,6)
lwr <- y-1
upr <- y+1
xlab <- c("Low","Low","Med","Med","High","High")
mydata <- data.frame(x,xlab,y,lwr,upr)
I would like to make a dot plot and use lwr and upr as error bars.
Above 0=Low. I would like there to be
some space between the 5 and the 6 corresponding
2007 Sep 24
2
Getting host IP address?
Hi,
I''m gradually moving my site''s config over to Puppet (still in the
testing phases at the moment!).
Is there any way of getting/referring to a host''s IP address? I want to
set up iptables via Puppet, & can use a template but need to get the
IP address into the template somehow.
I''m getting my node definitions (& thus classes) from LDAP. I
2007 Nov 13
6
Facter and arrays
Hi,
Is it possible to have an array as the output of a custom fact? And
then to pass it into a template in Puppet?
I currently have a fact that looks like this:
Facter.add("exports") do
setcode do
case Facter.hostname
when (/thishost/i):
[ "/local", "/local2" ]
end
end
end
& a template like this:
<%
2023 May 16
1
Newbie: Drawing fitted lines on subset of data
Hello,
I's still working with my tsibble of weight data for the last 20 years.
In addition to drawing an overall trend line, using lm, for the whole
data set, I'd like to draw short lines that would recompute lm and draw
it, say, just for the years from 2010:2015.
Here's a short example that I think illustrates what I'm trying to do.
The commented out sections show what
2009 Feb 08
2
how to make this qq plot in lattice and/or ggplot2
Hi Group,
Here is some data.
p <- runif(1000) # sample data
groups <- rep(c(1,2),each=500) #conditioning variable
mydata <- cbind(p,groups)
n <- length(p)
u <- (1:n)/(n + 1) # uniform distribution reference for qqplot
logp <- -log(p,base=10)
logu <- -log(u,base=10)
qqplot(logp,logu)
How can I make the above qqplot in lattice and/or ggplot2. The sample
is uniform, and I take
2007 Jun 14
1
back-transform predictors for x-axis in plot -- mgcv package
My question is related to plot( ) in the mgcv package. Before modelling
the data, a few predictors were transformed to normalize them.
Therefore, the x-axes in the plots show transformed predictor values.
How do I back-transform the predictors so that the plots are easier to
interpret?
Thanks in advance,
Suzan
--
Suzan Pool
Oregon State University
Cooperative Institute for Marine