Re: [R] Calculation of group summaries

2005-07-15 Thread Søren Højsgaard
Perhaps I lost track of what the original question was, but on my homepage http://genetics.agrsci.dk/~sorenh/misc/ there is a package called doBy in which there is a function called summaryBy (which mimics proc summary from sas). For example summaryBy(cbind(Weight,Feed)~Evit+Cu,

[R] Drawing a graph with vertices and edges using tcl/tk

2005-07-31 Thread Søren Højsgaard
Dear all; I would like to draw a graph with vertices and edges, and I guess tcl/tk would be appropriate. I don't know tcl/tk but have googled for a 10-page (or so) introduction to 'getting started with tcl/tk in R' but without any luck. - Does anyone know of the existence of such a document or

Re: [R] selecting outliers

2005-08-08 Thread Søren Højsgaard
Perhaps what Alessandro is after is simpler than that: Making a plot of data in a data frame, being able to click on 'suspicious points', getting the corresponding rows of a data out in a new data frame (for further inspection) while keeping the 'good points' in the plot (and perhaps redoing

[R] tcltk - automatically moving cursor to last line of tktext box - how?

2005-09-02 Thread Søren Højsgaard
Hi; I have a program which writes lines to a tktext box (of height, say, 10) with tkinsert(txto, end, paste(so,\n)) I would like my program to be such that it automatically scrolls down through the text box when it is full so that I always see the last 10 lines written. Can anyone help on

[R] Using unsplit - unsplit does not seem to reverse the effect of split

2005-09-27 Thread Søren Højsgaard
In data OME in MASS I would like to extract the first 5 observations per subject (=ID). So I do library(MASS) OMEsub - split(OME, OME$ID) OMEsub - lapply(OMEsub,function(x)x[1:5,]) unsplit(OMEsub, OME$ID) - which results in [[1]] [1] 1 1 1 1 1 [[2]] [1] 30 30 30 30 30 [[3]] [1] low low low

[R] After resizing a tkwidget, how do I get the size of the widget??

2005-09-28 Thread Søren Højsgaard
Dear all, I am trying make a small tcltk thing for drawing graphs with vertices, edges etc. I can draw the graph in a window. - I would like it so that if I resize the window, the graph will also be resized. To do this, I guess I need the size of the window, so that I can calculate the new

Re: [R] Regression slope confidence interval

2005-09-29 Thread Søren Højsgaard
?confint -Oprindelig meddelelse- Fra: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] På vegne af Christian Hennig Sendt: 29. september 2005 13:19 Til: r-help-request Mailing List Emne: [R] Regression slope confidence interval Hi list, is there any direct way to obtain

Re: [R] 'mean' function

2005-09-30 Thread Søren Højsgaard
Try base::mean.default Søren Fra: [EMAIL PROTECTED] på vegne af Lisa Wang Sendt: fr 30-09-2005 23:57 Til: R-Help Emne: [R] 'mean' function Hello, Could you please let me know how to see the mean function in R . The following is what I see when type in mean

[R] Calculating trace of products

2006-08-14 Thread Søren Højsgaard
Dear all, I need to calculate tr(A B), tr(A B A B) and similar quantities **fast** where the matrices A, B are symmetrical. I've searched for built-in functions for that purpose, but without luck. Can anyone help? Thanks in advance Søren [[alternative HTML version deleted]]

[R] lattice/xyplot: plotting 4 variables in two panels - can this be done?

2006-08-29 Thread Søren Højsgaard
Hi, I would like to create a plot of y1,y2,y3,y4 against x for several subjects such that y1 and y2 are plotted against x in one panel and y3 and y4 against x in another panel. Thus if there are 3 subjects I should end up with 6 panels. Is there a simple way of doing so (i.e. without calling

[R] Checking a package: Foreign function calls without 'PACKAGE' argument: - what must I do??

2006-09-01 Thread Søren Højsgaard
In the process of checking a package, I get the warning Foreign function calls without 'PACKAGE' argument: .Call(tr, ...) .Call(trProd, ...) See section 'System and foreign language interfaces' of the 'Writing R.. These functions are called using the wrappers trX - function(x, package=gRcox)

[R] Automatical download of needed packages from CRAN

2006-09-29 Thread Søren Højsgaard
I write a package foo which requires a package bar (from CRAN) to work. So in the DESCRIPTION file I write Depends: bar. I would like it to be so that when one installs foo, then it is automatically checked whether bar is installed, and if not then bar is also installed at the same time. I

[R] How to get the function names

2006-10-05 Thread Søren Højsgaard
I've defined the function getFunNames - function(FUN){ if (!is.list(FUN)) fun.names - paste(deparse(substitute(FUN)), collapse = ) else fun.names - unlist(lapply(substitute(FUN)[-1], function(a) paste(a))) fun.names } which gives what I want : getFunNames(mean) [1] mean

[R] Reading SAS data into R

2004-08-27 Thread Søren Højsgaard
to that..). The dataset is so large, that exporting it as an Excel file from SAS is not feasible (more than 65000 lines). I am reluctant to ask her to go through all the data base steps (then she'll just stick to SAS...). Can anyone help me out on that one? Thanks in advance Søren Højsgaard

[R] Bug in nlme under version 2.0.0

2004-10-08 Thread Søren Højsgaard
Dear all, Under version 2.0.0, I get the error below when calling summary() on a lme-object, whereas it works under version 1.9.1 (well, it did last week, before I upgraded). Any help on this? Thx in advance Søren library(nlme) mf - formula(Weight~Cu*(Time+I(Time^2)+I(Time^3))) lme1 -

Re: [R] New-user support package - suggestions?

2006-05-04 Thread Søren Højsgaard
Dear Andrew, I tend to agree with Uwe. A perhaps more useful approach for achieving your goal would be to create a video introduction to R. On http://www.learnvisualstudio.net/ you can find examples of such introductory videos for programming, for example in C#. I've experimented a little

Re: [R] New-user support package - suggestions?

2006-05-04 Thread Søren Højsgaard
And which editor would that be??? And don't say Emacs+ESS - people who are able to use Emacs+ESS would not need such videos! Best Søren -Oprindelig meddelelse- Fra: Frank E Harrell Jr [mailto:[EMAIL PROTECTED] Sendt: 4. maj 2006 14:30 Til: Søren Højsgaard Cc: Uwe Ligges; Andrew

Re: [R] export

2006-05-08 Thread Søren Højsgaard
One way is to use the sprintf-function which returns strings, and then write these strings in a file. But it is kludgy and there must be better ways... Best Søren -Oprindelig meddelelse- Fra: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] På vegne af Andrea Toreti Sendt: 8. maj 2006

Re: [R] re-direct to more or less

2006-06-29 Thread Søren Højsgaard
Something like less - function(a){ fn - paste(tempdir(),\\dataframe.txt,sep='',collapse='') write.table(a, quote=F, file=fn) system(paste(less ,fn)) } could perhaps help you (assuming that you have less on your computer). I agree that it would be very nice to have a built-in version...

Re: [R] re-direct to more or less

2006-06-29 Thread Søren Højsgaard
10:31 Til: Søren Højsgaard Cc: Mike Wolfgang; R-help list Emne: Re: [R] re-direct to more or less Søren Højsgaard [EMAIL PROTECTED] writes: Something like less - function(a){ fn - paste(tempdir(),\\dataframe.txt,sep='',collapse='') write.table(a, quote=F, file=fn) system

[R] Rgraphviz: How to control the colours of edges in a graph

2006-07-05 Thread Søren Højsgaard
Using Rgraphviz, I draw the undirected graph with vertices A,B,C and D and edges A:B, B:C, C:D, D:A, A:C. I want the vertices A and B to be red and C and D to be blue. The problem is the following: I want the edges A:B and B:C to be green and the edges C:D and C:A to be yellow, while the edge

[R] Rgraphviz: Setting the edge width

2006-07-06 Thread Søren Højsgaard
I create an undirected graph with Rgraphviz (see code below). I would like to make the edges thicker. Can anyone help on this?? Regards Søren V - c(A,B,C,D) E - list(c(A,B),c(B,C),c(C,D),c(D,A),c(A,C)) Eidx - lapply(E, match, V) edL - vector(list, length=length(V)) names(edL) -

Re: [R] how calculation degrees freedom

2006-01-27 Thread Søren Højsgaard
Degrees of freedom for mixed models is a delicate issue - except in certain orthogonal designs. However, I'll just point out that for lmer models, there is a simulate() function which can simulate data from a fitted model. simulate() is very fast - just like lmer(). So one way to get around

Re: [R] how calculation degrees freedom

2006-01-29 Thread Søren Højsgaard
function with the parameter estimates from the original fit of the lmer.model as starting values. Is this possible to achieve?? Best Søren Fra: [EMAIL PROTECTED] på vegne af Peter Dalgaard Sendt: lø 28-01-2006 01:12 Til: Douglas Bates Cc: Søren Højsgaard; R-help

[R] lattice: combining panel.xyplot with panel.abline - is this possible?

2006-01-30 Thread Søren Højsgaard
Consider this data frame: dat-data.frame(id=gl(3,5),time=rep(1:5,3),cm1=rep(c(2,3,4),each=5),cm2=rep(c(2.5,3.5,4.5),each=5),y=rnorm(15)) dat id time cm1 cm2 y 1 11 2 2.5 -1.0824549 2 12 2 2.5 -0.7784834 3 13 2 2.5 -1.7783560 4 14 2 2.5 0.5056637 5

[R] lme and Assay data: Test for block effect when block is systematic - anova/summary goes wrong

2006-02-06 Thread Søren Højsgaard
Consider the Assay data where block, sample within block and dilut within block is random. This model can be fitted with (where I define Assay2 to get an ordinary data frame rather than a grouped data object): Assay2 - as.data.frame(Assay) fm2-lme(logDens~sample*dilut, data=Assay2,

Re: [R] How to handle large dataframes?

2006-02-14 Thread Søren Højsgaard
I think it is well worth the effort to start using a database system like e.g. MySql for such purposes. If you look at http://gbi.agrsci.dk/~sorenh/misc/R-SAS-MySql/R-SAS-MySql.html then you'll find a short - and rudimentary - description of how to use MySql in connection with R and SAS (on

[R] Using optim() with a function which returns more than a scalar - alternatives?

2006-02-14 Thread Søren Højsgaard
I want to numerically maximize a function with optim (maximization over several arguments). optim() needs a function which returns a scalar only. However, it could be nice to be able to take other things out from the function as well. I'tried to create an attribute to the scalar with what I

[R] Using LAPACK in C-code to be loaded in R - getting-started-help

2006-02-20 Thread Søren Højsgaard
I want to speed up computations (involving matrices) by writing some C-code to be loaded. In the C-code, I need to invert matrices etc. As I've understood the writing R extensions doc, I can use use #include R_ext/Linpack.h in my .c-file and get access to linpack's facilities within my C-code.

Re: [R] need a R-code formatter?

2006-02-20 Thread Søren Højsgaard
You can use emacs with ESS - and/or try to encourage (kindly) the creator of Tinn-R to create such a code-formatter... Best Søren Fra: [EMAIL PROTECTED] på vegne af Michael Sendt: on 15-02-2006 07:05 Til: R-help@stat.math.ethz.ch Emne: [R] need a R-code

Re: [R] How to read more than 1 table?

2006-02-20 Thread Søren Højsgaard
for (k in list.files()){ ... } best Søren Fra: [EMAIL PROTECTED] på vegne af Atte Tenkanen Sendt: ma 20-02-2006 22:40 Til: r-help@stat.math.ethz.ch Emne: [R] How to read more than 1 table? Question 1) I want to read many csv-tables and run the same commands

[R] How can I see how %*% is implemented?

2006-02-22 Thread Søren Højsgaard
I would like to see how the matrix multiplication operator %*% is implemented (because I want to see which external Fortran/C routines are used). How can I do so? Best Søren __ R-help@stat.math.ethz.ch mailing list

Re: [R] Degree of freedom for contrast t-tests in lme

2006-02-22 Thread Søren Højsgaard
I think this happens because degrees of freedom in lme are calculated using the containment method (see documentation to proc mixed in SAS if you don't know the method). Formally this means that the t-tests are wrong for (most) unbalanced designs. However, if the sample sizes are not too

Re: [R] Summarize by two-column factor, retaining original factors

2006-02-24 Thread Søren Højsgaard
The summaryBy function in the doBy package might help you: summaryBy(x+y~Year, data=..., FUN=c(mean,var)) Best regards Søren Fra: [EMAIL PROTECTED] på vegne af Matt Crawford Sendt: fr 24-02-2006 17:18 Til: r-help@stat.math.ethz.ch Emne: [R] Summarize by

[R] When calling external C-function repeatedly I get different results; can't figure out why..

2006-03-08 Thread Søren Højsgaard
Dear all, I need to calculate tr(xyxy) fast for matrices x and y. Inspired by the R-source code, I've created the following functions (I am *new* to writing external C-functions, so feel free to laugh at my code - or, perhaps, suggest changes): #include Rinternals.h #include R_ext/Applic.h /*

[R] lme4/Matrix: Call to .Call(mer_update_y...) and LMEoptimize gives unexpected side effect...

2006-03-16 Thread Søren Højsgaard
Dear all I want to compute Monte Carlo p-values in lmer-models based on sampled data sets. To speed up calculations, I've tried to use internal functions from the Matrix package (as suggested ealier on the list by Doug Bates). So I did: fm2 - lmer(resistance ~ ET + position + (1|Grp),

[R] xyplot: getting data into the panel function

2006-04-04 Thread Søren Højsgaard
In xyplot, I would like to get the data into the panel function in the following sense: Consider xyplot(scc~time|cowidp, data=cow.s,type=c(l), panel=function(x,y,subscripts,...){ panel.xyplot(x,y,...) vvv-cow.s[which(!is.na(cow.s[subscripts,mastreat])),time]

[R] Seeing the definition of a function

2004-05-04 Thread Søren Højsgaard
to the general philosophy of the R project)? Thanks in advance Søren = Søren Højsgaard, PhD, Head of Research UnitPhone: +45 8999 1703 Biometry Research Unit, Fax: +45 8999 1300

[R] 'invalid HOMEDRIVE'

2004-06-05 Thread Søren Højsgaard
Dear all, One of my students have installed R1.9.0 on windows, and gets the fatal error 'invalid HOMEDRIVE' Can anyone help her/me out on that one? Thanks in advance Søren Højsgaard [[alternative HTML version deleted]] __ [EMAIL PROTECTED

[R] How to specify the hierarchical structure of a split plot using lmer ??

2005-04-27 Thread Søren Højsgaard
I have a problem getting the lmer function of the lme4 package to use the appropriate degrees of freedom for testing. Consider the Semiconductor data from the SASmixed package: library(SASmixed) Semi.lme - lme(resistance ~ ET * position, random=~1|Grp, data=Semiconductor) anova(Semi.lme)

SV: [R] Documentation of S3 and S4 classes, inheritance

2005-05-23 Thread Søren Højsgaard
for dummies'... Best regards Søren Højsgaard Fra: [EMAIL PROTECTED] på vegne af Ross Boylan Sendt: ma 23-05-2005 23:41 Til: r-help Emne: [R] Documentation of S3 and S4 classes, inheritance I'd like to have a class A that computes a likelihood

[R] How to sample from a linear mixed model

2005-06-19 Thread Søren Højsgaard
I would like to draw a sample from a linear mixed model y=Xb+Zu+e which has been fitted with lme(), i.e. a model y ~ N(Xb, C), where C=Z cov(u) Z' + cov(e). I've tried to figure out how to extract C from an lme object, because that would solve my problem when also using the predict() function,

Re: [R] Fwd: How to sample from a linear mixed model

2005-06-20 Thread Søren Højsgaard
Thanks. I wonder if there is a general way of extracting var(u) and var(e), which would be needed to simulate u and e. Clearly, one can get the estimated parameters, but is there a clever way of 'setting up' the matrices?? Best Søren On 6/19/05, Søren Højsgaard [EMAIL PROTECTED] wrote: I would

Re: [R] Problem trying to use boot and lme together

2005-06-21 Thread Søren Højsgaard
The problem with simulate.lme is that it only returns logL for a given model fitted to a simulated data set - not the simulated data set itself (which one might have expected a function with that name to do...). It would be nice with that functionality... Søren

[R] substitute in a named expression

2005-06-22 Thread Søren Højsgaard
I have a 'named expression' like expr - expression(rep(1,d)) and would like to replace the argument d with say 5 without actually evaluating the expression. So I try substitute(expr, list(d=5)) in which case R simply returns expr which when I 'evaluate' it gives eval(expr) Error in

Re: [R] string/character to number

2005-06-22 Thread Søren Højsgaard
This works x-c(a, b, a, b) x[x==a]-1 x[x==b]- -1 as.numeric(x) [1] 1 -1 1 -1 Fra: [EMAIL PROTECTED] på vegne af Jake Michaelson Sendt: on 22-06-2005 23:35 Til: R-help@stat.math.ethz.ch Emne: [R] string/character to number I did a very quick search of the

[R] Problems with eval() in connection with match.call()

2005-07-04 Thread Søren Højsgaard
Dear all, I have a problem when passing parms from one function to another when the argument list is just '...'. Consider this example: foo-function(){ xx - 111222 bar(x=xx) } bar - function(...){ cl - match.call(expand.dots=TRUE) print(cl) x - eval(cl$x) print(x) } foo() bar(x =

[R] How to detect which function is used for e.g. printing an object of a given class

2003-09-24 Thread Søren Højsgaard
class(x) - loglm print(x) } Is there an alternative way of dispatching the printing, such that the usual print method for loglm is used after doing what is special for hllm? Thanks in advance Søren Højsgaard == Søren Højsgaard, PhD, Senior Scientist

[R] Fax numbers

2003-02-13 Thread Søren Højsgaard
Hi ! I am trying to register. How to interpret the fax numer? Is it +43 1 58801 or +43 1 10798 I get a voice saying that these numbers do not exist? Best Søren Højsgaard -Oprindelig meddelelse- Fra: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sendt: 25. november 2002 19:29 Til: [EMAIL

[R] Turning a string into an expression

2003-03-03 Thread Søren Højsgaard
Dear all, I have e.g. aaa - list(1,2,3,4) and would like to get a hold on the list list(1,2,3,4) from aaa. Can anyone help with that? Best regards Søren Højsgaard __ [EMAIL PROTECTED] mailing list http://www.stat.math.ethz.ch/mailman

[R] Continuation string in Sweave

2003-04-02 Thread Søren Højsgaard
suggestion about how to make Sweave break the string ? Thanks in advance Søren Højsgaard == Søren Højsgaard, PhD, Senior Scientist Biometry Research Unit Danish Institute of Agricultural Sciences Research Centre Foulum, DK-8830 Tjele, Denmark Phone: +45

[R] Locating an executable from R

2003-06-24 Thread Søren Højsgaard
Hi ! From within R (on windows) I would like to locate and invoke an executable program (whose location is unknown to me). Can I do that? Thanks in advance Søren Højsgaard [[alternative HTML version deleted]] __ [EMAIL PROTECTED] mailing list

[R] Testing for numeric(0)

2003-07-17 Thread Søren Højsgaard
Hi all, Can anyone tell me how to test for numeric(0) ? Best regards Søren Højsgaard __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help

[R] How to get the full (overparametrized) model matrix

2004-01-13 Thread Søren Højsgaard
Dear all, If I use model.matrix on a formula including factors, then superflous columns of the model matrix are removed (or rather estimability constraints are imposed). Is there a way of getting the full model matrix, i.e. without removing redundant columns? Best regards Søren Højsgaard

[R] Evaluation of functionals

2004-04-05 Thread Søren Højsgaard
is that of anonymous functions: how to evaluate function(x)x^2 on x-10 without assigning the function to a name? Thanks in advance Søren Højsgaard [[alternative HTML version deleted]] __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman

Re: [R] memory problem in handling large dataset

2005-10-27 Thread Søren Højsgaard
An alternative could be to store data in a MySql database and then select a sample of the cases using the RODBC package. Best Søren Fra: [EMAIL PROTECTED] på vegne af Liaw, Andy Sendt: to 27-10-2005 19:21 Til: 'Berton Gunter'; 'Weiwei Shi'; 'r-help' Emne: Re:

Re: [R] Coefficient of association for 2x2 contingency tables

2005-12-06 Thread Søren Højsgaard
The CoCo bundle might contain various measures of association... Søren Fra: [EMAIL PROTECTED] på vegne af Alexandre Santos Aguiar Sendt: ti 06-12-2005 19:48 Til: r-help Emne: [R] Coefficient of association for 2x2 contingency tables Hi, Found no measure of

[R] Getting the same y-axis in a multivariate time series plot - plot(ts(...)); ylim does not do the trick

2005-12-29 Thread Søren Højsgaard
I try to obtain the same y-axis for a 2-dim time series with plot(ts(cbind(rnorm(10), rnorm(10,mean=4))),ylim=c(0,20)) but that does not work. Looking in the code for plot.ts, the ylim-argument seems to be taken care of, but not the way I expect. Can anyone help on this? Thanks Søren

[R] Saving data in an R package - how to maintain that t avariable is a 'factor' when it is coded as 1, 2, 3...

2006-01-13 Thread Søren Højsgaard
of the variables, but there ought to be another way. Can anyone help me on that? Best regards Søren Højsgaard __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org

[R] Latest revision of lme4 requires 'Matrix' = 0.995.2 but that version is not available on CRAN

2006-01-21 Thread Søren Højsgaard
I just updated the packages on my pc (windows xp). When loading lme4 I get library(lme4) Error: package 'Matrix' 0.995-1 was found, but = 0.995.2 is required by 'lme4' 'Matrix' 0.995-1 is indeed installed on my computer, but update.packages() does not capture a never version; and seemingly

Re: [R] Latest revision of lme4 requires 'Matrix' = 0.995.2 but that version is not available on CRAN

2006-01-21 Thread Søren Højsgaard
it can not run under windows... ? Anyway, that sort of things happen... I've now downloaded the previous version of lme4 as a tar.gz file - and that works. I wonder if it would be an idea to have a function rollback('pkg-name') for that sort of situations??? Best regards Søren Højsgaard

Re: [R] Latest revision of lme4 requires 'Matrix' = 0.995.2 but that version is not available on CRAN

2006-01-22 Thread Søren Højsgaard
of lme4 as a tar.gz file - and that works. I wonder if it would be an idea to have a function rollback('pkg-name') for that sort of situations??? Best regards Søren Højsgaard Moreover, now that I have updated to the latest release of lme4, I wonder how to get get a version of lme4

[R] xyplot: Plotting two variables, one as points - the other as line. Can that be done without explicitly using panel functions

2006-11-01 Thread Søren Højsgaard
Hi! Consider d - data.frame(x=1:10,y=5+1:10, yf=rnorm(10,5+1:10)) x yyf 1 1 6 5.268621 2 2 7 8.623896 3 3 8 8.114830 4 4 9 10.125955 5 5 10 9.977261 ... I plot y and yf against x with xyplot(y+yf~x,data=d,col=c('red','green'),pch=c(a,b)) BUT - I would like

Re: [R] SQLite: When reading a table, a \r is padded onto the last column. Why?

2007-01-02 Thread Søren Højsgaard
Hi, I put the iris data into a SQLite database with dbWriteTable(con, iris, iris, row.names=F, overwrite = T) Then I retrieve data from the database with rs - dbSendQuery(con, select * from iris) d1 - fetch(rs) dbClearResult(rs) Then I get head(d1) Sepal_Length Sepal_Width

Re: [R] linear coefficient combination stderr?

2007-02-13 Thread Søren Højsgaard
Try the esticon function in the doBy package. Regards Søren Fra: [EMAIL PROTECTED] på vegne af ivo welch Sendt: on 14-02-2007 04:21 Til: r-help Emne: [R] linear coefficient combination stderr? dear r-experts---I have scrounged around in google (searching

[R] Over-writing functions from other packages? What is a good strategy??

2007-03-20 Thread Søren Højsgaard
I am writing a package which uses the Rgraphviz package which in turn uses the graph package, but my question does not (I believe) pertain specifically to the these packages so therefore I dare to post the question here: I my package I have a function edges which works on some graphs I have

[R] unable to find inherited method for function edges, for signature ugsh, missing

2007-04-15 Thread Søren Højsgaard
I am new to using S4 methods and have run into this problem (on Windows XP using R 2.4.1): I am writing a package in which I use the graph package. I define my own classes of graphs as: setOldClass(graphsh) setOldClass(ugsh) setIs(ugsh, graphsh) (I know that I should have used setClass

[R] xyplot: Combining 'subscripts' and 'allow.multiple=T'

2007-04-20 Thread Søren Højsgaard
Dear all, Consider this plot xyplot(Sepal.Length + Sepal.Width ~ Petal.Length | Species, data = iris, allow.multiple=T, outer=F, panel = function(x,y,...) { panel.xyplot(x,y,...) } ) I want to *add* some things to each panel and what I want to add involves

[R] predict.nls - gives error but only on some nls objects

2007-05-31 Thread Søren Højsgaard
Dear list, I have encountered a problem with predict.nls (Windows XP, R.2.5.0), but I am not sure if it is a bug... On the nls man page, an example is: DNase1 - subset(DNase, Run == 1) fm2DNase1 - nls(density ~ 1/(1 + exp((xmid - log(conc))/scal)), data = DNase1,

Re: [R] predict.nls - gives error but only on some nls objects

2007-05-31 Thread Søren Højsgaard
Fra: Prof Brian Ripley [mailto:[EMAIL PROTECTED] Sendt: to 31-05-2007 14:28 Til: Søren Højsgaard Cc: r-help@stat.math.ethz.ch Emne: Re: [R] predict.nls - gives error but only on some nls objects Why do you think feeding a model fit (fm2DNase1) is suitable

Re: [R] R equivalent to Matlab's Bayes net toolbox

2007-07-17 Thread Søren Højsgaard
Jose, I am not entirely sure what Matlabs Bayes net toolbox does, but I guess it implements as propagation algorithm for Bayesian networks. There is no such package on CRAN - yet - but there will be soon: I've created a package called gRbayesnet which implements the Lauritzen-Spiegelhalter

Re: [R] using contrasts on matrix regressions (using gmodels, perhaps)

2007-07-25 Thread Søren Højsgaard
The doBy package has an esticon function which allows you to do that. Regards Søren Fra: [EMAIL PROTECTED] på vegne af Ranjan Maitra Sendt: to 26-07-2007 01:30 Til: R-help Emne: [R] using contrasts on matrix regressions (using gmodels, perhaps) Hi, I want to

[R] Evaluating f(x(2,3)) on a function f- function(a,b){a+b}

2007-08-22 Thread Søren Højsgaard
Dear list I have a function and a vector, say f - function(a,b){a+b} x - c(2,3) I want to evaluate f on x in the sense of computing f(x[1],x[2]). I would like it to be so that I can write f(x). (I know I can write a wrapper function g - function(x){f(x[1],x[2])}, but this is not really

Re: [R] Column naming mystery

2007-08-28 Thread Søren Højsgaard
+total.inf~hh,x,FUN=sum) hh total.sum total.inf.sum 1 1 5 9 2 2 610 3 3 711 4 4 812 Looks as expected to me. Regards Søren Højsgaard -Oprindelig meddelelse- Fra: [EMAIL PROTECTED] [mailto:[EMAIL

[R] The l1ce function in lasso2: The bound and absolute.t parameters.

2007-08-28 Thread Søren Højsgaard
Dear all, I am quite puzzled about the bound and absolute.t arguments to the l1ce function in the lasso2 package. (The l1ce function estimates the regression parameter b in a regression model y=Xb+e subject to the constraint that |b|t for some value t). The doc says: boundnumeric,