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 #
Hi,
I used to be able to start a specific R version with M-x R-... but it
doesn't work anymore. On M-x R- I see:
R-devel
R-initialize-on-start
R-mode
R-newest
R-transcript-mode
... but no R-4.0.x. I have R-4.0.0, R-4.0.2, R-4.0.3 and R-devel
installed and M-x R-devel and M-x R-newest correctly
Hi,
As I reported on https://github.com/emacs-ess/ESS/issues/883 (last
post), I'm (still) affected by the randomly appearing error "error in
process sentinel: Not enough arguments for format string" and related
'freezing' of Emacs (which is especially popular when teaching in
front of 300
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.
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
Hi,
I realized that in the current snapshot version of ESS (18.10.3), C-c
C-o C-o (for Roxygen function headers) does not work as expected
anymore (on macOS 10.14.5) in the following case (and others):
fun1 <- function(x) x
fun2 <- function(x) x
If the point is right before the "f" (so column
r "<-" seems weird to me and not everyone likes
to make adjustments to .emacs just to get basic functionality (... and
thus probably switches to RStudio...).
Cheers,
Marius
--
Marius Hofert, Dr. rer. nat.
Assistant Professor
Department of Statistics and Actuarial Science
Faculty
> On Fri 22 Jun 2018 at 09:50, Marius Hofert via ESS-help
> wrote:
>
> > Hi,
> >
> > ESS (version 16.10-1 but also earlier) gives the following indentation
> > for switch statements in r:
> >
> > f <- function(method = c("foo", "bar"))
Hi,
ESS (version 16.10-1 but also earlier) gives the following indentation
for switch statements in r:
f <- function(method = c("foo", "bar"))
{
switch(match.arg(method),
"foo" = { # (*)
cat("Will use 'method' = \"foo\".\n")
},
"bar" = {
cat("Will use
Hi,
Here is some R code, that, when put in an R script (.R), shows some
strange behaviour (see sessionInfo() etc. below) under ess-version:
16.10-1.
(foo <- matrix(rnorm(100), ncol = 5))
L <- matrix(c(2, 0, 0,
6, 1, 0,
-8, 5, 3), ncol = 3, byrow = TRUE)
Sigma <- L %*%
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
On Mon, Aug 29, 2016 at 7:59 PM, Duncan Murdoch
<murdoch.dun...@gmail.com> 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
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
: 29-08-2016 11:59
> To: Marius Hofert
> Cc: R-help
> Subject: Re: [R] How to split a data.frame into its columns?
>
>
>> On Aug 28, 2016, at 11:14 PM, Marius Hofert <marius.hof...@uwaterloo.ca>
>> wrote:
>>
>> Hi,
>>
>> I need a fast way t
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
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',
l = adjustcolor("grey80", alpha.f = 0.5))
par(xpd = FALSE)
On Fri, Jun 24, 2016 at 8:40 PM, Marius Hofert
<marius.hof...@uwaterloo.ca> wrote:
> Hi Jim,
>
> Thanks a lot, exactly what I was looking for.
>
> Cheers,
> Marius
>
>
>
> On Thu, Jun 23, 2016 a
t; par(xpd=FALSE)
>
> 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"
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
##
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
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.
://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 marius.hof...@math.ethz.ch
wrote:
Dear expeRts,
I would like to find out how R computes pbinom(). A grep in the
source code reveiled src/library/stats/R
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
marius.hof...@math.ethz.ch wrote:
Dear Sarah, Dear David,
thanks for helping. I know the FAQ and I know the R News article, but
I
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?
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-8
Hi,
... so something like this? [in foo.R]
old.coll - Sys.getlocale(LC_COLLATE)
Sys.setlocale(LC_COLLATE, locale=C)
do_your_sorting_here
Sys.setlocale(LC_COLLATE, locale=old.coll)
Cheers,
Marius
__
R-help@r-project.org mailing list
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 already
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
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
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
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 dataframe is
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),
$num)] - 0
tply
Marius Hofert writes:
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
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 =
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 .Random.seed from signed to unsigned so
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
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
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
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
successfully. 0 failed.
.t - snow::clusterSetupRNG(cl, seed=.Random.seed[2:7])
stopCluster(cl)
Hana
On 1/22/13 4:53 PM, Marius Hofert wrote:
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
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
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)#,
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
:
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 period) although the yahoo.finance website tells me
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}
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
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' (nice-looking, easy-to-read) setup for the LaTeX package
'listings' to display R code?
The two versions below are partly inspired
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 the diagram properly.
Paul
On 20/10/12 19:10, Marius Hofert
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
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(0.1,
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 even
Dear Paul,
Many thanks, that solved it.
Cheers,
Marius
Paul Murrell p.murr...@auckland.ac.nz 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(.., type=b) like below
...@stat.auckland.ac.nz writes:
Hi
On 25/09/12 11:50, Marius Hofert wrote:
Dear Paul,
Thanks for helping. Is there a way to call grid() first? The problem seems
to be
that everything drawn before grid() is overplotted.
No, but you can redraw the points ...
require(grid)
require(gridBase)
pdf(file
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) s else n)
upViewport()
}
}
par(par.)
dev.off()
Paul Murrell p...@stat.auckland.ac.nz writes:
Hi
On 24/09/12 09:36, Marius Hofert wrote:
Hi
Controllers) .OO#. .OO#. rocks...1k
---
Sent from my phone. Please excuse my brevity.
Marius Hofert marius.hof...@math.ethz.ch wrote:
Dear Paul,
Thank you for helping. This works great.
I then tried to put
()
}
}
par(par.)
dev.off()
Paul Murrell p...@stat.auckland.ac.nz writes:
Hi
On 24/09/12 18:06, Marius Hofert wrote:
Dear Paul,
Thank you for helping. This works great.
I then tried to put in a grid (via grid()). Why does that fail?
Because grid() is used to add lines to an existing
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?
Bert Gunter gunter.ber...@gene.com writes:
Inline below.
On Sun, Sep 23, 2012 at 1:41 AM, Marius Hofert
marius.hof...@math.ethz.ch 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
Ahh, now I see what you mean... Thanks, that indeed works.
Cheers,
Marius
Marius Hofert marius.hof...@math.ethz.ch writes:
Bert Gunter gunter.ber...@gene.com writes:
Inline below.
On Sun, Sep 23, 2012 at 1:41 AM, Marius Hofert
marius.hof...@math.ethz.ch wrote:
Dear grid expeRts,
I
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),
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
Thanks, Berend, that works.
Cheers,
Marius
Berend Hasselman b...@xs4all.nl 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 the sessionInfo() command provides details
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
Dear Bill,
Thanks a lot for your quick reply, that was exactly what I was looking for.
Cheers,
Marius
William Dunlap wdun...@tibco.com 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
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
Duncan Murdoch murdoch.dun...@gmail.com 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
Dear Duncan,
many thanks for helping. It works fine.
Cheers,
Marius
Duncan Murdoch murdoch.dun...@gmail.com 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://stat.ethz.ch/pipermail/r-help/2012
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
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) # append
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) - c(gr1.sgr1, gr1.sgr2, gr2.sgr1, gr2.sgr2)
rn - apply(expand.grid(beta=c(0.25, 0.75), n=c
(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*500), ncol=4)
pairs(U, panel=mypanel, diag.panel=mydiag.panel)
Marius Hofert marius.hof
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 know a solution?
Cheers
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.5,
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 -
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, black, green)
count - 0
, 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
Marius Hofert wrote on 12/31/2011 05:02:22 AM:
Dear expeRts,
I
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(dimnames(a.df)) # =
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
rgl.postscript(myplot.pdf, fmt=pdf) # print to file
rgl.viewpoint(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
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,
thanks for your quick response.
Below
, Marius Hofert wrote:
Dear all,
Below is some code where I try to get plotmath symbols in an rgl plot. Duncan
Murdoch kindly suggested to use a sprite for this. As you can see, on can
get
it to work, but my knowledge about grid and rgl is too limited to perfectly
solve the problem.
1) As you
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 create a third data frame from two
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)
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 -
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 aligned
with
the other labels?
library(lattice
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
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
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 you can see
HTH,
Dennis
On Tue, Jun 21, 2011 at 3:13 PM, Marius Hofert m_hof...@web.de wrote:
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
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 wrote:
Hi
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 column
:13 PM, Marius Hofert m_hof...@web.de wrote:
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
won't work for symbols, as noted above.
Dennis
On Thu, Jun 2, 2011 at 3:50 PM, Marius Hofert m_hof...@web.de wrote:
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
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 I
, 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 m_hof...@web.de wrote:
Dear all,
consider the following plot:
plot(1:5, 5:1, xaxt=n)
axis(1, at=1:5, labels=c(1,2
1 - 100 of 219 matches
Mail list logo