Hi there
During execution of sapply I want to extract the number of times the
function given to supply has been executed. I came up with:
mylist - list(a=3,b=6,c=9)
sapply(mylist,function(x)as.numeric(gsub([^0-9],,deparse(substitute(x)
This works fine, but looks quite ugly. I'm sure that
(col1=t.x[1,],col2=sub(\\*$,,t.x[2,]))
greets
christian
--
Christian Bieli, project assistant
Institute of Social and Preventive Medicine
University of Basel, Switzerland
Steinengraben 49
CH-4051 Basel
Tel.: +41 61 270 22 12
Fax: +41 61 270 22 25
[EMAIL PROTECTED]
www.ispm-unibasel.ch
, Christian Bieli wrote:
Hi all
I have to generate some test data for import in an sql database. The
database is meant for web-based data entry in a study taking place in a
german speaking region, so factor levels of the variables include
umlauts.
The variables in the dataframe t.muster
Hi all
I have to generate some test data for import in an sql database. The
database is meant for web-based data entry in a study taking place in a
german speaking region, so factor levels of the variables include umlauts.
The variables in the dataframe t.muster are generated e.g. like this:
Hi there
I want to pass arguments (i.e. the response variable and the subset
argument) in a self-made function to glm.
Here is one way I can do this:
f.myglm - function(y,subfact,subval) {
glm(d.mydata[,y]~d.mydata[,'x1'],family=binomial,subset=d.mydata[,subfact]==subval)
}
str(d.mydata)
Hi everybody
Does anybody know a function that generates a factor of length N with K
levels given the proportions c(p1, p2,... ,pk)? It would not be too hard
to write it for myself, but if there's a preexisting one..
I searched the documentation and the help archive, but could not find
Dear Dave and Roland
Thanks for your answers! I think sample() does the job I'm looking for.
I also came up with rmultinom(), but could not make it working, because
I don't want several multinomial distributed vectors, but one vector
with K levels of predefined proportions. Propably there is a
RAM) and I work on a
Windows XP platform.
I am working on a Windows XP platform with R version 2.1 (all packages
updated).
Thanks for your answers.
Christian
--
Christian Bieli, project assistant
Institute of Social and Preventive Medicine
University of Basel, Switzerland
Steinengraben 49
CH
-.3976316 5.36526
--
Christian
--
Christian Bieli, project assistant
Institute of Social and Preventive Medicine
University of Basel, Switzerland
Steinengraben 49
CH-4051 Basel
Tel.: +41 61 270 22 12
Fax
to create all the dataframes in my workspace first. I tried
it with parentheses {}, but it obviously did not work.
Thanks in advance.
Christian
--
Christian Bieli, project assistant
Institute of Social and Preventive Medicine
University of Basel, Switzerland
Steinengraben 49
CH-4051 Basel
Tel.: +41
Dear R-Helpers
Given a function like
foo - function(data,var1,var2,var3) {
f - formula(paste(var1,'~',paste(var2,var3,sep='+'),sep=''))
linmod - lm(f)
return(linmod)
}
By typing
foo(mydata,'a','b','c')
I get the result of the linear model a~b+c.
How can I rewrite the
it with lapply(data, myfunction,...), but I dont know if
theres a way to index the two vars within lapply.
There is certainly a way to do it by looping, but lapply is much more
elegant.
Thank you for your help.
Christian
--
Christian Bieli, project assistant
Institute of Social and Preventive Medicine
to embed
fonts?
2. Is there a way to set up the resolution of the created ps/eps-file in
R (until now I did the settings in ghostview)?
3. I did not find particulars about the pointsize option. What is the
effect of changing the pointsize value?
With best regards
Christian
--
Christian Bieli
13 matches
Mail list logo