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,
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
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
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
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
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
?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
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
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]]
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
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)
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
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
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
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 -
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
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
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
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...
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
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
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) -
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
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
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
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,
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
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
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.
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
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
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
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
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
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 /*
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),
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]
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
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
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)
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
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,
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
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
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
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
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 =
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
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
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
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
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
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
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
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
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:
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
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
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
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
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
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
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
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
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
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
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
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
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,
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
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
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
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
+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
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,
75 matches
Mail list logo