Displaying 20 results from an estimated 10000 matches similar to: "multiple pages with ggplot2 possible?"
2007 Jun 08
4
logical 'or' on list of vectors
Suppose I have a list of logicals, such as returned by lapply:
Theoph$Dose[1] <- NA
Theoph$Time[2] <- NA
Theoph$conc[3] <- NA
lapply(Theoph,is.na)
Is there a direct way to execute logical "or" across all vectors? The
following gives the desired result, but seems unnecessarily complex.
as.logical(apply(do.call("rbind",lapply(Theoph,is.na)),2,"sum"))
2013 Apr 01
1
Help Please, ggplot2
library(ggplot2)
a<- read.table("data", header=T)
b = na.omit(a)
ggplot(data=b) + geom_line(aes(x=timepoint, y=value,group=sample, colour= factor(sample))) +? geom_point(aes(x=timepoint, y=value, group=s
ample)) + facet_wrap(~bio, scales = "free",ncol = 5) +theme_bw() + opts(legend.direction = "horizontal",??? legend.position = "top",????
2009 May 07
2
A potential bug for paste() ?
Hi, everyone,
Try the following command to see if you get TRUE or FALSE. I get FALSE on a
unix platform but TRUE on Windows. Any comment?
all(paste(Theoph[1],Theoph[2])==paste(Theoph[[1]],Theoph[[2]]))
--
Jun Shen PhD
PK/PD Scientist
BioPharma Services
Millipore Corporation
15 Research Park Dr.
St Charles, MO 63304
Direct: 636-720-1589
[[alternative HTML version deleted]]
2002 Oct 30
1
groupedData
Dear all,
I tried to create a groupedData object, where the grouping factor
is not ordered.
Here ist the code:
library(nlme)
test<-groupedData(conc~Time|Subject,order.groups=F,data=as.data.frame(Theoph))
> getGroups(test)
Levels: 6 < 7 < 8 < 11 < 3 < 2 < 4 < 9 < 12 < 10 < 1 < 5
I still get an ordered factor. As always thanks for your help
peter
2016 Apr 16
1
a replace for subset
-Thank you James, well the problem of my type of data is that there can be many possible subsets and therefore plots, and I want to automatically generate them, and facet_wrap does not give me all the possible cases
On Saturday, April 16, 2016 6:01 AM, James C. Whanger <james.whanger at gmail.com> wrote:
Would facet_wrap or facet_grid give you what you want?
On Sat, Apr 16, 2016 at
2008 Oct 06
1
Margin on trellis plot
Dear all
I have a problem when I make a trellis plot - I would like to reduce the white margin surrounding the plot.
I used S some years age, as I remember it was possible to use the "par" and "oma" to control margin size even on a trelllis plot (see the plot below).
However, it does not seem to work in R.
All suggestions will be highly appreciated.
Br Henrik
2002 Oct 04
1
gnls from library nlme
Dear all,
I am trying to gain some experience with the function gnls from the nlme
package.
I tried to model the Theophyline data by trying to model the presumed
dependency of
the clearance on the body weight.
This is my function call of gnls:
gnls(conc~SSfol(Dose,Time,lKe,lKa,lCl),data=Theoph,
params=list(lKe~1,lKa~1,lCl~Wt),start=c(-2.4,0.46,-3.22,0.01))
That's been the result:
Error
2009 Oct 29
1
multiple pages with ggplot2 facet_wrap?
I currently use lattice functions to produce multiple pages of plots
using the "layout" argument to specify the number of rows and columns
of panels, e.g.,
xyplot(price ~ carat | clarity, diamonds, layout = c(2, 2))
This results in 2 pages of 4 panels each. "diamonds" is a data.frame
distributed with ggplot2.
I would like to do the same with ggplot2 but have been
2012 Feb 14
2
How to suppress the empty plots in xyplot (lattice)
Dear all,
In a plot command like
xyplot(Y~X|ID*PERIOD,data=...)
xyplot will generate all the possible ID*PERIOD combinations. But not all
of them have data in there. So I have a lot of empty plots. How can I
suppress those empty plots and ask xyplot only to generate plots actually
with data. Thanks.
Jun
[[alternative HTML version deleted]]
2024 Mar 05
1
How to invert axis within defined range with ggplot2 scale_y_reverse?
Hello,
I am drawing some data with ggplot2 and would like to reverse the
order of the y axis and set a custom range for it.
I can do the former but when I add the key `limits` to
`scale_y_reverse` I get an error as shows below and, worse, no data
shown in the plot.
How can I properly set a reverse y scale with a defined range in ggplot2?
Thank you
```
A <- rep(c(0, 3, 6, 12, 24), 3)
B <-
2024 Mar 05
1
How to invert axis within defined range with ggplot2 scale_y_reverse?
On 05/03/2024 7:16 a.m., Luigi Marongiu wrote:
> A <- rep(c(0, 3, 6, 12, 24), 3)
> B <- c(rep(0,5), rep(1,5), rep(2,5))
> V <- c(27.5, 27.01, 27.75, 27.98, 27.4, 25.69,
> 26.17, 27.78, 26.08,
> 24.97, 23.18, 21.78, 22.49, 21.85, 22.2)
> df <- data.frame(Conc = A, Time = B, Value = V)
> df$Conc = as.factor(df$Conc)
>
2012 May 11
3
How to specify multiple regular expressions for pattern argument
Dear list,
I want to show all the objects starting with "d" and ending with a digit.
How do I specify these conditions in the pattern argument
I can do one condition but not two
ls(pattern='^d')
ls(pattern='[[:digit:]]$')
are working.
But,
ls(pattern='^d'&'[[:digit:]]$') is not working.
Appreciate any comment.
Jun Shen
[[alternative HTML
2009 Jan 07
1
Problem with ggplot2 - facet_wrap and boxplot
Hello R users and Hadley,
Back again with a little problem in ggplot2 =o) (ggplot 0.8.1, R 2.8.0)
Here the problem :
library(ggplot2)
df <- data.frame(id = 1:100, x1 = c(rnorm(50), rnorm(50, 1)), x2 =
c(rnorm(50), rnorm(50, 1.5)), x3 = c(rnorm(50, 0.5), rnorm(50, 2.5)), group
= as.factor(rep(c("a", "b"), each = 50)))
df.melt <- melt(df, id = c("id",
2016 Apr 16
3
a replace for subset
Hi,
I have a data set (mydata), which a part of this is like the following:
'data.frame': 36190 obs. of 16 variables:
$ RE : int 38 41 11 67 30 18 38 41 41 30 ...
$ LU : int 4200 3330 530 4500 3000 1790 4700 3400 3640 4000 ...
$ COUNTRY : Factor w/ 4 levels "DE","FR","JP", "FR"?
$Light
2012 May 12
2
ggplot simple question.
I have a matrix like this
Name 1 2
3 4 5
NM_001039514 1.033557047 0.7469879518 0.9004524887 0.8613861386 0.7952499048
NM_001039723 1.0759493671 1.2315789474 0.8666666667 1.1142857143
0.9428011471
NM_001042605 0.9897435897 0.8870431894
2017 Nov 10
1
How to create separate legend for each plot in the function of facet_wrap in ggplot2?
Hi R users,
I need to create more than 20 figures (one for each group) in one page. I
have a common legend for 20 figures using the facet_wrap. However the
range of the values among the groups are very wide. For example one group
has the value of 0 to 3, but the values of some of the groups has ranged
from 0 to 20 so that when I used a single common legend for all 20 figures,
I could not display
2011 Sep 07
2
ggplot2-Issue placing error bars behind data points
Hi all,
This seems like a basic problem, but no amount of playing with the code has
solved it. I have a time-series data set like that shown below (only longer)
and am seeking to plot the data with filled, circular points and error bars.
I would like the error bars to be behind the points otherwise they tend to
obscure the points (especially when I have a lot of points in the actual
data set).
2011 Sep 30
2
ggplot2 - extracting values of smooth
Suppose that I'm working on Hadley's diamond dataset and I want to
review the relationship between price, colour and carat.
I might run the following:
library(ggplot2)
#plot scatter and add some hex binning
q<-qplot(carat,price,data=diamonds, geom=c("hex"),
main="Variability of Diamond Prices by Carat and Colour")
#facet to get one scatter for
2017 Jul 05
1
How can I make the legend in ggplot2 the same height as my plot?
Hi R Users,
I tried to increase the legend height in ggplot2, but it did not respond at all using the follwoing code. Do you have any suggestions for me?
dat<-data.frame(temperature)
P1<-ggplot(dat, aes(X, Y))
Scenario1<-P1+geom_point(aes(colour = value), size = 1)+ theme_bw()+ theme(axis.text.x = element_blank(),axis.text.y = element_blank())
2012 Mar 12
1
to Michael ... Re: How do I do a pretty scatter plot using ggplot2?
Hi Michael,
I am trying the solution you've suggested below:
DAT <- data.frame(x = runif(1000, 0, 20), y = rnorm(1000))
DAT$xbin <- with(DAT, cut(x, seq(0, 20, 2)))
p <- ggplot(DAT, aes(x = x, y = y)) + geom_point(alpha = 0.2) +
stat_quantile(aes(colour = ..quantile..), quantiles = seq(0.05, 0.95,
by=0.05)) + facet_wrap(~ xbin, scales = "free")
print(p)