Dear expeRts,
I'm familiar with IEEE 754. Is there an easy way to explain why even
just printing of small numbers fails?
1e-317 # 1e-317 => fine
1e-318 # 9.87e-319 => gets tricky; seems to call print() => as.character()
=> format() => paste()
1e-318 == 9.87e-319 # TRUE
2.48e-324 # prints
On Tue, Sep 10, 2019 at 12:38 PM Martin Maechler
wrote:
>
> >>>>> Marius Hofert
> >>>>> on Mon, 9 Sep 2019 22:38:38 +0200 writes:
>
> > Hi,
> > I typically start R with "--no-restore --no-save" (to avoid .RData
>
Hi,
I typically start R with "--no-restore --no-save" (to avoid .RData
files being written) and would like to have the same behavior under 'R
CMD BATCH'. I use R_BATCH_OPTIONS="--no-restore --no-save" in my
~/.Renviron but running an R script with 'R CMD BATCH' still produces
a .RData file. What's
Hi,
1) Given .Random.seed, how can one compute *the* integer 'seed' such
that set.seed(seed) generates .Random.seed?
2) If 1) is not possible, how can one compute *an* integer 'seed' from
a given .Random.seed such that different .Random.seed's are guaranteed
to give different integers 'seed' (or a
Hi Duncan,
... I don't have to know (I thought). The idea was to set up the environment
only for a single object x. If it (= the environment (see MWE 2) *or* the object
(see MWE 1)) exists, it's the right one. But I agree that it's 'cleaner' to work
with a hash -- yet I first wanted to understand
anks & cheers,
Marius
On Mon, Aug 29, 2016 at 7:59 PM, Duncan Murdoch
wrote:
> On 29/08/2016 1:36 PM, Marius Hofert wrote:
>> Hi,
>>
>> I have a function main() which calls another function aux() many times. aux()
>> mostly does the same operations based on an obje
Hi,
I have a function main() which calls another function aux() many times. aux()
mostly does the same operations based on an object and thus I would like it to
compute and store this object for each call from main() only once.
Below are two versions of a MWE. The first one computes the right res
Hi David and Jeff,
Thanks for your quick help, unclass() was precisely what I was looking for.
Cheers,
M
On Mon, Aug 29, 2016 at 10:39 AM, aditya pant wrote:
>
> ^^ठश्रएइ),,,
>
> From: David Winsemius
> Sent: 29-08-2016 11:59
> To: Marius H
Hi,
I need a fast way to split a data.frame (and matrix) into a list of
columns. For matrices, split(x, col(x)) works (which can then be done
in C for speed-up, if necessary), but for a data.frame? split(iris,
col(iris)) does not work as expected (?).
The outcome should be lapply(seq_len(ncol(iris
On Mon, Jun 27, 2016 at 5:42 PM, Greg Snow <538...@gmail.com> wrote:
> You can use the grconvertX and grconvertY functions to find the
> coordinates (in user coordinates to pass to rect) of the figure region
> (or other regions).
>
> Probably something like:
> grconvertX(c(0,1), from='nfc', to='use
col = adjustcolor("grey80", alpha.f = 0.5))
par(xpd = FALSE)
On Fri, Jun 24, 2016 at 8:40 PM, Marius Hofert
wrote:
> Hi Jim,
>
> Thanks a lot, exactly what I was looking for.
>
> Cheers,
> Marius
>
>
>
> On Thu, Jun 23, 2016 at 11:06 PM, Jim Lemon wrote:
>
gt; Finally your second example simply multiplies the first problem by
> specifying a layout of more than one plot. Applying the "xaxs" and
> "yaxs" parameters before you start plotting will fix this:
>
> par(xaxs="i",yaxs="i")
>
> Jim
>
&g
Hi,
I would like to replicate the behavior of box() with rect() (don't ask why).
However, my rect()angles are always too small. I looked a bit into the
internal C_box but
couldn't figure out how to solve the problem. Below is a minimal
working (and a slightly bigger) example.
Cheers,
Marius
## M
Hi,
Inside a C function (foo()), I need to call R's order(). Writing R
Extensions (2014, Section 6.10) gave me the hint to use
R_orderVector() for this task. The third argument of this function
needs an SEXP containing (in my case) the vector x (of which I would
like to determine order()).
My que
Dear Professor Ripley,
Thank you for your reply.
Do you specify \u21A6 via something like this?
plot(1, main=expression(symbol("\u21A6")))
This gives an the 'registered trademark symbol' (circled R) for me
(also cairo-based Linux).
Thanks and cheers,
Marius
___
Hi,
Is there a plotmath symbol like LaTeX's \mapsto?
I need this comparably often, for example if you want to plot a
two-place function in one variable (and thus would like to have
ylab="t \mapsto f(t,s)", for example). If there is such a symbol, I'd
be great to have it as an example on ?plotmath.
Dear Ranjan,
thanks, that was what I was looking for. Somehow my 'grep' must have
missed that.
Cheers,
Marius
On Wed, Aug 27, 2014 at 8:34 AM, Marius Hofert
wrote:
> Dear Sarah, Dear David,
>
> thanks for helping. I know the FAQ and I know the R News article, but
> I st
4 at 7:28 AM, Sarah Goslee wrote:
> R FAQ 7.40
>
> http://cran.r-project.org/doc/FAQ/R-FAQ.html#How-do-I-access-the-source-code-for-a-function_003f
>
> Sarah
>
>
> On Tuesday, August 26, 2014, Marius Hofert
> wrote:
>>
>> Dear expeRts,
>>
>> I w
Dear expeRts,
I would like to find out how R computes pbinom(). A grep in the
source code reveiled src/library/stats/R/distn.R:146:
.External(C_pbinom, q, size, prob, lower.tail, log.p), so
'C_pbinom' refers to compiled C/C++ code loaded into R. Where can
I find the source code of C_pbinom?
Cheer
Hi,
... so something like this? [in foo.R]
old.coll <- Sys.getlocale("LC_COLLATE")
Sys.setlocale("LC_COLLATE", locale="C")
Sys.setlocale("LC_COLLATE", locale=old.coll)
Cheers,
Marius
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/
Hi,
Thanks for you help. I use R-devel under Ubuntu 14.04, here is the output of
sessionInfo():
> sessionInfo()
R Under development (unstable) (2014-06-02 r65832)
Platform: x86_64-unknown-linux-gnu (64-bit)
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8LC_C
Hi,
If I use invisible(Sys.setlocale("LC_COLLATE", "C")) in ~/.Rprofile, then
> sort(c("L.Y", "Lu", "L.Q"))
[1] "L.Q" "L.Y" "Lu"
whereas using invisible(Sys.setlocale("LC_COLLATE", "en_US.UTF-8")) results in
> sort(c("L.Y", "Lu", "L.Q"))
[1] "L.Q" "Lu" "L.Y"
I know this issue has appeared alr
Dear Bert,
Thanks for helping.
Your questions 'answers' why I get the expected behavior if
'group' is a factor. My question was why I don't get the expected
behavior if 'group' is not a factor.
>From a theoretical (non-programming) point of view, there is no
difference in a factor with two level
Dear expeRts,
If I specify group = as.factor(rep(1:2, each=n)) in the below
definition of dat, I get the expected behavior I am looking for. I
wonder why I
don't get it if group is *not* a factor... My guess was that,
internally, factors are treated as natural numbers (and this indeed
seems to be
Hi,
?.Machine says that 'double.xmin' is 'the smallest non-zero normalized
floating-point number'. On my machine, this is 2.225074e-308. However,
2.225074e-308 / 2 is > 0 and smaller than 2.225074e-308, so
double.xmin is not the smallest such number (?) Am I missing anything?
Cheers,
Marius
___
exp(-x) being not quite 0, but x=746
leads to exp(-x)==0 being TRUE. But these are integer x's...
Many thanks and cheers,
Marius
>
> Bill Dunlap
> Spotfire, TIBCO Software
> wdunlap tibco.com
>
>
>> -Original Message-----
>> From: r-help-boun...@r-project.or
Dear expeRts,
I would like to create a Q-Q plot including a Q-Q line for Gamma
distributed data.
The specialty is that it should be in log-log scale. For Q-Q line in
log-log scale,
I discovered the argument 'untf' of abline. As you can see in 2), this
works fine.
But for 3) it does not provide the
>
> I'm no expeRt, but suppose that we change the setup slightly:
>
> xx <- x[sample(nrow(x)), ]
>
> Now what would you like
>
> aggregate(value ~ group + year, data=xx, FUN=function(z) z[1])
>
> to return?
>
> Personally, I prefer to have R return the same thing regardless
> of how the input da
Dear expeRts,
The question is rather simple: Why does aggregate (or similarly tapply()) not
keep the order of the grouping variable(s)?
Here is an example:
x <- data.frame(group = rep(LETTERS[1:2], each=10),
year = rep(rep(2001:2005, each=2), 2),
value = rep(1:1
tply, by=c("group", "year"), all=TRUE) # merge the two
data.frames
tply$num[is.na(tply$num)] <- 0
tply
Marius Hofert <> writes:
> Dear expeRts,
>
> I have a data.frame with certain covariate combinations ('group' and 'year')
>
Dear expeRts,
I have a data.frame with certain covariate combinations ('group' and 'year')
and corresponding values:
set.seed(1)
x <- data.frame(group = c(rep("A", 4), rep("B", 3)),
year = c(2001, 2003, 2004, 2005,
2003, 2004, 2005),
Thanks a lot, Duncan, that solved it!
Cheers,
Marius
Duncan Murdoch writes:
> On 13-01-24 2:09 AM, Marius Hofert wrote:
>> Dear Daniel,
>>
>> That's exactly what I also suspected (last post). The question now seems how
>> to
>> correctly convert .Rando
Dear Daniel,
That's exactly what I also suspected (last post). The question now seems how to
correctly convert .Random.seed from signed to unsigned so that it is accepted by
the rlecuyer package.
Cheers,
Marius
__
R-help@r-project.org mailing list
ht
Dear Hana,
Thanks for helping.
I am still wondering, why m1 (which should be 2^32-209 [see line 34 in
./src/RngStream.c]) is -767742437 in my case and why the minimal example you
gave was working for you but isn't for me.
Apart from that, ?.Random.seed -> "L'Ecuyer-CMRG" says:
,
| The 6 ele
Since clusterSetupRNG() calls clusterSetupRNGstream() and this calls
.lec.SetPackageSeed(), I could further minimalize the problem:
set.seed(1)
RNGkind("L'Ecuyer-CMRG") # => .Random.seed is of length 7 (first number encodes
the rng kind)
(seed <- .Random.seed[2:7]) # should give a valid seed for
I updated to the latest CRAN versions of 'rlecuyer', 'Rmpi', and 'snow':
,[ sessionInfo() ]
| ...
| other attached packages:
| [1] rlecuyer_0.3-3 Rmpi_0.6-1 snow_0.3-10
| ...
`
But I still obtain:
,
| Error in .lec.SetPackageSeed(seed) :
| Seed[1] >= -1065242851, Seed i
;> library(snow)
>> RNGkind("L'Ecuyer-CMRG")
>> cl <- makeCluster(parallel::detectCores(), type="MPI")
> 4 slaves are spawned successfully. 0 failed.
>> .t <- snow::clusterSetupRNG(cl, seed=.Random.seed[2:7])
>> stopCluster(cl)
>
>
Dear expeRts,
I struggle with the following problem using snow clusters for parallel
computing: I would like to specify l'Ecuyer's random number generator. Base R
creates a .Random.seed of length 7, the first value indicating the kind fo
random number generator. I would thus like to use the com
Dear expeRts,
Here is a minimal example with the latest version of 'tables' (questions below):
require(tables)
saveopts <- table_options(toprule="\\toprule", midrule="\\midrule",
bottomrule="\\bottomrule",
titlerule="\\cmidrule(lr)",
rowlabeljustification="r")#, justi
Dear expeRts,
I have two matrices A and B. They have the same number of columns but possibly
different number of rows. I would like to compare each row of A with each row
of B and check whether all entries in a row of A are less than or equal to all
entries in a row of B. Here is a minimal work
gt; On Fri, 23 Nov 2012, Marius Hofert wrote:
>
>> Dear expeRts,
>>
>> I would like to download a time series of historical data from the ticker
>> with
>> symbol "ROG.VX". Interestingly, I obtain constant values (138.3 for each day
>> in the chosen p
Dear expeRts,
I would like to download a time series of historical data from the ticker with
symbol "ROG.VX". Interestingly, I obtain constant values (138.3 for each day in
the chosen period) although the yahoo.finance website tells me that the time
series is not at all constant. What's wrong?
Dear expeRts,
I'm trying to use the package SweaveListingUtils, but the rather minimal example
below leads to
,
| ./minimal.tex:43: Undefined control sequence.
| l.43 \lstdefinelanguage
|{Rd}[common]{TeX}%
| ?
`
Why?
Cheers,
Marius
\documentclass[article]{jss}
ell
> wrote:
>> The knitr package makes this relatively easy to do. See for example
>> http://biostat.mc.vanderbilt.edu/KnitrHowto
>>
>> Frank
>>
>>
>> Marius Hofert-3 wrote
>>> Dear expeRts,
>>>
>>> What's a 'good
Dear expeRts,
What's a 'good' (nice-looking, easy-to-read) setup for the LaTeX package
'listings' to display R code?
The two versions below are partly inspired by the settings of the package
SweaveListingUtils and
http://r.789695.n4.nabble.com/R-How-to-format-R-code-in-LaTex-documents-td816055.ht
ith the diagram.
> If you change your grid.show.layout() call to the following (which "removes"
> the
> normal margin used by grid.show.layout()) ...
>
> grid.show.layout(gl, vp=viewport(width=1.25, height=1.25))
>
> ... then you should find your viewports line up with
Please note:
1) your example is not working in the way you provided it (see
http://www.minimalbeispiel.de/mini-en.html)
2) you receive a warning, not an error
3) I'd try and debug qua.regressCOP2 to see why the warning appears
4) in case 3) does not help, contact the maintainer of copBasic (Willia
In the meanwhile, I found a more minimal example which shows the problem (just
change 'inch' to TRUE to see the difference):
require(grid)
inch <- FALSE # TRUE
d <- if(inch) 5 else 1
pspc <- d*c(0.3, 0.3) # width, height of panels
spc <- d*c(0.05, 0.05) # width, height of space
axlabspc <- d*c(
Dear grid-expeRts,
The goal:
I would like to construct a plot (matrix) with grid and gridBase,
which consists of four "sub-plots". The sub-plots should have a square plotting
region as one would force with par(pty="s") in base graphics.
The problem:
I don't get a square plotting region, not eve
Dear Paul,
Many thanks, that solved it.
Cheers,
Marius
Paul Murrell writes:
> Hi
>
> On 25/09/2012 6:10 p.m., Marius Hofert wrote:
>> Dear Paul,
>>
>> Thanks. Redrawing the points solves it for the minimal example, but
>> what happens if you have plot(..,
="n", yaxt="n")
grid(col="white", lty="solid", lwd=1.6, equilogs=FALSE) # background
grid
upViewport()
}
}
par(par.)
dev.off()
Paul Murrell writes:
> Hi
>
> On 25/09/12 11:50, Marius Hofert wrote:
>> Dear Paul,
>>
>
frame.plot=FALSE, xaxt="n", yaxt="n")
grid(col="white", lty="solid", lwd=1.6, equilogs=FALSE) # background
grid
upViewport()
}
}
par(par.)
dev.off()
Paul Murrell writes:
> Hi
>
> On 24/09/12 18:06, Marius Hofert wrote:
Embedded Controllers) .OO#. .OO#. rocks...1k
> ---
> Sent from my phone. Please excuse my brevity.
>
> Marius Hofert wrote:
>
>>Dear Paul,
>>
>>Thank you for helping. T
par(plt=gridPLT())
## plot
par(new=TRUE) # always do this before each new 'graphics' plot
grid(col=1)
plot(1:10, 1:10, log="y", xlab="", ylab="",
xaxt=if(i==2) "s" else "n", yaxt=if(j==1) &q
Hi,
Why does the upper left panel (in the plot below) not have a gray background?
Cheers,
Marius
require(grid)
require(gridBase)
pdf(file="Rplot.pdf", width=8, height=8, onefile=FALSE)
## set up the grid layout
gl <- grid.layout(5, 5, widths=unit(c(1.8, 8, 0.8, 8, 0.8), "cm"),
Ahh, now I see what you mean... Thanks, that indeed works.
Cheers,
Marius
Marius Hofert writes:
> Bert Gunter writes:
>
>> Inline below.
>>
>> On Sun, Sep 23, 2012 at 1:41 AM, Marius Hofert
>> wrote:
>>> Dear grid expeRts,
>>>
>>>
Bert Gunter writes:
> Inline below.
>
> On Sun, Sep 23, 2012 at 1:41 AM, Marius Hofert
> wrote:
>> Dear grid expeRts,
>>
>> I would like to create a layout with grid that looks like the following, but
>> with cells (1,1), (1,4), (4,1), and (4,4) removed and
Dear grid expeRts,
I would like to create a layout with grid that looks like the following, but
with cells (1,1), (1,4), (4,1), and (4,4) removed and cells (2,1) and (3,1)
(and (4,2) and (4,3)) combined to one cell (so that contents can easily be
centered.
How can this be achieved?
requir
Thanks, Berend, that works.
Cheers,
Marius
Berend Hasselman writes:
> On 22-09-2012, at 19:32, Marius Hofert wrote:
>
>> Hi,
>>
>> What's the best approach to determine if a user uses an R version before
>> 2.15.1
>> patched?
>> I know that
Hi,
What's the best approach to determine if a user uses an R version before 2.15.1
patched?
I know that the sessionInfo() command provides details, but I'm not sure how
the output of sessionInfo() is best used to determine R versions. This seems to
work, but a) there is certainly a better way and
Dear Bill,
Thanks a lot for your quick reply, that was exactly what I was looking for.
Cheers,
Marius
William Dunlap writes:
> Does ave() do what you want?
> y. <- ave(x$value, x$x1, x$x2, FUN=function(x)x)
>
> Bill Dunlap
> Spotfire, TIBCO Software
> wdunlap tibco.com
>
>
Hi,
I try to apply a function to subsets of a data.frame. tapply() does the job, but
the as output, I am looking for a vector (not an array/matrix) ordered in the
same way as the original data, so I can simply cbind the result to the original
data.frame. Below is a minimal example.
I know that th
Duncan Murdoch writes:
>
> The + means concatenation, so that spec says to put the RowFactor above the
> d*beta rows. Not sure why that causes an error, but it's likely because
> you've
> got the wrong number of items.
>
> This should work, but it doesn't give you the extra spacing properly.
I have the data frame...
df <- cbind(expand.grid(d=as.factor(c(2,5)), n=c(100, 200),
beta=as.factor(c(0.2, 0.8)), group=LETTERS[1:2]), value=runif(16))
... which I would like to display in a table like ...
require(tables)
tabular(d * beta ~ group * mean * Heading() * value, data=df)
Now I would
Dear Duncan,
many thanks for helping. It works fine.
Cheers,
Marius
Duncan Murdoch writes:
> On 12-08-19 3:47 PM, Marius Hofert wrote:
>> Dear Duncan,
>>
>> I recently asked a question concerning patchDVI on r-help, see
>>
>> ,
>> | https://st
Dear expeRts,
I have a master file master.tex containing the preamble and which inputs (via
\input{chapter01}, \input{chapter02}, ...) chapters. The chapters are .Rnw
files. My goal is to use patchDVI::SweavePDF to compile the chapters (say,
chapter.Rnw) individually (each chapter starts with sour
ted due to "cgroup", but I don't know how to avoid this.
On 2012-05-02, at 09:26 , Marius Hofert wrote:
> Dear expeRts,
>
> Why does na.blank=TRUE not replace the NA's in the following LaTeX table?
>
> x <- matrix(1:72, ncol=4, nrow=8)
> colnames(x) <-
Dear expeRts,
Why does na.blank=TRUE not replace the NA's in the following LaTeX table?
x <- matrix(1:72, ncol=4, nrow=8)
colnames(x) <- c("gr1.sgr1", "gr1.sgr2", "gr2.sgr1", "gr2.sgr2")
rn <- apply(expand.grid(beta=c(0.25, 0.75), n=c(100, 500), d=c(10, 100))[,
3:1], 2, rmNames)
x <- cbind(rn, x
Okay, one simply has to use label.pos=0.5 in pairs() to get the correct
behavior.
On 2012-03-02, at 09:10 , Marius Hofert wrote:
> Dear Ilai,
>
> I tried to also adjust the diagonal panels. However, the variable names are
> not
> positioned correctly anymore. Do you
else "transparent"
ll <- par("usr")
rect(ll[1], ll[3], ll[2], ll[4], col=bg)
points(x, y, cex=0.5)
}
mydiag.panel <- function(x, ...){
ll <- par("usr")
rect(ll[1], ll[3], ll[2], ll[4], col="#FDFF65")
}
U <- matrix(runif(4*5
Dear expeRts,
I would like to colorize the backgrounds of a pairs plot according to the
respective panel number. Here is what I tried (without success):
count <- 0
mypanel <- function(x, y, ...){
count <<- count+1
bg. <- if(count %in% c(1,4,9,12)) "#FDFF65" else NA
points(x, y, cex=0
okay, I found something. Not very elegant, but it does the job:
## generate data
U <- matrix(runif(4000), ncol=4)
## define panel function for colorizing the panels
cols <- c("blue", "black", "black",
"blue", "black", "black",
"black", "black", "green",
"black", "bla
Hi,
I would like to colorize certain panels in the pairs plot below with certain
colors. How can access the panel row and column in a pairs plot to achieve this?
Cheers,
Marius
## generate data
U <- matrix(runif(4000), ncol=4)
## define panel function for colorizing the panels
mypanel <- fun
<- pmax(f(dat$x) + f(dat$y) - 10, 0)
>
> levelplot(z ~ x * y, dat,
> at=c(-1, 0.02, 1, 5, 10, 20, 50, 500, 900),
> labels=TRUE, contour=TRUE, colorkey=FALSE,
> col.regions=gray(c(0.2, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 1)))
>
> Jean
>
Dear expeRts,
I would like to color a certain region in a levelplot. The region for z <= 0.02
should have a dark gray color. Below is a minimal example. It almost does what
I want, but The region between z=0.02 and z=1 is also colored in dark gray
(instead of just the region for z <= 0.02).
How
Hi,
After applying acast() I typically have to adjust the names of the array by
hand. Is there any way to tell acast to do this automatically?
Cheers,
Marius
require(reshape2)
(df <- data.frame(a=c("a1","a2"), b=c("b1","b2"), c=c("c1","c2")))
a.df <- acast(df, a~b, value_var="c")
names(dimname
;)
par3d(windowRect=c(0,0,600,600), zoom=1.6)
rgl.snapshot("W.png", fmt="png") # print to file
On 2011-09-09, at 17:26 , Duncan Murdoch wrote:
> On 09/09/2011 11:10 AM, Marius Hofert wrote:
>> Dear all,
>>
>> Below is some code where I try to get plotmath
Dear Duncan,
thanks a lot.
Is it possible to rotate the label drawn by mtext3d, say, by 90 degrees? [a
"rot=90" did not help]
Cheers,
Marius
On 2011-09-09, at 14:32 , Duncan Murdoch wrote:
> On 09/09/2011 8:02 AM, Marius Hofert wrote:
>> Dear Duncan,
>>
>>
t(zoom=pl$zoom, fov=pl$FOV, userMatrix=pl$userMatrix,
interactive=FALSE) # set the viewpoint for the next plot to make sure it looks
the same
On 2011-09-09, at 12:41 , Duncan Murdoch wrote:
> On 11-09-09 6:18 AM, Marius Hofert wrote:
>> Dear expeRts,
>>
>> I am a new us
Dear expeRts,
I am a new user of rgl, below is my first trial to plot a simple function in
3d.
I managed to put the axes in the right locations, but:
(1) The xlab, ylab, and zlab arguments are ignored; how can I put in axes
labels?
(2) Since I removed the axes in persp3d() the viewport is too s
Dear all,
okay, I found a one liner based on mutate:
(df3 <- mutate(df1, Value=Value[order(Year,Group)] / df2[with(df2,
order(Year,Group)),"Value"]))
Cheers,
Marius
On 2011-08-18, at 20:41 , Marius Hofert wrote:
> Dear expeRts,
>
> What is the best approach to cre
Dear expeRts,
What is the best approach to create a third data frame from two given ones, when
the new/third data frame has last column computed from the last columns of the
two given
data frames?
## Okay, sounds complicated, so here is an example. Assume we have the two data
frames:
df1 <- dat
Dear all,
thanks a lot for the quick help.
Below is what I built with the hint of Nick.
Cheers,
Marius
library(plyr)
set.seed(1)
(df <- data.frame(Group=rep(c("Group1","Group2","Group3"), each=10),
Value=c(rexp(10, 1), rexp(10, 4), rexp(10,
10)))[sample(1:30,30),])
edf <-
Dear all,
First, let's create some data to play around:
set.seed(1)
(df <- data.frame(Group=rep(c("Group1","Group2","Group3"), each=10),
Value=c(rexp(10, 1), rexp(10, 4), rexp(10,
10)))[sample(1:30,30),])
## Now we need the empirical distribution function:
edf <- function(x) e
ainly dirty, but it solves the
problem :-)
Cheers,
Marius
On 2011-07-09, at 24:12 , David Winsemius wrote:
>
> On Jul 8, 2011, at 6:54 PM, Marius Hofert wrote:
>
>> Dear expeRts,
>>
>> How can I vertically adjust an axis tick label so that it is nicely alig
Dear expeRts,
How can I vertically adjust an axis tick label so that it is nicely aligned with
the other labels?
library(lattice)
xyplot(0~0, xlim=c(0,3), scales=list(x=list(at=c(1,1.1),
labels=c(expression(hat(theta)[italic(n)]),expression(theta)
## aim: move the leftmost expression up so t
Dear Petr,
thanks for your posts, they perfectly answered my questions.
Cheers,
Marius
On 2011-06-28, at 09:49 , Petr PIKAL wrote:
>>
>> Dear expeRts,
>>
>> I have two questions concerning data frames:
>> (1) How can I apply the class function to each component in a
> data.frame?
>> As yo
Dear expeRts,
I have two questions concerning data frames:
(1) How can I apply the class function to each component in a data.frame? As
you can see below, applying class to each column is not the right approach;
applying it to each component seems bulky.
(2) After transforming the data frame a b
Hi David,
thanks for the quick response. That's nice. Is there also a way without loading
an additional package? I'd prefer loading less packages if possible.
Cheers,
Marius
On 2011-06-22, at 15:38 , David Winsemius wrote:
>
> On Jun 22, 2011, at 9:19 AM, Marius Hofert
gt;>
>>> library(reshape)
>>> as.matrix(cast(df, year ~ block, fill = 0))
>>>a b c
>>> 2000 1 0 5
>>> 2001 2 4 6
>>> 2002 3 0 0
>>>
>>> Hopefully this is more helpful...
>>> Dennis
>>>
>>&g
>> 2000 1 0 5
>> 2001 2 4 6
>> 2002 3 0 0
>>
>> HTH,
>> Dennis
>>
>> On Tue, Jun 21, 2011 at 3:13 PM, Marius Hofert wrote:
>>> Dear expeRts,
>>>
>>> In the minimal example below, I have a data.frame containing three &
Dear expeRts,
In the minimal example below, I have a data.frame containing three "blocks" of
years
(the years are subsets of 2000 to 2002). For each year and block a certain
"value" is given.
I would like to create a matrix that has row names given by all years ("2000",
"2001", "2002"),
and c
) twice:
>
> plot(1:5, 5:1, xaxt="n")
> axis(1, at=1:5, labels=c(1,2,"",4,5))
> axis(1, at=3.15, tick=FALSE, labels=expression(3==beta[foo]))
>
> Sarah
>
> On Fri, Jun 3, 2011 at 7:02 AM, Marius Hofert wrote:
>> Dear all,
>>
>>
Dear all,
consider the following plot:
plot(1:5, 5:1, xaxt="n")
axis(1, at=1:5, labels=c(1,2,expression(3==beta[foo]),4,5))
the label at 3 is not nice, so consider this
plot(1:5, 5:1, xaxt="n")
axis(1, at=1:5, labels=c(1,2,expression(3==beta[foo]),4,5),
padj=c(0,0,0.18,0,0))
Now
s.character(N), where N is a number.
> That trick obviously won't work for symbols, as noted above.
>
> Dennis
>
> On Thu, Jun 2, 2011 at 3:50 PM, Marius Hofert wrote:
>> Dear all,
>>
>> How can I get a bold "1000" in the title? I would like to us
Dear all,
How can I get a bold "1000" in the title? I would like to use a variable (as
opposed to putting in "1000" directly).
library(lattice)
N <- 1000
xyplot(0~0, xlab.top=list(label=as.expression(bquote(bold("foo" ~ .(N) ~
"bar"))), font=2, cex=1.2))
## => "font=2" is ignored (of course)
pressions are not evaluated. You need a call object rather than an
> expression inside of bquote().
>
> HTH,
> Dennis
>
> On Thu, Jun 2, 2011 at 11:43 AM, Marius Hofert wrote:
>> Dear all,
>>
>> I have a vector of expressions and would like to "paste" so
k...
Cheers,
Marius
On 2011-06-02, at 22:14 , Uwe Ligges wrote:
>
>
> On 02.06.2011 20:43, Marius Hofert wrote:
>> Dear all,
>>
>> I have a vector of expressions and would like to "paste" some string to it
>> before using it in a plot:
>>
Dear all,
I have a vector of expressions and would like to "paste" some string to it
before using it in a plot:
vars <- vector("expression", 2)
vars[1] <- expression(alpha)
vars[2] <- expression(beta)
plot(0, 0, main=substitute(bold("Foo" ~~ VAR), list(VAR=vars[2]) ))
Although I tried hard, I j
Dear all,
another ftable problem, now related to formatC.
One typically would like to format entries in an ftable (adjust digits, replace
NA, ...)
before format() is applied to convert the formatted ftable to an object which
xtable can deal with. The output of xtable can then be used within a La
1 - 100 of 214 matches
Mail list logo