Re: [R] analyzing results from Tuesday's US elections

2020-11-09 Thread Alexandra Thorn
This thread strikes me as pretty far off-topic for a forum dedicated to software support on R. https://www.r-project.org/mail.html#instructions "The ‘main’ R mailing list, for discussion about problems and solutions using R, announcements (not covered by ‘R-announce’ or ‘R-packages’, see above), a

Re: [R] Mac/PC differences in lmer results

2019-06-05 Thread Alexandra Thorn
To check whether the data are being read in appropriately, what happens when you plot the distribution of each of the independent variables on the respective systems? -A On Wed, 5 Jun 2019 12:32:28 +0200 Olivier Crouzet wrote: > Hi, > > 32bit vs. 64bit systems? > > Another thing I would look

[R] Help reinstalling rgdal (Ubuntu 16.04)

2018-08-09 Thread Alexandra Thorn
Hi all, Following some updates to R that I received via Synaptic Package Manager on Ubuntu 16.04 (looks like I now have R 3.4.4-1xenial0), I have been unable to reinstall rgdal, and I need help. Initially I was getting error messages about dependencies on GDAL 1.11.4, but after following instruct

[R] working with ordinal predictor variables?

2017-10-05 Thread Alexandra Thorn
I'm trying to develop a linear model for crop productivity based on variables published as part of the SSURGO database released by the USDA. My default is to just run lm() with continuous predictor variables as numeric, and discrete predictor variables as factors, but some of the discrete variable

[R] issues with R raster temporary files

2016-06-22 Thread Alex Thorn
Hello. I am running into difficulties running some older scripts I produced in 2014 to handle raster data using the R package "raster". I have the feeling that some behavior has changed with an upgrade but don't remember what version I was using when I wrote the scripts. Can somebody help me tro

Re: [R] Automatically Remove Aliased Terms from a Model

2013-10-31 Thread Thaler,Thorn,LAUSANNE,Applied Mathematics
. - a:b), which means I have to translate a1:b1 somehow to a:b. Overall, I want to remove any continuous/quantitative predictor if any associated coefficient cannot be estimated. Is that clearer now? KR, -Thorn -Original Message- From: Eik Vettorazzi [mailto:e.vettora...@uke.de] Sen

[R] Automatically Remove Aliased Terms from a Model

2013-10-28 Thread Thaler,Thorn,LAUSANNE,Applied Mathematics
cient of a LM back to the term, something like: termFromCoef("a1") ## a1 termFromCoef("a1:b1") ## a:b With this I could simply translate the rownames from alias into the terms needed for the model update. Thanks for your help. Kind Regards, Thorn Thaler NRC Lau

[R] Use R to plot a directory tree

2013-10-24 Thread Thaler,Thorn,LAUSANNE,Applied Mathematics
tructure for spatial access methods [at least I learnt something new ;)]) Any pointer to the right function is highly appreciated. Cheers, Thorn Thaler NRC Lausanne Applied Mathematics __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman

[R] ggplot2: Remove geom

2013-07-15 Thread Thaler,Thorn,LAUSANNE,Applied Mathematics
t do that at all and I would be curious to hear these things as well. For now I am yet interested to know how I can remove layers of a plot conveniently. Thanks for your help! Kind Regards, Thorn Thaler __ R-help@r-project.org mailing list https:/

[R] gsub regex simplification

2013-05-08 Thread Thaler,Thorn,LAUSANNE,Applied Mathematics
\\U\\2", gsub("\\.", " ", gsub("\\.f", "", txt)), perl = TRUE) Thanks for your input! Kind Regards, Thorn Thaler NRC Lausanne Applied Mathematics +41 21 785 8220 __ R-help@r-project.org mailing li

[R] Sweep out control

2012-12-10 Thread Thaler,Thorn,LAUSANNE,Applied Mathematics
d <- d[-c(2, 21)] Thanks for your input, I am looking forward to your suggestions. Kind Regards, Thorn Thaler Mathematician Applied Mathematics Nestec Ltd, Nestlé Research Center PO Box 44 CH-1000 Lausanne 26 Phone: +41 21 785 8220 Fax: +41 21 785 9486

Re: [R] aggregate.formula: formula from string

2012-10-31 Thread Thaler,Thorn,LAUSANNE,Applied Mathematics
s the root cause? Thanks for your help! KR, -Thorn > -Original Message- > From: arun [mailto:smartpink...@yahoo.com] > Sent: Mittwoch, 31. Oktober 2012 13:15 > To: Thaler,Thorn,LAUSANNE,Applied Mathematics > Cc: R help > Subject: Re: [R] aggregate.formula: formula fro

[R] aggregate.formula: formula from string

2012-10-31 Thread Thaler,Thorn,LAUSANNE,Applied Mathematics
expected, and where my mistake lies? (that means in particular I am not asking for a solution of how to get the thing done - there are plenty of alternatives - but instead to understand why this very approach does not work) Thanks for your help! Kind Regards, Thorn Thaler Mathematician Applied

[R] ggplot2: legend

2012-07-03 Thread Thaler,Thorn,LAUSANNE,Applied Mathematics
(that is all the three items in one legend)? For that I tried to assign the same names to the legends but this did not work either. So any help would be highly appreciated. Kind Regards, Thorn Thaler Mathematician Applied Mathematics Nestec Ltd, Nestlé Research Center PO Box 44 CH-1000 La

Re: [R] ggplot: dodge positions

2012-07-02 Thread Thaler,Thorn,LAUSANNE,Applied Mathematics
Well, that is exactly what I wanted to have. And you were right, it had something to do with package versions. So I updated R and the plot looks exactly the way I wanted it. Thanks a lot for your help and time. KR, -Thorn > -Original Message- > From: John Kane [mailto:

Re: [R] ggplot: dodge positions

2012-07-02 Thread Thaler,Thorn,LAUSANNE,Applied Mathematics
igned meaning that all green plots seem to have a different position on the x-axis, while all the green points for x == "A" should align exactly with "A". Am I clearer now? KR, -Thorn > -Original Message- > From: John Kane [mailto:jrkrid...@inbox.com] > Sen

Re: [R] ggplot: dodge positions

2012-07-02 Thread Thaler,Thorn,LAUSANNE,Applied Mathematics
tions on the x-axis for geom_boxplot determined? Any ideas? Thanks for the help, anyways. KR, -Thorn > -Original Message- > From: John Kane [mailto:jrkrid...@inbox.com] > Sent: Montag, 2. Juli 2012 15:04 > To: Thaler,Thorn,LAUSANNE,Applied Mathematics; r-help@r-project.o

Re: [R] ggplot: dodge positions

2012-07-02 Thread Thaler,Thorn,LAUSANNE,Applied Mathematics
Yes indeed. Sorry for the typo, I just added the library(ggplot) thing afterwards and I did not check for the spelling. So it should read as library(ggplot2) and there the issue is still unsettled. Thx for pointing that out. KR, -Thorn > -Original Message- > From: Rui Ba

[R] ggplot: dodge positions

2012-07-02 Thread Thaler,Thorn,LAUSANNE,Applied Mathematics
eas? Kind Regards, Thorn Thaler Mathematician Applied Mathematics Nestec Ltd, Nestlé Research Center PO Box 44 CH-1000 Lausanne 26 Phone: +41 21 785 8220 Fax: +41 21 785 9486 __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-h

[R] Select columns of a data.frame by name OR index in a function

2011-11-03 Thread Thaler, Thorn, LAUSANNE, Applied Mathematics
valid column selectors ->8- So my question is, whether there are smarter/better/easier/more R-like ways of doing that? Any input appreciated. KR, -Thorn __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

Re: [R] lattice: index plot

2011-08-03 Thread Thaler, Thorn, LAUSANNE, Applied Mathematics
unlist(tapply(grp, grp, seq_along)) xyplot(y ~ index | factor(grp), xlab = "Index") This should work, but it seems to be a rather elaborate solution, especially since an index plot is nothing too fancy. So maybe I'm not seeing the wood for trees, but does anybody know an easier way?

[R] lattice: index plot

2011-08-02 Thread Thaler, Thorn, LAUSANNE, Applied Mathematics
f these components [i.e. xlim, ylim, xat, yat, dx and dy]; any missing component will be replaced by the corresponding default." I'd understand that if I do not specify ylim it is calculated automatically? Not a big thing though, but it seems to me t

Re: [R] Environment of a LM created in a function

2011-08-02 Thread Thaler, Thorn, LAUSANNE, Applied Mathematics
the name of the data frame is changed earlier? Finally, your suggestion with > update(models[[1]], . ~ ., data = model.frame(models[[1]])) solved all the issues (and I was wondering why I did not try it out myself, so obviously I was not seeing the wood for the trees). So, thanks a lot for

[R] Environment of a LM created in a function

2011-07-29 Thread Thaler, Thorn, LAUSANNE, Applied Mathematics
LM object within a function, which could be processed outside this particular function in the usual way? Or is it simply a bug in update? Any help highly appreciated. Thanks, -Thorn __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/

Re: [R] Ranking submodels by AIC (more general question)

2011-06-23 Thread Alexandra Thorn
rfect for making comparisons! Thanks again to everybody who's tried to help me out on this! Alexandra On Thu, 2011-06-23 at 21:29 +0200, Jan van der Laan wrote: > Alexandra, > > Have a look at add1 and drop1. > > Regards, > Jan > > > On 06/23/2011 07:32 PM, Ale

[R] Ranking submodels by AIC (more general question)

2011-06-23 Thread Alexandra Thorn
Here's a more general question following up on the specific question I asked earlier: Can anybody recommend an R command other than mle.aic() (from the wle package) that will give back a ranked list of submodels? It seems like a pretty basic piece of functionality, but the closest I've been able

Re: [R] [cleaned code] RE: AIC() vs. mle.aic() vs. step()?

2011-06-23 Thread Alexandra Thorn
On Thu, 2011-06-23 at 09:29 -0400, Alexandra Thorn wrote: > Ok, here's some example code showing how I get different output for AIC > vs. mle.aic(). Now that I've taken another look at the independent > variables, I'm wondering whether missing values in one of the vari

[R] [example code] RE: AIC() vs. mle.aic() vs. step()?

2011-06-23 Thread Alexandra Thorn
01 1 1 1 -57.34 [20,] 01 1 1 0 -56.35 Printed the first 20 best models R> AIC(lm(y1~xA)) # Model 1 above [1] -120.3801 R> AIC(lm(y1~xA+x15)) # Model 2 above [1] -110.8642 R> AIC(lm(y1~xA+x5)) # Model 3 above [1] -118.9906 On Thu, 2011-06-23 at 09:0

Re: [R] AIC() vs. mle.aic() vs. step()?

2011-06-23 Thread Alexandra Thorn
> > > Dr. Rubén Roa-Ureta > AZTI - Tecnalia / Marine Research Unit > Txatxarramendi Ugartea z/g > 48395 Sukarrieta (Bizkaia) > SPAIN > > > > > -Mensaje original- > > De: r-help-boun...@r-project.org > > [mailto:r-h

[R] AIC() vs. mle.aic() vs. step()?

2011-06-22 Thread Alexandra Thorn
I know this a newbie question, but I've only just started using AIC for model comparison and after a bunch of different keyword searches I've failed to find a page laying out what the differences are between the AIC scores assigned by AIC() and mle.aic() using default settings. I started by usin

[R] lapply over list and the respective name of the list item

2011-04-12 Thread Thaler, Thorn, LAUSANNE, Applied Mathematics
ng like: d <- data.frame(A=1:3, B=2:4) Reduce(cbind, mapply(function (col, nam) { td <- as.data.frame(do.call(cbind, rep(list(col), 3))) names(td) <- paste(nam, 1:3, sep = "_") td}, d, names(d), SIMPLIFY=FALSE)) Any suggestions? Or is it alre

Re: [R] Replacing values in a data.frame/matrix

2011-03-08 Thread Thaler, Thorn, LAUSANNE, Applied Mathematics
perm <- sample(values) } tmp <- perm[as.numeric(as.factor(x))] dim(tmp) <- dim(x) list(x = x, perm.x = tmp, perm = perm) } Thanks. > -Original Message- > From: Dimitris Rizopoulos [mailto:d.rizopou...@erasmusmc.nl] > Sent: mardi 8 mars 2011 16:21 > To: Thaler,Thor

[R] Replacing values in a data.frame/matrix

2011-03-08 Thread Thaler, Thorn, LAUSANNE, Applied Mathematics
we would use perm <- c(2,1,3) all.equal(m.perm, permutateMatrix(m, perm)$mat.perm) # TRUE What do you think of this solution? Are there more elegant ways of doing that? Any comments appreciated. Thanks + BR, Thorn __ R-help@r-project.org mailing list https://stat.

Re: [R] Read data.frame from clipboard

2011-03-08 Thread Thaler, Thorn, LAUSANNE, Applied Mathematics
ssage- > From: Prof Brian Ripley [mailto:rip...@stats.ox.ac.uk] > Sent: mardi 8 mars 2011 10:43 > To: Thaler,Thorn,LAUSANNE,Applied Mathematics > Cc: r-help@r-project.org > Subject: Re: [R] Read data.frame from clipboard > > You haven't told us your OS. But assumin

[R] Read data.frame from clipboard

2011-03-08 Thread Thaler, Thorn, LAUSANNE, Applied Mathematics
pproach uses a file connection as well, so it does not really change things (besides that it does things in one single step), so any comments appreciated of how I could do this Excel to R thing quickly preferably without any file transactions. Thanks for your help. BR Thorn [

[R] predict.lm[e] with formula passed as a variable

2010-12-13 Thread Thaler, Thorn, LAUSANNE, Applied Mathematics
, such that predict can resolve the variable, but I've no clue how to do this. Help is very much appreciated. BR + thanks, Thorn 8< df <- data.frame(x=factor(rep(1:2, each=10)), y=c(rnorm(10), rnorm(10, 10)), z=rep(1:10,2)) test <- function(df, resp,

Re: [R] lattice: limits in reversed order with relation="same"

2010-08-30 Thread Thaler, Thorn, LAUSANNE, Applied Mathematics
l the prepanel function is called? 2.) Is the only way to adjust the panel function for different panels using panel.number() or is there another (better) way? Thanks again for your kind help, it improves my insight on lattice a lot, BR, Thorn __

Re: [R] lattice: limits in reversed order with relation="same"

2010-08-30 Thread Thaler, Thorn, LAUSANNE, Applied Mathematics
col=df$df.col) which is a common mistake I make assuming that providing the data argument to a lattice command allows for omitting the name of the data.frame in all parts of the argument list not just in the formula part. Is there a reason why this is not the default b

[R] lattice: limits in reversed order with relation="same"

2010-08-30 Thread Thaler, Thorn, LAUSANNE, Applied Mathematics
multipanel plot with x-axis in reversed order but where the x-axes are only drawn in the panels at the boundary (like in xyplot(y~x|z))? Do I have to provide an own axis function? Any help appreciated. BR Thorn __ R-help@r-project.org mailing list http

Re: [R] Sum a list of tables

2010-08-23 Thread Thaler, Thorn, LAUSANNE, Applied Mathematics
Perfectly, works as expected. Regarding the other questions, can anybody point me to the right direction? BR Thorn From: RICHARD M. HEIBERGER [mailto:r...@temple.edu] Sent: lundi 23 août 2010 18:36 To: Thaler,Thorn,LAUSANNE,Applied Mathematics Cc: r-help@r-project.org Subject: Re: [R

[R] Sum a list of tables

2010-08-23 Thread Thaler, Thorn, LAUSANNE, Applied Mathematics
everything completely. So it would be great if somebody could help me out with this specific topic and point me to some resources where I can learn more. Thanks for your help in advance. BR, Thorn __ R-help@r-project.org mailing list https://stat.ethz

Re: [R] Smart Indexing

2010-08-09 Thread Thaler, Thorn, LAUSANNE, Applied Mathematics
Thanks, that does the trick. Again a new command learned. Thanks. However, any hints regarding the rownames issue? BR Thorn > -Original Message- > From: Dimitris Rizopoulos [mailto:d.rizopou...@erasmusmc.nl] > Sent: lundi 9 août 2010 11:07 > To: Thaler,Thorn,LAUSANNE,Applied

[R] Smart Indexing

2010-08-09 Thread Thaler, Thorn, LAUSANNE, Applied Mathematics
es, I think ind <- pmatch(a$id, b$id, duplicates=T) could do the job? Or do I run into troubles regarding the "partial matching" involved in pmatch? BTW, is there a way to prevent R of assigning [row|col]names? In the example above I had to remove the rownames generated by rbind explic

Re: [R] apply: return list of matrices

2010-07-20 Thread Thaler, Thorn, LAUSANNE, Applied Mathematics
Works as expected, THX a lot. BR thorn > -Original Message- > From: Dimitris Rizopoulos [mailto:d.rizopou...@erasmusmc.nl] > Sent: mardi 20 juillet 2010 11:41 > To: Thaler,Thorn,LAUSANNE,Applied Mathematics > Cc: r-help@r-project.org > Subject: Re: [R] apply: retur

[R] apply: return list of matrices

2010-07-20 Thread Thaler, Thorn, LAUSANNE, Applied Mathematics
but how can I circumvent this mechanism? For the time being I made another *apply call, which gives me the same result in the format I'd like: just replace the last line in function f by lapply(apply(bRaw, 2, function(x) list(ct(x))), function(x) matrix(unlist(x),2,2)) How

[R] Checking formulae: are lower order terms included

2010-07-12 Thread Thaler, Thorn, LAUSANNE, Applied Mathematics
del so in my understanding the value should be 2. However, would it be sufficient to test any(attr(terms(my.formula), "factors") == 2) to see whether the given model is not valid? Thanks for your input. BR Thorn Thorn Thaler Applied Mathematics Gro

Re: [R] list() assigning the same value to two items

2010-06-22 Thread Thaler, Thorn, LAUSANNE, Applied Mathematics
> Try this variation of my.transform that I had posted here: > http://tolstoy.newcastle.edu.au/R/e2/help/07/09/24707.html > > List <- function(..., L = list()) { >f <- function(){} >formals(f) <- eval(substitute(as.pairlist(c(alist(...), L >body(f) <- substitute(modifyL

Re: [R] list() assigning the same value to two items

2010-06-21 Thread Thaler, Thorn, LAUSANNE, Applied Mathematics
ve item names. It is still an academic question, for there are thousands of ways to solve this issue, but I was just curious whether it is possible to find an one-liner without the need of specifying any temp variable. BR, Thorn -Original Message- From: Peter Ehlers [mailto:ehl...@uca

[R] list() assigning the same value to two items

2010-06-21 Thread Thaler, Thorn, LAUSANNE, Applied Mathematics
onal variable? Something like z <- list(a=1, b=a) or even z <- list(a=b=1)? Both commands don't work of course, but I'm just curious whether this is possible in principle (a rather academic question I've to admit) Thanks + BR, Thorn Thaler Applied Mathematics Group

Re: [R] Lazy evaluation in function call

2010-05-05 Thread Thorn
uld evaluate choices[1] not at the prompt level, but at the moment it enters the function biplot, where choices will be known in any case (since it has default values). Just to make it clear once again, I'm aware of the possibilities to get this specific task don

[R] Lazy evaluation in function call

2010-05-04 Thread Thorn
ike f(z<-2,z) but I'm just curious whether it is possible to use a fancy combination of eval, substitute or quote ;) BR, thorn __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide h