2009/10/30 hadley wickham :
> I read anything that mentions
> ggplot2 no matter where it is.
>
... one should hope this statement only applies to "the Internet"
though, does it? Please do share your regexp if it's not the case.
:)
baptiste
__
R-help@r
Hi,
Try this,
x = rnorm(1)
y = rnorm(1)
leg = bquote(r^2*"="*.(round(x,digits=3))*", P="*.(round(y, digits=3)))
plot.new()
legend (bty ="n","topright",legend=leg)
HTH,
baptiste
2009/11/2 Jacob Kasper :
> I know that this has been revisited over and over, yet I cannot figure out
> how to solve
Hi,
try this,
plot.new()
x=0.8
text(0.5, 0.5, bquote(rho == .(x)))
HTH,
baptiste
2009/11/3 :
>
> I'm trying something that I thought would be pretty simple, but it's proving
> quite frustrating...
>
> I want to display, for instance, the correlation coefficient "rho" in a
> graph.
>
> I can d
Hi,
It looks like SAGE might be another option,
http://www.sagemath.org/index.html
though I never tried it.
HTH,
baptiste
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R
Hi,
Maybe something like this (inspired by ?cut),
cut2num <- function(f){
labs <- levels(f)
d <- data.frame(lower = as.numeric( sub("\\((.+),.*", "\\1", labs) ),
upper = as.numeric( sub("[^,]*,([^]]*)\\]", "\\1", labs) ))
d$midpoints <- rowMeans(d)
d
}
a <- c(1, 2, 3, 4
Hi,
One way would be,
vec[ cumsum(!vec)==0 ]
HTH,
baptiste
2009/11/9 Grzes :
>
> Hi !
> I have a vector:
> vec= TRUE TRUE TRUE TRUE FALSE FALSE FALSE FALSE TRUE TRUE FALSE
> and I'm looking for a method which let me get only the first values equal
> TRUE from this vector. It means that I
Dear list,
subset has a 'drop' argument that I had often mistaken for the one in
[.factor which removes unused levels.
Clearly it doesn't work that way, as shown below,
d <- data.frame(x = factor(letters[1:15]), y = factor(LETTERS[1:3]))
s <- subset(d, y=="A", drop=TRUE)
str(s)
'data.frame': 5
AM, baptiste auguie wrote:
>
>> Dear list,
>>
>> subset has a 'drop' argument that I had often mistaken for the one in
>> [.factor which removes unused levels.
>> Clearly it doesn't work that way, as shown below,
>>
>> d <- data.frame(x = fa
Hi,
>From what I understand of your code, you might find the following
construct useful,
funs <- c("mean", "sum", "sd", "diff")
x <- 1:10
lapply(funs, do.call, args=list(x))
and then working with lists rather than naming every object
individually. You might find mapply useful too when you have t
Hi,
An alternative with ggplot2,
library(ggplot2)
ggplot(data=coords) +
geom_segment(aes(x=a, xend=b, y=c, yend=c))
HTH,
baptiste
2009/11/16 David Winsemius :
>
> On Nov 16, 2009, at 12:40 PM, Tim Smith wrote:
>
>> Hi,
>> I wanted to make a graph with the following table (2 rows, 3 columns
Hi,
Try this,
set.seed(2) # reproducible
d = matrix(sample(1:20,20), 4, 5)
d
d[ d[ ,2] == 18 , ]
You may need to test with all.equal if your values are subject to
rounding errors.
HTH,
baptiste
2009/11/16 frenchcr :
>
>
> I have 20 columns of data, and in column 5 I have a value of 17600 but
?order
?sort
2009/11/16 frenchcr :
>
>
>
> In excel a handy tool is the sort data by column ...i.e. i can highlight the
> whole dataset and sort it according to a particular column...like sort the
> data in a column in acending or decending order where all the other columns
> change aswell.
>
> I
Hi,
You could try plyr,
library(plyr)
ddply(d,.(Name), tail,1)
Name Value
1A 3
2B 8
3C 2
4D 3
HTH,
baptiste
2009/11/16 Hao Cen :
> Hi,
>
> I would like to extract the last row of each group in a data frame.
>
> The data frame is as follows
>
> Name Value
> A
Hi,
Not answering your question, but the tikzDevice package is another
option if you want to match LaTeX fonts seamlessly.
HTH,
baptiste
2009/11/17 Markus Jochmann :
>
> Hi!
>
> On Linux I try to produce pdf graphs with computer modern fonts so that they
> look nice in LaTeX documents. I run fo
x2:
>> x2
> chr start1 end1 meth positive
> 1 1 10 20 1.5 y
> 4 1 35 70 3.0 y
> 5 1 120 140 -1.3 n
> 6 1 180 190 0.2 y
>
>
> ## Code courtesy of BAPTISTE AUGUIE
> library(ggplot2)
> ggplot(data=x2) +
Dear list,
I'm seeking advice to extract some numeric values from a log file
created by an external program. Consider the following example,
input <-
readLines(textConnection(
"some text
=1.3770E-03 =3.4644E-07
=1.9412E-04 =4.8840E-08
other text
=1.3770E-0
h case we do not need combine
> - \\d+ matches one or more digits
> - \\. matches a decimal point
> - [-+]? matches -, + or nothing (i.e. an optional sign).
> - parentheses around the regular expression not needed
>
> On Wed, Nov 18, 2009 at 7:28 AM, Henrique Dallazuanna
> wro
s reasonably general, but I haven't checked it
> carefully and would appreciate folks pointing out where it trips up (e.g.
> perhaps with NA's).
>
> Best,
>
> Bert Gunter
> Genentech Nonclinical Biostatistics
>
> -Original Message-
> From: r-help-boun
> V3 V6
> 1 0.00137700 3.4644e-07
> 2 0.00019412 4.8840e-08
> 3 0.00137700 3.4644e-07
> 4 0.00019412 4.8840e-08
>
>
>
> On Wed, Nov 18, 2009 at 1:54 PM, baptiste auguie
> wrote:
>> Hi,
>>
>> Thanks for the alternative approach. Howe
Hi,
Try this,
d <- data.frame(a=1:4, b=3:6)
var <- "a"
mean(d[var])
## or, if you are not aware of
## fortune("parse")
xx <- paste("d$",var, sep="")
mean(eval(parse(text=xx)))
HTH,
baptiste
2009/11/19 William Simpson :
> I have quite a complicated problem that's hard to describe.
>
> S
Hi,
I think your ddply call with a calculation inside ".( )" is the
problem. Are you sure you need to do this? Performing the cut outside
ddply seems to work fine,
determine_counts<-function()
{
min_range<-1
max_range<-30
bin_range_size<-5
Me_df<-data.frame(Data
Hi,
You can try this, though I hope to learn of a better way to do it,
a = c(quote(alpha),quote(beta),quote(gamma))
b = lapply(1:3, function(x) as.character(x))
c = c(quote('-10'^th),
quote('-20'^th),
quote('-30'^th))
testplot <- function(a,b,c) {
text <-
lapply(seq_along(a), function(i
hi,
Try making your last line
invisible( list(table=xtb, elbat=btx) )
HTH,
baptiste
2009/11/22 Soeren.Vogel :
> I have created a function to do something:
>
> i <- factor(sample(c("A", "B", "C", NA), 793, rep=T, prob=c(8, 7, 5, 1)))
> k <- factor(sample(c("X", "Y", "Z", NA), 793, rep=T, prob
Hi,
Try this,
do.call(expand.grid, lapply(7:3, seq, from=1))
HTH,
baptiste
2009/11/22 Peng Yu :
> I use the following code to generate a matrix of factors. I'm
> wondering if there is a way to make it more general so that I can have
> any number of factors (not necessarily 5).
>
> a=3
> b=4
Hi,
it's a FAQ, you need to print() the plot,
http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-do-lattice_002ftrellis-graphics-not-work_003f
baptiste
2009/11/25 Ryan Archer :
> Hi,
>
> I'm having trouble seeing graphics output from lattice xyplot() when called
> from inside a for loop:
>
> x <-
Hi,
I think you can use match.call() to retrieve the number of arguments
passed to a function (see below), but I don't think nargout makes
sense in R like it does in Matlab.
foo <- function(...){
print(match.call())
nargin <- length(as.list(match.call())) -1
print(nargin)
}
foo(a=1, b=2)
2009/11/26 Ted Harding :
> Raising a rather general question here.
>
> This is a tantalising discussion, but the notion of "concave hull"
> strikes me as extremely ill-defined!
>
> I'd like to see statement of what it is (generically) supposed to be.
I'm curious too, but I can imagine the followin
dea:
> alphahull, phull is other package,
>
> kjetil
>
> On Thu, Nov 26, 2009 at 6:11 PM, baptiste auguie
> wrote:
>> 2009/11/26 Ted Harding :
>>> Raising a rather general question here.
>>>
>>> This is a tantalising discussion, but the notion of
Hi,
The error message,
Error in grid[i] <- x + (i - 1) * (y - x)/m :
object of type 'closure' is not subsettable
indicates that "grid" is actually known to R as a function (type grid
to see its definition). You can define your own variable with the same
name, but that needs to be done before t
Hi,
Try this,
matrizt[is.na(matrizt)] <- 0
HTH,
baptiste
2009/11/27 Romildo Martins :
> Hello,
>
> how to replace the "NA" by number zero?
>
>> matrizt
> [,1] [,2] [,3] [,4]
> [1,] 1.000 NA NA NA
> [2,] 0.6717685 0
Hi,
They're not exported from the stats namespace,
stats:::.Diag
stats:::.asSparse
?":::"
HTH,
baptiste
2009/11/29 Peng Yu :
> '.Diag' and '.asSparse' are defined in contrast.R. I'm wondering why I
> don't see them in my R session. Is it because that they start with
> '.'?
>
> ___
Hi,
an alternative to parse() is to use quote and bquote,
set.seed(123)
d = data.frame(a=letters[1:5], b=1:10, c=sample(0:1, 10, repl=TRUE))
cond1 <- quote(a=="b")
cond2 <- quote(b < 6)
cond3 <- bquote(.(cond1) & .(cond2))
subset(d, eval(cond1))
subset(d, eval(cond2))
subset(d, eval(cond3))
HT
Hi,
I don't understand why you used scale_manual_colour if you want only
black lines. To have different line types in the legend you can map
the linetype to the data,
huron <- data.frame(year=1875:1972, level=LakeHuron)
ggplot(huron, aes(year)) +
geom_line(aes(y=level+5, linetype="above")) +
"outside the convex hull",
> hence my question.
>
> In searching r-project.org I came across a thread in which baptiste auguie
> said "one general way to do this would be to compute the convex hull
> (?chull) of the augmented set of points and test
Hi,
I think the size mismatch occurs because of a different default for
the fontsize (and grid.points has a size of 1 character by default).
Compare the following two examples,
# default
grid.newpage()
pushViewport(viewport(x=unit(0.5, "npc"), y=unit(0.5, "npc")))
lplot.xy(data.frame(x=0.55,y=0.5
Hi,
try ?do.call
do.call(cbind, replicate(3, 1:10, simplify=FALSE))
HTH,
baptiste
2009/12/4 Lisa :
>
> Hello, All,
>
> I want to write a function to do some works based on the arguments. For
> example, bind some variables (arguments) as this:
>
> myfunction <- function(arg1, arg2, arg3, …)
> {
Hi,
If you can first convert the image to ppm format, the pixmap package
has an addlogo function that can do just what you want,
x <- read.pnm(system.file("pictures/logo.ppm", package="pixmap")[1])
plot(1:10,1:10)
addlogo(x, px=c(2, 4), py=c(6, 8), asp=1)
One could probably get inspiration from
Hi,
Try this,
cor(pollute[ ,c("Pollution","Temp","Industry")])
and ?"[" in particular,
"Character vectors will be matched to the names of the object "
HTH,
baptiste
2009/12/5 John-Paul Ferguson :
> I apologize for how basic a question this is. I am a Stata user who
> has begun using R, and th
Hi,
I think you have two options:
1- use a specific formatter in scale_x_continuous, e.g.
last_plot +
scale_x_continuous(formatter="percent")
2- specify breaks and labels,
last_plot +
scale_x_continuous(breaks=c(2,6), labels=paste(c(2,6),"%"))
HTH,
baptiste
2009/12/7 Megh :
>
> library(ggp
Hi,
I was about to send the exact same answer as you just received, so
I'll add a note instead. Your problem looks a bit like Currying,
Curry <- # original from roxygen
function (f, ..., .left=TRUE)
{
.orig = list(...)
function(...){
if(.left) {args <- c(.orig, list(...))} else {
Hi,
You could define a function that does the calculations for a given
data.frame and apply it to all your data.frames,
d1 <- data.frame(a=1:10, b=rnorm(10))
d2 <- data.frame(a=-(1:10), b=rnorm(10))
calculations <- function(d){
if(is.character(d)) d <- get(d)
transform(d,
c =
Hi,
try this,
barchart(1:2, ylab=expression(mu*g/m^3))
?plotmath
baptiste
2009/12/9 Peng Cai :
> Hi All,
>
> I'm trying to write "ug/m3" as y-label, with greek letter "mu" replacing "u"
> AND "3" going as a power.
>
> These commands works in general:
>
> plot.new()
> text(0.5, 0.5, expression(
space between
> "Concentration" and "(mu*g/m^3)".
>
> Thanks again,
> Peng Cai
>
> On Wed, Dec 9, 2009 at 12:02 PM, baptiste auguie <
> baptiste.aug...@googlemail.com> wrote:
>
>> Hi,
>>
>> try this,
>>
>> barchart(1:2, yl
I feel I
> and Baptiste are wandering in the dark :-(
>
> Any hints?
>
> Thanks in advance,
>
> Keith Jewell
> -
> "baptiste auguie" wrote in message
> news:de4e29f50912040550m71fbffafnfa1ed6e0f4451...@mail.gmail.
Hi,
Is the following close enough?
apply(set2, 2, function(x) x[is.na(x)])
HTH,
baptiste
2009/12/10 Andreas Wittmann :
> Dear R-users,
>
> after several tries with lapply and searching the mailing list, i want to
> ask, wheter and how it is possibly to avoid the for-loop in the following
> pie
2009/12/10 Charles C. Berry :
[snipped]
> Many?
>
>
>> set.seed(1234)
>> ps <- matrix(rnorm(4000),ncol=4)
>> phull <- convhulln(ps)
>> xs <- matrix(rnorm(1200),ncol=4)
>> phull2 <- convhulln(rbind(ps,xs))
>> nrp <- nrow(ps)
>> nrx <- nrow(xs)
>> outside <- unique(phull2[phull2>nrp])-nrp
>> done <-
Hi,
.NotYetImplemented gives an example,
function ()
stop(gettextf("'%s' is not implemented yet",
as.character(sys.call(sys.parent())[[1L]])),
call. = FALSE)
HTH,
baptiste
2009/12/11 Hao Cen :
> Hi,
>
> Is there a way to get the enclosing function name within a function?
>
> For example,
`[[.data.frame`
and more generally see Rnews Volume 6/4, October 2006 "Accessing the Sources".
HTH,
baptiste
2009/12/13 Guillaume Yziquel :
> Hello.
>
> I'm currently trying to wrap up data frames into OCaml via OCaml-R, and I'm
> having trouble with data frame subsetting:
>
>> # x#column 1;;
Hi,
Try this,
apply(expand.grid(letters[1:3], letters[24:26]), 1, paste,collapse="")
[1] "ax" "bx" "cx" "ay" "by" "cy" "az" "bz" "cz"
?expand.grid
HTH,
baptiste
2009/12/14 Amelia Livington :
>
> Dear R helpers,
>
> I am working on the scenario analysis pertaining to various interest rates.
>
FAQ:
http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-do-lattice_002ftrellis-graphics-not-work_003f
you need to print()
HTH,
baptiste
2009/12/16 c...@autistici.org :
> Hi,
> i have a script how i launch lattice to make a densityplot.
> in the script:
>
> jpeg(file="XXX.jpg")
> densityplot(~f_di
Dear list,
I'm not so familiar with the internals of the fortunes package, but I
really like the interface. I was wondering if someone had implemented
a similar functionality to parse the entries of the R FAQ <
http://cran.r-project.org/doc/FAQ/R-FAQ.html >. Say, if I was to
answer a question "Wh
Hi,
Excellent, thanks for doing this!
I had tried the 2D case myself but I was put off by the fact that
Octave's convhulln had a different ordering of the points to R's
geometry package (an improvement to Octave's convhulln was made after
it was ported to R). I'm not sure how you got around this
Dear list,
In a little numbers game, I've hit a performance snag and I'm not sure
how to code this in C.
The game is the following: how many 8-digit numbers have the sum of
their digits equal to 17?
The brute-force answer could be:
maxi <- 9 # digits from 0 to 9
N <- 5 # 8 is too large
test <- 1
2009/12/19 David Winsemius :
>
> On Dec 19, 2009, at 9:06 AM, baptiste auguie wrote:
>
>> Dear list,
>>
>> In a little numbers game, I've hit a performance snag and I'm not sure
>> how to code this in C.
>>
>> The game is the following: h
)==17) {idx<-c(idx,i)})
user system elapsed
34.050 1.109 35.791
I'm surprised by idx<-c(idx,i), isn't that considered a sin in the R
Inferno? Presumably growing idx will waste time for large N.
Thanks,
baptiste
2009/12/19 David Winsemius :
>
> On Dec 19, 2009, at 1:36
)
p
Best,
baptiste
[David: sorry for the duplicate, i initially sent an attachment that
was too large for the list]
> 2009/12/19 David Winsemius :
>>
>> On Dec 19, 2009, at 2:10 PM, David Winsemius wrote:
>>
>>>
>>> On Dec 19, 2009, at 1:36 PM, baptiste
Hi,
try this,
ylab = expression(Temperature~(degree*F))
?plotmath
baptiste
2009/12/20 Kim Jung Hwa :
> Hi All,
>
> I'm wondering if its possible to write degree in symbol.
>
> I would like y-label as "Temperature (degreeF)". where degree should be in
> symbols. Thanks in advance,
>
> #R Code
>
Dear list,
I made the following example of a proto object that contains some data
and a spline interpolation. I don't understand why test$predict()
fails with this error message:
Error: evaluation nested too deeply: infinite recursion / options(expressions=)?
Best regards,
baptiste
test <- pro
to refer to stats::predict. Change the line that calls predict to:
>
> stats::predict(.$spline(), x.fine)
>
> On Sun, Dec 20, 2009 at 11:49 AM, baptiste auguie
> wrote:
>> Dear list,
>>
>> I made the following example of a proto object that contains some data
>>
Hi,
Do you want a ternary plot?
http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=34
It's easy to rotate an axis with Grid graphics,
library(grid)
pushViewport(viewport(0.5,0.5, width=0.5, height=unit(3, "lines")))
grid.xaxis(at=seq(-0.5,0.5,by=0.1), vp=viewport(x=1, angle=-60))
HTH
rybody who participated, I have learned interesting
things from a seemingly innocuous question.
Best regards,
baptiste
2009/12/21 Robin Hankin :
> Hi
>
> library(partitions)
> jj <- blockparts(rep(9,8),17)
> dim(jj)
>
> gives 318648
>
>
> HTH
>
> rk
Will this do?
temp <- paste("m", 1:3, sep="",collapse=",")
HTH,
baptiste
2009/12/23 Knut Krueger :
> Hi to all
>
> I need a string like
> temp <- paste("m1","m2","m3",sep=",")
> But i must know how many items are in the string,afterwards
> the other option would be to use a vector
> temp <- c("
Isn't paste doing exactly this?
temp <- c("November", "December","Monday","Tuesday")
paste(temp, collapse=",")
# "November,December,Monday,Tuesday"
HTH,
baptiste
2009/12/23 Ted Harding :
> On 23-Dec-09 11:08:02, Knut Krueger wrote:
>> Jim Lemon schrieb:
>>> Not as easy as I thought it would be
X formulas.
Best wishes,
baptiste
On 7 May 2009, at 14:39, Dieter Menne wrote:
Lasse Bombien phonetik.uni-muenchen.de> writes:
Am Mittwoch, den 06.05.2009, 16:08 +0200 schrieb baptiste auguie:
I think the pgfSweave project on R-forge is working on this (as
far as
i know it currently r
try this:
with(fp, Frequenz[which.max(AmpNorm)])
baptiste
On 8 May 2009, at 14:49, Jonas Stein wrote:
Hi,
fp is a data frame like this
,[ fp ]
|Frequenz AmpNorm
| 1 3322 0.0379490639
| 2 3061 0.0476033058
| 3 2833 0.0592954124
| 4 2242 0.1275510204
`
i
try this,
library(plyr)
ddply(d, .(block, trial), function(.d) .d[1:2, ])
block trial x y
1 1 1 605 150
2 1 1 603 148
3 1 2 607 148
4 1 2 605 152
HTH,
baptiste
On 11 May 2009, at 13:49, Jens Bölte wrote:
Hello,
I have been struggling for quite some
good point, i forgot about head (!),
library(plyr)
ddply(d, .(block, trial), head, 2)
block trial x y
1 1 1 605 150
2 1 1 603 148
3 1 2 607 148
4 1 2 605 152
On 11 May 2009, at 14:04, Gabor Grothendieck wrote:
Try this:
do.call(rbind, by(DF, DF[1:2], he
Hi,
I once made this function (essentially the same as Romain),
assignFiles <-
function (pattern = "csv", strip = "(_|.csv|-| )", ...) # strip is
any pattern you want to remove from the filenames
{
listFiles <- list.files(pattern = pattern, all.files = FALSE,
full.names = FALSE,
Depending on the nature of your pdf file, it may be possible to use
the grImport package. I've never used it before, but a quick test
seems promising,
> # create a test picture
> colorStrip <-
> function (colors, draw = T)
> {
> x <- seq(0, 1 - 1/ncol(colors), length = ncol(colors))
>
I'd first try plyr and see if it's efficient enough,
library(plyr)
listOfFiles <- list.files(pattern= ".txt")
d <- ldply(listOfFiles, read.table)
str(d)
alternatively,
d <- do.call(rbind, lapply(listOfFiles, read.table))
HTH,
baptiste
On 13 May 2009, at 12:45, SYKES, Jennifer wrote:
Alternatively,
signif(c(pi,exp(1)), 3)
?signif # and others in that page
HTH,
baptiste
On 14 May 2009, at 13:47, jim holtman wrote:
Depending on what you want to do, use 'sprintf':
x <- 1.23456789
x
[1] 1.234568
as.character(x)
[1] "1.23456789"
sprintf("%.1f %.3f %.5f", x,x,x)
[1]
On 15 May 2009, at 10:01, Prof Brian Ripley wrote:
On Fri, 15 May 2009, Dieter Menne wrote:
Stats Wolf gmail.com> writes:
Postscript, however, does not have to be what I need for two
reasons.
First, it does not accept some special characters from foreign
languages (exactly like PDF).
'
If you're desperate for a workaround, you might want to try this
example using pgfSweave,
http://ggplot2.wik.is/Mathematical_annotations
On a similar vein, you could try psfrag replacements with a postscript
device (there is some code for this on the list archives).
Feel free to comment /
I'd suggest you first combine the 12 data.frames into one, using
melt() from the reshape package.
makeDummy <- function(.){ # since you don't provide a reproducible
example
data.frame(x=letters[1:10], y=rnorm(10))
}
listOf12DataFrames <- lapply(1:12, makeDummy)
library(re
Dear list,
This might be a topic for r-devel but i may be missing something
obvious.
I don't understand the rationale in the absolute sizes of the point
symbols, and I couldn't find it documented. The example below uses
Grid to check the size of the symbols against a square of 10mm x 10mm
Hi,
Perhaps you can try this,
seq.weave <- function(froms, by, length, ... ){
c(
matrix(c(sapply(froms, seq, by=by, length = length/2, ...)),
nrow=length(froms), byrow=T)
)
}
seq.weave(c(2, 3), by=3, length=8)
seq.weave(c(2, 3, 4), by=
Try this and see if it helps (if not, please help improving it),
http://wiki.r-project.org/rwiki/doku.php?id=tips:graphics-misc:legendoutside
HTH,
baptiste
On 27 May 2009, at 20:31, Wade Wall wrote:
Hi all,
I have been trying to figure out how to place a legend beside a plot,
rather than w
recycling rule: repeat the shorter element as many times as necessary,
all.equal(1:2 + 1:10 , rep(1:2, length=10) + 1:10)
# TRUE
HTH,
baptiste
On 28 May 2009, at 22:00, bogaso.christofer wrote:
I have following addition :
1:2 + 1:10
[1] 2 4 4 6 6 8 8 10 10 12
I could not unde
Dear all,
I'm trying to access and modify grobs in a ggplot2 plot. The basic
idea for raw Grid objects I understand from Paul Murrell's R graphics
book, or this page of examples,
http://www.stat.auckland.ac.nz/~paul/grid/copygrob/copygrobs.R
However I can't figure out how to apply this to
I'm not sure it's currently possible with ggplot2 (lattice and
latticeExtra offer some workarounds for this).
Perhaps you can try this,
http://wiki.r-project.org/rwiki/doku.php?id=tips:graphics-ggplot2:sharelegend
(neater here: )
http://learnr.wordpress.com/2009/05/26/ggplot2-two-or-more-plo
you can use title() with the sub argument,
title(sub="x label", outer=T) # you might want to play around with
line argument
baptiste
On 1 Jun 2009, at 22:03, Andre Nathan wrote:
Hello
On Wed, 2009-05-27 at 13:38 -0600, Greg Snow wrote:
Create an outer margin (see ?par), then use mtext to
H,
baptiste
On 1 Jun 2009, at 22:30, Andre Nathan wrote:
> On Mon, 2009-06-01 at 22:24 +0200, baptiste auguie wrote:
>> you can use title() with the sub argument,
>>
>> title(sub="x label", outer=T) # you might want to play around with
>> line argument
&
your data *seems* to have an unusual decimal separator. That would
explain why the two-step conversion to numeric fails, while the brute
conversion to numeric always gives the factor integer codes.
I don't know where your data comes from (str() would be helpful in any
case), but if you read
of course, this only applies if you have,
getOption("OutDec") == "."
In any case, follow David's suggestions.
baptiste
On 1 Jun 2009, at 23:20, baptiste auguie wrote:
your data *seems* to have an unusual decimal separator. That would
explain why the two-step co
Perfect, thank you!
Thanks also to Gabor G. for the links.
baptiste
On 2 Jun 2009, at 01:30, Paul Murrell wrote:
Hi
baptiste auguie wrote:
Dear all,
I'm trying to access and modify grobs in a ggplot2 plot. The basic
idea
for raw Grid objects I understand from Paul Murrell's
Dear all,
I feel like I've been reinventing the wheel with this code (implementing
type = 'b' for Grid graphics),
http://econum.umh.ac.be/rwiki/doku.php?id=tips:graphics-grid:linesandpointsgrob
Has anyone here attempted this with success before? I found suggestions
of overlapping large white
Jonathan Williams wrote:
Dear R-helpers,
I have been trying to figure out how to plot a graph with an axis label
consisting of a mixture of Latin, Greek and subscript characters.
Specifically, I need to write A[beta]{1-42}, where A is Latin script A,
[beta] is Greek lower case beta and {1-42} is
Ben Bolker wrote:
amor Gandhi wrote:
Hi,
I have gote the following data
x1 <- c(rep(1,6),rep(4,7),rep(6,10))
x2 <- rnorm(length(x1),6,1)
data <- data.frame(x1,x2)
and I would like to compute the mean of the x2 for each individual of x1,
i. e. x1=1,4 and 6?
You'll probably get sev
Marie Sivertsen wrote:
Dear list,
I have a vector of elements which I want to combined each with each, but
none with itself. For example,
v <- c("a", "b", "c")
and I need a function 'combine' such that
combine(v)
[[1]]
[1] "a" "b"
[[2]]
[1] "a" "b"
[[3]]
[1] "b" "c"
I a
Dear list,
I'm quite surprised by this,
unit(1:5,"char")[-c(1:2)]
#4char 3char # what's going on??
while I expected something like,
c(1:5)[-c(1:2)]
# 3 4 5
Note that,
unit(1:5,"char")[c(1:2)]
# 1char 2char # fine
?unit warns about unit.c for concatenating, but also says,
It is possible
jim holtman wrote:
try this:
Oh well, i spent the time writing this so i might as well post my
(almost identical) solution,
x<-c(1:3, 6: 7, 10:13)
breaks = c(TRUE, diff(x) != 1)
data.frame(start = x[breaks], length = tabulate(cumsum(breaks)))
Hoping this works,
baptiste
x
[1
Paul Murrell wrote:
Hi
The bug is now fixed in the development version
(thanks to Duncan for the diagnosis and suggested fix).
Paul
Thank you both for your help and dedication!
Best regards,
baptiste
--
_
Baptiste Auguié
School of Physics
University of Exe
Kenny Larsen wrote:
Hi,
A fairly basic problem I think, here although searching the inetrnet doesn't
seem to reveal a solution. I have a dataset with two columns of real
numbers. It is read in via read.table. I simply need to square the data in
the second column and then plot it. I have tried ex
I knew I had seen this in action! But as you mention, most pages only
display ~~RDOC~~ at the moment.
I second the idea of using the wiki for such collaborative work. If the
current (r-devel) version of all help pages could be automatically
copied to the wiki, users would have a convenient way t
Kenny Larsen wrote:
Hi All,
I have hunted high and low and tried dozens of things but have yet to
achieve the result I require. Below is my code (taken mostly from another
thread on here) thus far:
files<-list.files()
files<-files[grep('.wm4', files)]
labels<-gsub('.wm4', '',files)
for(i in 1:
Hi,
the grImport package provides some functionality for svg and postscript
graphics,
http://cran.r-project.org/web/packages/grImport/index.html
Best,
baptiste
Robbie Morrison wrote:
Dear R-help
I want to display an image file in a new plot frame.
SVG is my preferred format, but I ca
Hi,
I tend to use a slightly modified version of stats::relevel, (from an
old thread on this list),
relevel =
function (x, ref, ...)
{
lev <- levels(x)
if (is.character(ref))
ref <- match(ref, lev)
if (any(is.na(ref)))
stop("'ref' must be an existing level")
nlev <- length(
Commenting on this, is there a strong argument against modifying
relevel() to reorder more than one level at a time?
I started a topic a while back ("recursive relevel",
https://stat.ethz.ch/pipermail/r-help/2009-January/184397.html) and I've
happily used the proposed change since then by over
For the sake of brevity, I like to use this trick,
plot(0, 0)
mtext(~"Monthly Precipitation (mm x "*10^2*"/month)")
HTH,
baptiste
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide htt
utkarshsinghal wrote:
Hi Jim,
What you are saying is correct. Although, my computer might not have
same speed and I am getting the following for 10M entries:
user system elapsed
0.559 0.038 0.607
Moreover, in the case of character vectors, it gets more than double.
In my modeling,
201 - 300 of 738 matches
Mail list logo