[R] When was the script editor introduced in Rgui for windows?

2018-01-26 Thread Søren Højsgaard
Dear all, Can anyone please tell me when the script editor was introduced in the Rgui on windows? (And/or where to look for a listing of changes throughout history). Best regards Søren __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, s

[R] consider running tools::compactPDF(gs_quality = "ebook")

2018-07-08 Thread Søren Højsgaard
Dear all, I run R CMD build --compact-vignettes="both" gRbase and/or R CMD build --compact-vignettes="gs+qpdf" gRbase and in the log from r-devel (on winbuilder) I get * checking sizes of PDF files under 'inst/doc' ... WARNING 'gs+qpdf' made some significant size reductions: compacte

[R] Checking whether specific packages (from bioconductor) are installed when loading a package

2015-03-11 Thread Søren Højsgaard
Dear all, My package 'gRbase' uses three packages from Bioconductor and these are not automatically installed when gRbase is installed. My instructions (on the package webpage) to users are therefore to run: source("http://bioconductor.org/biocLite.R";); biocLite(c("graph","RBGL","Rgraphviz"))

Re: [R] Testing general hypotheses on regression coefficients

2014-09-05 Thread Søren Højsgaard
AFAICS you are not testing a linear hypothesis (which is of the form Lb=b0 where L is a matrix and b=(a,B1,B2,B3,B3) is the parameter vector). If, for simplicity, your model is E(y) = a + bx then -a/b is the x-value for which y is zero. When you turn to estimates then u = -a/b is the ratio of t

Re: [R] Lme4 Package Help!

2014-11-09 Thread Søren Højsgaard
Actually, I believe that for a brief period (around 2006) lmer did return p-values (chisq-based), but then 2006 is a long time ago... If the question pertains p-values in the usual output of coef( summary( model ) ), I'll just mention that with doBy and pbkrtest you can do linest( model, diag(1

Re: [R] Exponential smoothing?

2008-08-19 Thread Søren Højsgaard
Try ?HoltWinters and ?filter Regards Søren -Oprindelig meddelelse- Fra: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] På vegne af Öhagen Patrik Sendt: 19. august 2008 10:00 Til: R hELP Emne: [R] Exponential smoothing? Dear List, I have used all my resources (i.e. "help.search) and I sti

[R] Extracting eg A[, , 3, 1, ] from an array but using dimension names and levels

2008-08-20 Thread Søren Højsgaard
Consider the extraction > HairEyeColor[,3,1] Black Brown Red Blond 1025 7 5 Suppose I have the appropriate dimensions and levels given as variables, e.g. d1 <-2 l1 <-3 d2 <-3 l2 <-1 How can I then make the "extraction" above using d1, l1, d2, l2 (for an array of arbitrary

Re: [R] summary statistics for grouped data

2010-02-12 Thread Søren Højsgaard
You might find the summaryBy function in the doBy package useful. Regards Søren Fra: r-help-boun...@r-project.org [r-help-boun...@r-project.org] På vegne af jose romero [jlauren...@yahoo.com] Sendt: 12. februar 2010 18:23 Til: r-help@r-project.org Emne: [R

Re: [R] identical() mystery

2010-03-01 Thread Søren Højsgaard
It might have to do with the storage.mode(): > reference <- c(11, 14, 16, 5, 4, 2, 0, 15, 9, 0) > storage.mode(reference) [1] "double" > cpgDensity <- as.integer(reference) > storage.mode(cpgDensity) [1] "integer" > identical(reference,cpgDensity) [1] FALSE regards Søren ___

Re: [R] Creating named lists

2010-03-12 Thread Søren Højsgaard
Rune, I doubt that this is possible because R-objects will typically not know "their own name". Med venlig hilsen / Regards Søren Højsgaard -Oprindelig meddelelse- Fra: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] På vegne af Rune Schjellerup Philosof

Re: [R] array slice notation?

2009-08-04 Thread Søren Højsgaard
You can do > A <- HairEyeColor > do.call("[", c(list(A),list(1,T,T))) Sex Eye Male Female Brown 32 36 Blue11 9 Hazel 10 5 Green3 2 Regards Søren Fra: r-help-boun...@r-project.org [r-help-boun...@r-project.

Re: [R] array slice notation?

2009-08-05 Thread Søren Højsgaard
> How do you generalize this to select multiple rows eg with indexes given by a vector 'v'? Søren Højsgaard wrote: > > You can do >> A <- HairEyeColor >> do.call("[", c(list(A),list(1,T,T))) >Sex > Eye Male Female > Brown 32

Re: [R] More efficient alternative to combn()?

2010-03-27 Thread Søren Højsgaard
Perhaps slightly off topic but there is a faster alternative to combn() called combnPrim() in the gRbase package: > library(gRbase) > system.time({for (ii in 1:1) combn(1:6,3)}) user system elapsed 4.020.004.02 > system.time({for (ii in 1:1) combnPrim(1:6,3)}) user sy

[R] Defining S3-methods for S4-objects: cannot coerce type 'S4' to vector of type 'integer'

2009-10-19 Thread Søren Højsgaard
(e.g. in connection with package building)?? I use R 2.9.2 on windows XP. I am sure that such issues must have come up for others in the past but I've been unable to find questions/answers in the archives. Sorry if the topic has already been covered. Regards Søren Højsgaard

[R] Define lm/glm object without evaluating them

2009-11-17 Thread Søren Højsgaard
For e.g. lm/glm type models I would like to separate model specification and model fitting and then only fit the models later 'when data arrives'. To be specific, I would like make a specification like m1 <- lm(rate~conc) m2 <- lm(rate~I(conc^2)) and then later I want to 'put data into' the obje

Re: [R] different fits for geese and geeglm in geepack?

2009-11-26 Thread Søren Højsgaard
It looks strange. If you send me data for a small reproducible example then I'll look into the issue. Regards Søren Fra: r-help-boun...@r-project.org [r-help-boun...@r-project.org] På vegne af Achaz von Hardenberg [achaz.hardenb...@gmail.com] Sendt: 26.

Re: [R] R & very large files

2009-12-16 Thread Søren Højsgaard
The sqldf package may be of help to you. Regards Søren -Oprindelig meddelelse- Fra: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] På vegne af Albert-Jan Roskam Sendt: 16. december 2009 11:59 Til: r-help@r-project.org Emne: [R] R & very large files Hi,   I very r

[R] Creating a plot with an image as background

2009-06-01 Thread Søren Højsgaard
I want to create a plot of positions (x(t),y(t)) of animals in a barn for t=1,2,... (I have in mind creating many of these, saving them as png's and combining them into a small movie). I have an image file showing the physical layout of the barn, and I would like to have that image as background

[R] Installing bioconduction packages in connection with loading an R package

2020-10-11 Thread Søren Højsgaard
Dear all, My gRbase package imports functionality from the bioconductor packages graph, Rgraphviz and RBGL. To make installation of gRbase easy, I would like to have these bioconductor packages installed in connection with installation of gRbase, but to do so the user must use setRepositories(

Re: [R] NLSR package newDeriv function

2021-04-14 Thread Søren Højsgaard
One approach is to compute things exact using the caracas package; see below. Best regards Søren > library(caracas) > f <- function(x,y){x+y} > def_sym(x,y,z) > f <- x+y^2+y*z^2 > f [caracas]: 2 2 x + y + y⋅z > > d1 <- der(f, c(x,y,z)) > d2 <- der2(f, c(x,y,z)) > >

Re: [R] question about the difference of AIC()

2021-05-12 Thread Søren Højsgaard
In the first model, I believe you estimate two parameters: the mean and the variance: > fm <- lm(y ~ 1) > 2*2 - 2 * logLik(fm) 'log Lik.' 40.49275 (df=2) > AIC(fm) [1] 40.49275 A zero mean model: fm0 <- lm(y ~ -1) > 2*1 - 2 * logLik(fm0) 'log Lik.' 39.00611 (df=1) > AIC(fm0) [1] 39.00611 Regard

[R] Handling dependencies on Bioconductor packages for packages on CRAN

2021-12-04 Thread Søren Højsgaard
Dear all My gRbase package imports the packages from Bioconductor: graph, RBGL and Rgraphviz If these packages are not installed, then gRbase can not be installed. The error message is: ERROR: dependency ‘graph’ is not available for package ‘gRbase’ If I, prior to installation, run setRepo

[R] Possible bug in optimize (related to naming the arguments)

2020-05-07 Thread Søren Højsgaard
Dear all, I am wondering if there is a minor bug in the optimimize function; please see below: --- > ## example taken from optimize documentation > f <- function (x, a) (x - a)^2 > xmin <- optimize(f, c(0, 1), tol = 0.0001, a = 1/3) > xmin $minimum [1] 0.333 $objective [1] 0 > ## if we

Re: [R] descriptive stats by cells in factorial design

2013-08-03 Thread Søren Højsgaard
The summaryBy function in the doBy package may help you. Regards Søren Sendt fra Samsung mobil Oprindelig meddelelse Fra: Mike Miller Dato: Til: R-Help List Emne: [R] descriptive stats by cells in factorial design I'm looking for recommendations for a good way to do this

Re: [R] Reading extremly large comma separated files?

2012-12-19 Thread Søren Højsgaard
The sqldf package may be of help to you. Regards Søren -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Öhagen Patrik Sent: 19. december 2012 10:48 To: R hELP Subject: [R] Reading extremly large comma separated files? Dear List,

[R] Modifying a function programmatically

2013-02-04 Thread Søren Højsgaard
Dear list # I have a function ff <- function(a,b=2,c=4){a+b+c} # which I programmatically want to modify to a more specialized function in which a is replaced by 1 ff1 <- function(b=2,c=4){1+b+c} # I do as follows: vals <- list(a=1) (expr1 <- as.expression(body(ff))) expression({ a +

Re: [R] Modifying a function programmatically

2013-02-04 Thread Søren Højsgaard
064331250 0.5935787352 -0.1426050990 -0.1390478788 ans(sd=.0001) [1] 1.386604e-06 -6.616540e-05 6.592326e-05 -1.299638e-04 1.322658e-05 -4.515388e-05 [7] -2.809639e-05 -5.719492e-05 1.554319e-04 -1.186992e-04 -Original Message- From: Pascal Oettli [mailto:kri...@ymail.com] Sent: 4. februar

Re: [R] Modifying a function programmatically

2013-02-04 Thread Søren Højsgaard
Søren -Original Message- From: Gabor Grothendieck [mailto:ggrothendi...@gmail.com] Sent: 4. februar 2013 17:31 To: Søren Højsgaard Cc: r-help@r-project.org Subject: Re: [R] Modifying a function programmatically On Mon, Feb 4, 2013 at 5:00 AM, Søren Højsgaard wrote: > Dear list &g

Re: [R] evaluation of equations from Ryacas

2013-06-19 Thread Søren Højsgaard
Dear Erin, Not exactly elegant, but > e<-expression(list(R == 100 * (1 - 2 * y/1))) > ee <- e[[1]][2] > ee (R == 100 * (1 - 2 * y/1))() > eval(parse(text=(substring(paste(ee), 5))), list(y=5)) [1] 99.9 Regards Søren -Original Message- From: r-help-boun...@r-project.org [mailto:

Re: [R] Ryacas loads but yacas has an error

2013-06-19 Thread Søren Højsgaard
Dear Erin, I don't have solution, but there is a remark on connection issues at http://code.google.com/p/ryacas/ An alternative could be to look at the rSymPy or rmathpiper packages which may do what you want. Regards Søren -Original Message- From: r-help-boun...@r-project.org [mailt

[R] Built-in function for extracting mantissa and exponent of a numeric

2013-06-23 Thread Søren Højsgaard
Dear all, Given a number x<-1.234e12 is there a built-in function for extracting 1.234 and 12 ? The following "hack" seems clumpsy: > a<-strsplit(format(x, scientific=T),"e")[[1]] > a [1] "1.234" "+12" > as.numeric(a[1]) [1] 1.234 > as.integer(a[2]) [1] 12 Regards Søren ___

[R] Issue with Imports in NAMESPACE

2013-06-25 Thread Søren Højsgaard
Dear all, In my gRbase package I have up until now "Depend"-ed on RBGL (from Bioconductor), but good people have convinced me that I should use "Import"-it instead because I only use few functions from RBGL. In DESCRIPTION I therefore now have Imports: Matrix,RBGL In NAMESPACE I now have impor

Re: [R] Issue with Imports in NAMESPACE

2013-06-25 Thread Søren Højsgaard
an Murdoch [mailto:murdoch.dun...@gmail.com] Sent: 25. juni 2013 13:02 To: Søren Højsgaard Cc: R hELP (r-h...@stat.math.ethz.ch) Subject: Re: [R] Issue with Imports in NAMESPACE On 13-06-25 6:50 AM, Søren Højsgaard wrote: > Dear all, > In my gRbase package I have up until now "Depend&quo

Re: [R] Issue with Imports in NAMESPACE

2013-06-25 Thread Søren Højsgaard
: Søren Højsgaard; R hELP (r-h...@stat.math.ethz.ch) Subject: Re: [R] Issue with Imports in NAMESPACE On Tue, 25 Jun 2013, Duncan Murdoch wrote: > On 13-06-25 7:14 AM, Søren Højsgaard wrote: >> Dear Duncan, >> >> Excellent, thanks! >> >> Maybe this is worth a remark

[R] Vignettes do not appear on CRAN if files are placed in /vignette subdirectory - but they do appear if placed in /inst/doc

2013-06-30 Thread Søren Højsgaard
Dear all, In my gRbase package there are 3 vignettes placed in the /vignette subdirectory. These vignettes do not appear on http://cran.r-project.org/web/packages/gRbase/index.html and neither do they appear if I open a browser with help("gRbase"). However, if instead I place the vignettes in

Re: [R] Vignettes do not appear on CRAN if files are placed in /vignette subdirectory - but they do appear if placed in /inst/doc

2013-06-30 Thread Søren Højsgaard
Sorry, yes it is plural - but changing to plural has no effect. Regards Søren -Original Message- From: Martin Morgan [mailto:mtmor...@fhcrc.org] Sent: 30. juni 2013 23:09 To: Søren Højsgaard Cc: R hELP (r-h...@stat.math.ethz.ch) Subject: Re: [R] Vignettes do not appear on CRAN if files

Re: [R] Vignettes do not appear on CRAN if files are placed in /vignette subdirectory - but they do appear if placed in /inst/doc

2013-06-30 Thread Søren Højsgaard
, Martin Morgan reports that it works for him. I don't know what to make of this. Regards Søren -Original Message- From: Duncan Murdoch [mailto:murdoch.dun...@gmail.com] Sent: 1. juli 2013 00:45 To: Søren Højsgaard Cc: Martin Morgan; R hELP (r-h...@stat.math.ethz.ch) Subje

Re: [R] Vignettes do not appear on CRAN if files are placed in /vignette subdirectory - but they do appear if placed in /inst/doc

2013-06-30 Thread Søren Højsgaard
Yes, these packages are all installed. Søren -Original Message- From: Duncan Murdoch [mailto:murdoch.dun...@gmail.com] Sent: 1. juli 2013 01:59 To: Søren Højsgaard Cc: Martin Morgan; R hELP (r-h...@stat.math.ethz.ch) Subject: Re: [R] Vignettes do not appear on CRAN if files are placed in

[R] "eval" inside a function call in connection with updating the data slot in the call of lmer

2012-09-17 Thread Søren Højsgaard
Dear list, Given a linear mixed model (from lme4) I want to 1) first change the input dataset and then 2) change the model formula. I want this to happen in a function call; Please see below. Options 1) and 2) below work whereas 3) fails with the message > foo() Error in is.data.frame(data) :

[R] Having two different versions of a package in the same R installation

2012-10-02 Thread Søren Højsgaard
Dear list, I am making some comparisons of two versions of the lme4 package: The CRAN version and the R-Forge version. For the moment I have two different R installations, each with a different version of lme4. However it would be convenient if I could have the same version within the same R in

Re: [R] Having two different versions of a package in the same R installation

2012-10-02 Thread Søren Højsgaard
to a directory called lme4 on the fly. I don't know if it would work, but I just wonder if there would possibly a more elegant way. Regards Søren -Original Message- From: Greg Snow [mailto:538...@gmail.com] Sent: 2. oktober 2012 22:27 To: Søren Højsgaard Cc: r-help@r-project.org S

[R] Dispatching on a dgCMatrix does not work.

2012-12-11 Thread Søren Højsgaard
I represent a graph as an adjacency matrix of class "dgCMatrix" (from the Matrix package). > xx 5 x 5 sparse Matrix of class "dgCMatrix" a b c d e a . 1 1 . . b 1 . 1 . . c 1 1 . 1 1 d . . 1 . 1 e . . 1 1 . To check if the matrix defines and undirected graph, I have made the following functio

Re: [R] degrees of freedom

2014-01-24 Thread Søren Højsgaard
As a supplement to Bens reply: The pbkrtest package allows calculation of degrees of freedom by the Kenward-Roger method; something like library(lme4) model1 <- lmer(value~group + (1|animal), data=bip) summary(model1) anova(model1) model0 <- update(model1, .~.-group) anova(model1, model0) librar

Re: [R] Generalised Estimating Equations on approx normal outcome with limited range

2010-06-24 Thread Søren Højsgaard
Hi, 1) There is no feature in geeglm for that sort of "truncation" of the outcome. 2) It is generally "fragile" - and not recommendable - to use corstr="unstructured" in geeglm. Regards Søren Fra: r-help-boun...@r-project.org [r-help-boun...@r-project.

Re: [R] transformation of data.frame

2010-07-08 Thread Søren Højsgaard
Like this? > library(doBy) > (ddd <- read.table("foo.txt",header=T)) ID gen 1 42787 gen2 2 16070 gen2 3 16070 gen3 4 7409 Gen1 5 7409 gen3 6 6511 gen2 7 6417 gen3 8 16070 gen4 9 6511 gen4 > aa<-lapplyBy(~ID, data=ddd, + FUN=function(uu){ + list(uu$ID[1], paste(uu$gen, collapse=":"))

Re: [R] GEE with user-specified link function

2010-10-12 Thread Søren Højsgaard
For geepack there are no facilities for user defined link functions. Regards Søren Fra: r-help-boun...@r-project.org [r-help-boun...@r-project.org] På vegne af Kun Liu [victo...@hotmail.co.uk] Sendt: 12. oktober 2010 11:50 Til: r-help@r-project.org Emne: [

Re: [R] how to view the top 20 lines in a long dataset

2010-11-01 Thread Søren Højsgaard
See ?head Regards Søren Fra: r-help-boun...@r-project.org [r-help-boun...@r-project.org] På vegne af Louis Plough [lplo...@usc.edu] Sendt: 1. november 2010 20:40 Til: r-help@r-project.org Emne: [R] how to view the top 20 lines in a long dataset Hi, I am

[R] odfWeave - "Format error discovered in the file in sub-document content.xml at 2, 4047 (row, col)"

2010-11-16 Thread Søren Højsgaard
When using odfWeave on an OpenOffice input document, I can not open the output document. I get the message "Format error discovered in the file in sub-document content.xml at 2,4047 (row,col)" Can anyone help me on this? (Apologies if this has been discussed before; I have not been able to fin

Re: [R] odfWeave - "Format error discovered in the file in sub-document content.xml at 2, 4047 (row, col)"

2010-11-16 Thread Søren Højsgaard
ndt: 16. november 2010 12:56 Til: Søren Højsgaard; r-h...@stat.math.ethz.ch Emne: RE: [R] odfWeave - "Format error discovered in the file in sub-document content.xml at 2, 4047 (row, col)" From: soren.hojsga...@agrsci.dk To: r-h...@stat.math.e

[R] Calling substitute(expr, list(a=1)) when expr <- expression(a+b+c)

2010-11-26 Thread Søren Højsgaard
# The result I am after is the result after a substitution in an expression, such as substitute(expression(a+b+c), list(a=1)) expression(1 + b + c) # However, the way I want to do it is for a an expression "stored as a variable" as (expr <- expression(a+b+c)) expression(a + b + c) # a) The fo

Re: [R] Calling substitute(expr, list(a=1)) when expr <- expression(a+b+c)

2010-11-26 Thread Søren Højsgaard
c) - or maybe it can be done in a simpler way? Regards Søren -Oprindelig meddelelse- Fra: Gabor Grothendieck [mailto:ggrothendi...@gmail.com] Sendt: 26. november 2010 14:39 Til: Søren Højsgaard Cc: r-h...@stat.math.ethz.ch Emne: Re: [R] Calling substitute(expr, list(a=1)) when expr <

[R] Sweave: Setting options with SweaveOpts{} when using driver=RweaveHTML

2010-12-10 Thread Søren Højsgaard
When using Sweave in connection with the driver RweaveLatex(), global options can be set with \SweaveOpts{}, e.g. \SweaveOpts{keep.source=T}. Does anybody know if it is possible to set global options in the same way when using Sweave with the driver RweaveHTML(). Regards Søren [[altern

Re: [R] Bayesian Belief Networks

2010-12-23 Thread Søren Højsgaard
Probability propragation is provided in the gRain package. Regards Søren Fra: r-help-boun...@r-project.org [r-help-boun...@r-project.org] På vegne af Michael Bedward [michael.bedw...@gmail.com] Sendt: 24. december 2010 00:01 Til: Data AnalyticsCorp. Cc: r-

Re: [R] Changing a logical matrix into a numeric matrix

2011-01-10 Thread Søren Højsgaard
Just multiply by 1: > m <- matrix(c(T,T,F,T),nr=2) > m [,1] [,2] [1,] TRUE FALSE [2,] TRUE TRUE > m*1 [,1] [,2] [1,]10 [2,]11 -Oprindelig meddelelse- Fra: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] På vegne af emj83 Sendt: 10. janua

Re: [R] Using summaryBy with weighted data

2011-01-17 Thread Søren Højsgaard
It is currently not possible to pass weights in summaryBy. Regards Søren Fra: Joshua Wiley [jwiley.ps...@gmail.com] Sendt: 17. januar 2011 08:16 Til: Solomon Messing Cc: r-help@r-project.org; Søren Højsgaard Emne: Re: [R] Using summaryBy with weighted

[R] Strange result from sort: sort(c("aa", "ff")) gives "ff" "aa" with R.2.12.1 on windows 7

2011-01-24 Thread Søren Højsgaard
Dear list, Please consider the following call of sort > sort(c("a","f")) [1] "a" "f" > sort(c("f","a")) [1] "a" "f" > > sort(c("aa","ff")) [1] "ff" "aa" > sort(c("ff","aa")) [1] "ff" "aa" The last two results look strange to me. Is that a bug??? The result seems to come from calls to order: > o

[R] Extracting elements from list: Is [[ always faster than $ ??

2010-09-08 Thread Søren Højsgaard
Dear list It seems to me that extracting elements from a list using '[[' is somewhat faster than using '$'. For example: > x<- as.list(1:25) > names(x) <- letters[1:length(x)] > dput(x) structure(list(a = 1L, b = 2L, c = 3L, d = 4L, e = 5L, f = 6L, g = 7L, h = 8L, i = 9L, j = 10L, k

Re: [R] Problems with Rterm 2.13.0 - but not RGui

2011-05-03 Thread Søren Højsgaard
A safe way out of this mess is to install R somewhere else. For example, create a directory c:\Programs and install R there. Regards Søren -Oprindelig meddelelse- Fra: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] På vegne af Jonathan Daily Sendt: 3. maj 2011 13:

Re: [R] problem with makeSOCKcluster depending on R patch version

2011-05-15 Thread Søren Højsgaard
That raises another question: Will that patched version (2011-05-13 r55886) be made available as a windows binary - and if so: when? Regards Søren Fra: r-help-boun...@r-project.org [r-help-boun...@r-project.org] På vegne af Uwe Ligges [lig...@statistik

Re: [R] problem with makeSOCKcluster depending on R patch version

2011-05-15 Thread Søren Højsgaard
Fra: Uwe Ligges [lig...@statistik.tu-dortmund.de] Sendt: 15. maj 2011 15:25 Til: Søren Højsgaard Cc: Ulrich Halekoh; r-help@r-project.org Emne: Re: SV: [R] problem with makeSOCKcluster depending on R patch version On 15.05.2011 12:27, Søren Højsgaard wrote: > That raises another question: W

Re: [R] using stimulate(model) for parametric bootstrapping in lmer repeatabilities

2011-06-08 Thread Søren Højsgaard
Dear Jenni, In the newest version of the doBy package there is a function called PBrefdist (and PBrefdist.mer) for calculating the reference distribution of the likelihood ratio statistic for comparing nested models. Looking into this function may help you. Perhaps the functions PBmodcomp and B

Re: [R] Strange result from sort: sort(c("aa", "ff")) gives "ff" "aa" with R.2.12.1 on windows 7

2011-02-02 Thread Søren Højsgaard
an "an a followed by another a" and not "aa" (="å") when calling sort?? Regards Søren Højsgaard -Oprindelig meddelelse- Fra: Prof Brian Ripley [mailto:rip...@stats.ox.ac.uk] Sendt: 2. februar 2011 13:21 Til: Søren Højsgaard Cc: r-h...@stat.math.ethz.ch Emne:

[R] Assigning a class attribute to a list or vector slows "[" down

2011-04-04 Thread Søren Højsgaard
Dear list, I've noticed that if a list or a vector is given a class (by class(x) <- "something") then the "selection operator slows down - quite a bit. For example: > lll <- as.list(letters) > system.time({for(ii in 1:20)lll[-(1:4)]}) user system elapsed 0.480.000.49 > > class(

Re: [R] Quasipoisson with geeglm

2011-04-07 Thread Søren Højsgaard
Dear Ivy, In gee there is no quasipossion, because gee is in a way already quasi. With GEE we do not fit a poisson glm, but use in the construction of the sandwich covariance matrix the variance function of the poisson family. In Gee always an 'overdispersion' is estimated. Regards Søren

Re: [R] Simulation from discrete uniform

2011-04-07 Thread Søren Højsgaard
?sample -Oprindelig meddelelse- Fra: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] På vegne af cassie jones Sendt: 8. april 2011 03:16 Til: r-help@r-project.org Emne: [R] Simulation from discrete uniform Dear all, I am trying to simulate from discrete uniform distrib

[R] Can't get installing a package source (.tar.gz) from a web page to work...

2011-09-15 Thread Søren Højsgaard
I have created an R-package with datasets which I want my students to install (the package is not on CRAN). 1) I've put the package on the web in a directory called 'data' and I thought I could do: > install.packages("http://gbi.agrsci.dk/statistics/courses/2011-ISMLS-course/data/LiSciData_0.0

Re: [R] Can't get installing a package source (.tar.gz) from a web page to work...

2011-09-16 Thread Søren Højsgaard
hat there is a bug somewhere? Best regards Søren -Oprindelig meddelelse- Fra: Uwe Ligges [mailto:lig...@statistik.tu-dortmund.de] Sendt: 15. september 2011 10:47 Til: Søren Højsgaard Cc: r-h...@stat.math.ethz.ch Emne: Re: [R] Can't get installing a package source (.tar.gz) fro

Re: [R] rgraphviz problem

2012-06-24 Thread Søren Højsgaard
Dear Anton, You may find the description on http://people.math.aau.dk/~sorenh/software/gR/index.html helpful. Regards -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Anton Gerostathos Sent: 24. juni 2012 14:28 To: r-help@r-projec

Re: [R] rgraphviz problem

2012-06-24 Thread Søren Højsgaard
Perhaps you could try to see if you can get the 32 bit version to work AND you could also report the result of running sessionInfo() in your mail. Regards Søren -Original Message- From: Anton Gerostathos [mailto:antonios.gerostat...@windowslive.com] Sent: 24. juni 2012 18:43 To: Søren

[R] Indexing matrices from the Matrix package with [i, j] seems to be very slow. Are there "faster alternatives"?

2012-06-24 Thread Søren Højsgaard
Dear all, Indexing matrices from the Matrix package with [i,j] seems to be very slow. For example: library(rbenchmark) library(Matrix) mm <- matrix(c(1,0,0,0,0,0,0,0), nr=20, nc=20) MM <- as(mm, "Matrix") lookup <- function(mat){ for (i in 1:nrow(mat)){ for (j in 1:ncol(mat)){

Re: [R] Indexing matrices from the Matrix package with [i, j] seems to be very slow. Are there "faster alternatives"?

2012-06-26 Thread Søren Højsgaard
), columns=c("test", "replications", "elapsed", "relative"), replications=5) -Original Message- From: Duncan Murdoch [mailto:murdoch.dun...@gmail.com] Sent: 25. juni 2012 11:27 To: Søren Hø

Re: [R] Indexing matrices from the Matrix package with [i, j] seems to be very slow. Are there "faster alternatives"?

2012-06-26 Thread Søren Højsgaard
ef Eigen::MappedSparseMatrix MSpMat; const MSpMat X(as(XX_)); int i = as(ii_)-1; int j = as(jj_)-1; double ans = X.coeff(i,j); return(wrap(ans)); ' -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Søren Højsgaard Sent: 27. juni

Re: [R] installing Rgraphviz

2011-07-20 Thread Søren Højsgaard
Hardly an R question, but a google search with the string "change the path variable windows 7" gave quite a few hits, for example http://geekswithblogs.net/renso/archive/2009/10/21/how-to-set-the-windows-path-in-windows-7.aspx Regards Søren Fra: r-help-b

[R] Creating sparse matrix of type "dgCMatrix" directly

2012-07-28 Thread Søren Højsgaard
I want to create a sparse matrix of type "dgCMatrix" using the Matrix package (and the matrix must be of this type even if other more compact representations may exist). I do > library(Matrix) > m1<-Matrix(rep(1,4),nrow=2,ncol=2,sparse=T) > m1 2 x 2 sparse Matrix of class "dsCMatrix" [1

Re: [R] Creating sparse matrix of type "dgCMatrix" directly

2012-07-28 Thread Søren Højsgaard
-Original Message- From: dmba...@gmail.com [mailto:dmba...@gmail.com] On Behalf Of Douglas Bates Sent: 28. juli 2012 20:36 To: Søren Højsgaard Cc: r-help@r-project.org Subject: Re: [R] Creating sparse matrix of type "dgCMatrix" directly On Sat, Jul 28, 2012 at 7:26 AM, Søren

Re: [R] Symbolic computation in R-solving system of equations

2012-08-15 Thread Søren Højsgaard
Ryacas provides an interface to yacas from R. So my suggestion is to search the web to see if yacas can solve your specific problem. Regards Søren -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of jpm miao Sent: 16. august 2012 04:42

Re: [R] Some kind of inverse of "names"

2012-08-20 Thread Søren Højsgaard
Is this what you want?: > li <- list(a=1, b=2, c=3, d=4) > li $a [1] 1 $b [1] 2 $c [1] 3 $d [1] 4 > unlist(li) a b c d 1 2 3 4 > unname(unlist(li)) [1] 1 2 3 4 Regards Søren -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Juli

Re: [R] How do I query "..." in a function call?

2011-11-21 Thread Søren Højsgaard
You can do something like this: test <- function(x,...){ print(x) args = list(...) if('y' %in% names(args))print(args$y) if('z' %in% names(args))print(args$z) } Regards Søren Fra: r-help-boun...@r-project.org [r-help-boun...@r-project

Re: [R] Relationship between covariance and inverse covariance matrices

2011-12-08 Thread Søren Højsgaard
Your question is not all that R-related, but inverse covariance matrices with zero entries corresponds to conditional independence restrictions in the multivaritate normal distribution. Such inverse covariance matrices are key ingredients in graphical Gaussian models (also known as covariance se

[R] Package snow: is there any way to check if a cluster is "acticve"

2011-10-12 Thread Søren Højsgaard
Is there a 'proper' way of checking if cluster is active. For example, I create a cluster called .PBcluster > str(.PBcluster) List of 4 $ :List of 3 ..$ con :Classes 'sockconn', 'connection' atomic [1:1] 3 .. .. ..- attr(*, "conn_id")= ..$ host: chr "localhost" ..$ rank: int 1 ..- at

Re: [R] multicore combn

2011-10-16 Thread Søren Højsgaard
Just thought I'd let you know the following: In the gRbase package there is a function called combnPrim which does the same as combn but it is implemented in C - and is quite a bit faster than combn(). Regards Søren Fra: r-help-boun...@r-project.org [r-

Re: [R] Fitting loglinear model with glm() and loglm()

2012-03-20 Thread Søren Højsgaard
Dear Christofer, loglm uses an iterative proportional scaling (IPS) algorithm for fitting a log-linear model to a contingency table. glm uses an iteratively reweighted least squares algorithm. The result from IPS is exact. Regards Søren -Oprindelig meddelelse- Fra: r-help-boun...@r-

Re: [R] expand.grid (the half!)

2012-03-24 Thread Søren Højsgaard
Something like this? x <- expand.grid(c(1,2,3),c(1,2,3)) x[x[,2]>=x[,1],] Var1 Var2 111 412 522 713 823 933 Regards Søren -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Alaios Se

Re: [R] summaryBy: transformed variable on RHS of formula?

2012-04-02 Thread Søren Højsgaard
Sorry, no - you will have to do something like the latter suggestion. Regards Søren -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Alexander Shenkin Sent: 2. april 2012 17:59 To: r-help@r-project.org Subject: [R] summaryBy: transf

Re: [R] Imputing missing values using "LSmeans" (i.e., population marginal means) - advice in R?

2012-04-07 Thread Søren Højsgaard
Dear Jenn, Could you please provide a reproducible example. In your case, you could for example provide the data (using dput(dat)). Regards Søren -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Jenn Barrett Sent: 6. april 2012 1

[R] Calling update on an lm-object inside a function

2012-01-22 Thread Søren Højsgaard
Dear all, I want to update an lm (or glm) object by changing the response variable and I want to do so inside a function. Doing the update outside of a function is straight forward: x <- 1:5 y <- c(1,2,3,3,6) mm <- lm(y~x) y2 <- c(1,3,3,4,6) mm2<- update(mm, y2 ~ .) But I want to make th

Re: [R] gee: suppress printout

2012-02-02 Thread Søren Højsgaard
I don't think it can be "removed", a message like this has been coming out for several years and there may be a good reason why it is there. Your best bet is probably to approach the package maintainer with a suggestion to alter the code. Regards Søren -Oprindelig meddelelse- Fra: r-

Re: [R] Help with ordering values

2012-05-19 Thread Søren Højsgaard
Will y[order(match(y,x))] [1] 9 8 11 2 1 do? Regards Søren -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Lars Bishop Sent: 20. maj 2012 01:05 To: r-help@r-project.org Subject: [R] Help with ordering values Hi, Is it possibl

Re: [R] fitting periodic 'sine wave' model

2008-06-10 Thread Søren Højsgaard
If you make the x-values more dense, e.g. with x<-seq(0,20,0.1) then your example works. Plotting your data might give a hint to why your example fails Btw: It is generally not a good idea to use F for a parameter because F usually means FALSE. Regards Søren ___

Re: [R] Really simple question

2008-06-10 Thread Søren Højsgaard
?setdiff Fra: [EMAIL PROTECTED] på vegne af [EMAIL PROTECTED] Sendt: ti 10-06-2008 22:32 Til: r-help@r-project.org Emne: [R] Really simple question Hi, I don't have too much programming experience - sorry in advance if this question is very basic, and thanks f

Re: [R] Number of digits in paste funciton

2008-06-18 Thread Søren Højsgaard
For detailed control of such things see ?sprintf and ?formatC Søren -Oprindelig meddelelse- Fra: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] På vegne af Tine Sendt: 18. juni 2008 10:21 Til: r-help@r-project.org Emne: [R] Number of digits in paste funciton Hi! Does anyone know hot to

Re: [R] paste data

2008-06-18 Thread Søren Højsgaard
You can put all dataframes into a list L, e.g. L <- list(auto.0a, auto.0b,...) and then do either a for-loop or use lapply. For example for (ii in 1:length(L)){ plot(y~x, data=L[[ii]],...) } or lapply(L, function(d) plot(y~x, data=d) Med venlig hilsen Søren Højsga

[R] How to build a package which loads Rgraphviz (if installed)...

2008-07-12 Thread Søren Højsgaard
Dear List, I use Rgraphviz for display of graphs in some packages. Since Rgraphviz is no longer on CRAN it needs to be installed from Bioconductor and that is fine, but I have trouble figureing out the following: I create a plot method which - if Rgraphviz is installed - uses Rgraphviz for displ

Re: [R] How to build a package which loads Rgraphviz (if installed)...

2008-07-12 Thread Søren Højsgaard
ss you are stuck with the same problem??? Cheers Søren Fra: William Revelle [mailto:[EMAIL PROTECTED] Sendt: lø 12-07-2008 23:47 Til: Søren Højsgaard; [EMAIL PROTECTED] Emne: Re: [R] How to build a package which loads Rgraphviz (if installed)... Soren, When

Re: [R] How to build a package which loads Rgraphviz (if installed)...

2008-07-12 Thread Søren Højsgaard
ncan Murdoch [mailto:[EMAIL PROTECTED] Sendt: sø 13-07-2008 00:36 Til: Søren Højsgaard Cc: William Revelle; [EMAIL PROTECTED] Emne: Re: [R] How to build a package which loads Rgraphviz (if installed)... On 12/07/2008 6:27 PM, Søren Højsgaard wrote: > Bill, > Thanks for the suggestion,

[R] Computing time when calling C functions - why does an extra function call induce such an overhead?

2008-04-09 Thread Søren Højsgaard
Dear list, I am a little puzzled by computing time in connection with calling C functions. With the function mysolve1 given below I solve Ax=B, where the actual matrix operation takes place in mysolve2. Doing this 5000 times takes 3.51 secs. However, if I move the actual matrix inversion part

[R] R_alloc vs. malloc

2008-04-11 Thread Søren Højsgaard
Dear list I have two (trivial) memory-questions related to a call with .C: If I allocate memory with R_alloc in a C-program (called with .C), will that memory "be taken from" the "available memory pool" (of a maximum of 4gb?) which R can allocate? (This is the impression I get from "Writing R e

[R] Error: value of 'SET_CXTAIL' must be a char or NULL, not a 'char'

2008-04-19 Thread Søren Højsgaard
Dear List On windows XP using R.2.6.2 I get the message Error: value of 'SET_CXTAIL' must be a char or NULL, not a 'char' in connection with calling C code (using the .Call interface). I have been unable to find any info on this (in Writing R extensions). Can anyone help me with understandi

Re: [R] Error: value of 'SET_CXTAIL' must be a char or NULL, not a 'char'

2008-04-19 Thread Søren Højsgaard
nsp = REAL(ans); PROTECT(mode = coerceVector(mode, REALSXP)) ; modep = REAL(mode); idx = 0; for (Gii=0; Giimailto:[EMAIL PROTECTED] Sendt: lø 19-04-2008 20:05 Til: Søren Højsgaard Cc: [EMAIL PROTECTED] Emne: Re: [R] Error: value of 'SET_CXTAIL' must be a char or NULL, not a 'ch

Re: [R] graphics history

2008-04-21 Thread Søren Højsgaard
On windows you can go to the graphics window; click history -> recording. You may also want to have a look at recordPlot() and replayPlot(). Regards Søren Fra: [EMAIL PROTECTED] på vegne af Norbert NEUWIRTH Sendt: ma 21-04-2008 10:59 Til: r-help@r-project.org Emn

  1   2   >