Displaying 10 results from an estimated 10 matches for "draisma".
2011 Nov 14
2
how to include integrate in a function that can be solved with uniroot?
Hallo,
I am trying to define expectation as an integral
and use uniroot to find the distribution parameter
for a given expectation.
However I fail to understand how to define properly
the functions involved and pass the parameters correctly.
Can anyone help me out?
Thanks,
Gerrit Draisma.
This what I tried:
=======
> # exponential density
> g <- function(x,lambda){ lambda *exp(-lambda*x) }
>
> # expectation with lambda=1/10
> integrate(f = function(x,lambda=1/10) {x*g(x,lambda)}, 0,Inf)
10 with absolute error < 6.7e-05
>
> # *how to write this as...
2009 Jun 06
1
correct line types in lattice legends
Hallo R-users,
I do not understand how to specify the correct
line and symbol types in the legends of a lattice xyplot.
This is what I tried, but the line types and symbol in the
graph are not seen in the legend.
Any help is appreciated.
Thanks,
Gerrit.
library(lattice)
s<-rep(1:3,len=10)
x<- 1:10
y<- x+s+rnorm(10)
d<-data.frame(s,x,y)
xyplot(y~x, groups=s,data=d,
2010 Dec 07
3
understanding output of tapply/by cumsum
...ta = d$n, INDICES = list(d$a,
d$c), FUN = cumsum)
- attr(*, "class")= chr "by
---------
# these give (a) lists of one numerical vector(a)
Sn[5,2]
Sn[cbind(d$a,d$c)]
# how to access the individual cumsum values?
# and assign them to d$Sn?
--------------
Thanks,
Gerrit.
---
Gerrit Draisma
Department of Public Health
Erasmus MC, University Medical Center Rotterdam
Room AE-235
P.O. Box 2040 3000 CA Rotterdam The Netherlands
Phone: +31 10 7043787 Fax: +31 10 7038474
http://mgzlx4.erasmusmc.nl/pwp/?gdraisma
2008 May 08
1
Reading multiple tables from file
...a list of) data.frames
with names Pietje, Jantje
and variables I1,I2,...Value?
(I1,I2 are string or categorical,
Value is double).
I used an sed script to extract the tables
from the file into separte file,
but would rather be able to process
the output files directly.
Thanks,
Gerrit.
--
Gerrit Draisma
Department of Public Health
Erasmus MC, University Medical Center Rotterdam
Room AE-103
P.O. Box 2040 3000 CA Rotterdam The Netherlands
Phone: +31 10 7043124 Fax: +31 10 010-7038474
http://mgzlx4.erasmusmc.nl/pwp/?gdraisma
2007 Aug 01
2
Simple table with frequency variable
...ind out how to tabulate frequencies
of factors when the data have a frequency variable.
e,g:
i<-rep(1:5,2)
j<-rep(1:2,5)
N<-10*i+j
table(i,j) gives a table of ones
as each combination occurs only once.
How does one get a table with the corresponding N's?
Thanks!
Gerrit.
--
Gerrit Draisma
Department of Public Health
Erasmus MC, University Medical Center Rotterdam
Room AE-103
P.O. Box 2040 3000 CA Rotterdam The Netherlands
Phone: +31 10 4087124 Fax: +31 10 4638474
http://mgzlx4.erasmusmc.nl/pwp/?gdraisma
2008 Jul 30
1
Unexpected line type in lattice plot key on pdf device
...aph.
I would not expect that,
but may be I get something wrong.
Gerrit.
-------
library(lattice)
# pdf("pietje.pdf")
x<-0:10
xyplot((x^0.5)+(x^0.75)~x,type="o",lty=c(1,2),
auto.key=list(points=F,lines=T,columns=2, type="o",divide=1))
# dev.off()
-------
--
Gerrit Draisma
Department of Public Health
Erasmus MC, University Medical Center Rotterdam
Room AE-103
P.O. Box 2040 3000 CA Rotterdam The Netherlands
Phone: +31 10 7043124 Fax: +31 10 7038474
http://mgzlx4.erasmusmc.nl/pwp/?gdraisma
2008 Apr 18
1
Vertical bars with barchart
...ectangles=T))
gives what I need,
only I would like the bars to be vertical.
But
barchart(VADeaths,horizontal=F,
key=simpleKey(colnames(VADeaths),points=F,rectangles=T))
does not give what I need,
and I do not understand how to change the dimensions
accordingly.
Thanks,
Gerrit.
--
Gerrit Draisma
Department of Public Health
Erasmus MC, University Medical Center Rotterdam
Room AE-103
P.O. Box 2040 3000 CA Rotterdam The Netherlands
Phone: +31 10 7043124 Fax: +31 10 010-7038474
http://mgzlx4.erasmusmc.nl/pwp/?gdraisma
2010 May 19
1
printing a dataframe by categories
I am looking for the following simple question.
I have a data frame with names and numbers, divided in categories.
I would like to produce a text file with page breaks,
listing the names and numbers by category,
and totalling the numbers.
Example:
Name<-LETTERS[1:6]
Score<-rep(5:8,length.out=6)
Form<-rep(1:2,each=3)
x<-data.frame(Name,Score,Form)
This gives approximately
2009 Dec 04
1
latex.table for table with character and numeric columns
Hallo,
I have a dataset with one or two columns with character data
and the rest with numeric data.
Using latex.table from the quantreg package produced a table,
but I cannot set the decimals.
For instance:
---
> x<-data.frame(Name=c("Jan","Piet","Jan"), V=c(1,2.991,3))
> latex.table(as.matrix(x),file="x",caption="x")
>
2009 Jun 08
0
SMACOF joint configuration plot with bread data? (Michael Kubovy)
...(Duncan Temple Lang)
> 12. Re: "time series", "longitudinal data" or "trajectories"
> (Robert A LaBudde)
> 13. Finding a folder at the root level of an unknown drive
> (Dennis Fisher)
> 14. correct line types in lattice legends (Gerrit Draisma)
> 15. Re: Finding a folder at the root level of an unknown drive
> (Duncan Murdoch)
> 16. Re: S4: When is validObject issued? (or why S4 is killing
> me:( .. (Martin Morgan)
> 17. Re: Installation of R in Redhat Linux (64 bit) (Santosh)
> 18. Fitting with Bet...