You can use ave(), like this:
ke$maxa <- ave(ke$a, as.factor(ke$patid), FUN=max)
greetings,
remko
--
View this message in context:
http://r.789695.n4.nabble.com/manipulating-longitudinal-data-in-r-tp4649855p4650138.html
Sent from the R help mailing list archive at Nabble.com.
Dear R-list,
I am looking for a way to efficiently read a text file (see example below)
into a nested list. I can probably find an ugly way to do this, but I would
appreciate if anyone has (ideas for) efficient solutions.
It seems to me this is a bit similar to parsing XML, could tools from the
Thanks for that - too bad there isn't a simple workaround!
greetings
Remko
--
View this message in context:
http://r.789695.n4.nabble.com/deparse-substitute-x-on-an-object-with-S3-class-tp4605592p4607815.html
Sent from the R help mailing list archive at Nabble.com.
ass = "testclass")
# But this does :
> testlist2 <- unclass(testlist)
> print.testclass(testlist2)
Your object name is testlist2
thanks,
Remko Duursma
--
View this message in context:
http://r.789695.n4.nabble.com/deparse-substitute-x-on-an-object-with-S3-class-
Dear R-helpers,
I have trouble aligning an expression with a subscript, and text, in margin
text:
par(mar=c(6,6,1,1))
b <- barplot(1:3)
mtext(c("A","B","C"), at=b, side=1, line=1, cex=1.3)
mtext(expression(italic(C)[a]~(more~text)), at=0, line=1, side=1,cex=1.3)
As explained in the help files
dfr <- data.frame(txt= c("abab","ghghg","ththt","dfdfdf"), yvar=1:4)
ind <- substr(dfr$txt,1,2)
dfr[ind == "ab",]
greetings,
Remko
--
View this message in context:
http://r.789695.n4.nabble.com/Searching-for-the-first-two-characters-of-a-string-tp4089862p4090042.html
Sent from the R help ma
Hi Erin,
this is one way:
Block <- c("5600-5699","6100-6199","9700-9799","9400-9499","8300-8399")
splBlock <- strsplit(Block,"-")
sapply(splBlock, "[", 1)
greetings,
Remko
--
View this message in context:
http://r.789695.n4.nabble.com/strsplit-question-tp3896847p3896850.html
Sent from th
on of R.
remko
---------
Remko Duursma
Research Lecturer
Hawkesbury Institute for the Environment
University of Western Sydney
Hawkesbury Campus, Richmond
Mobile: +61 (0)422 096908
www.remkoduursma.com
On Tue, Sep 6, 2011 at 6:55 PM, Prof Brian Ripley wrote:
> On Tue, 6 Sep 2
print=TRUE and keep.source=TRUE, but neither seem to
affect this behavior.
thanks,
Remko
---------
Remko Duursma
Research Lecturer
Hawkesbury Institute for the Environment
University of Western Sydney
Hawkesbury Campus, Richmond
Mobile: +6
Works like a charm, thanks!
remko
--
View this message in context:
http://r.789695.n4.nabble.com/Sweave-allowing-errors-in-R-code-tp3728790p3729802.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
http
oject.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
On 11-08-08 9:48 PM, Remko Duursma wrote:
> Dear R-helpers,
>
>
> sorry if this is obvious, but I can't find this in the documentation.
>
> I am using Sweave, and have some code that
> You can modify the behaviour upon errors by setting the error option. Check
> ?option and ?stop
I looked at the 'error' settings in ?options, but I am not sure how that
would be helpful, since I am trying to avoid Sweave from halting after an
error occurs. I still want the error to be printed,
> Hi Remko,
>
> How about ?try
>
> Hope it helps,
>
> Tsjerk
>
Not quite, because then the code chunk in the final doc. will have this
try() around it as well - not too pretty for a user manual.
remko
> On Aug 9, 2011 5:30 AM, "Remko Duursma" wrote:
&g
Dear R-helpers,
sorry if this is obvious, but I can't find this in the documentation.
I am using Sweave, and have some code that does not actually work - but I
want to include it anyway, including the error message that R produces.
But on running Sweave() on my .Rnw file, it simply halts when i
Dear R-helpers,
I am using confint() within a function, and I want to turn off the message
it prints:
x <- rnorm(100)
y <- x^1.1+rnorm(100)
nlsfit <- nls(y ~ g0*x^g1, start=list(g0=1,g1=1))
> confint(nlsfit)
Waiting for profiling to be done...
2.5%97.5%
g0 0.4484198 1.143761
g1 1.038
am without a
problem, but I don't know how to get the CI for the ratio!
thanks,
remko
---------
Remko Duursma
Research Lecturer
Hawkesbury Institute for the Environment
University of Western Sydney
Hawkesbury Campus, Richmond
Mobile: +61 (0)422 096908
w
s(X), data=dfr, family=Gamma(link=log))
# I am interested in the relationship:
# Y(treatment =="B") / Y(treatment=="A") as a function of X, with a
confidence interval!
Do I just do a bootstrap here? Or is there a more appropriate method?
Thanks a lot for any help.
greetin
Here is another solution, using apply() and lapply().
# list of sequences corresponding to each row in data1:
seqlist <- apply(data1, 1, function(x)seq(from=x[1], to=x[2]))
# Find which rows of data2 are inside those sequences:
rowsInSeq<- unlist(lapply(seqlist , function(x)which(data2$position
Does ?snapshot3d not do what you want? Or what do you mean by 'export' ?
remko
-----
Remko Duursma
Research Lecturer
Hawkesbury Institute for the Environment
University of Western Sydney
Hawkesbury Campus, Richmond
Mobile: +61 (0)
uot;b"),title=" ")
legend("topright",c(" "," "),title="Legend",cex=0.6, bty='n', title.adj=0.15)
A bit of a hack but it works
If you want the title larger, it will probably not fit the box, which
you can omit by setting bty='
Hi Casper,
try this:
b <- barplot(table(x2),density=4, ylim=c(0,100))
tx2 <- table(x2)
text(b,tx2+5, as.character(tx2))
greetings,
Remko
--
View this message in context:
http://r.789695.n4.nabble.com/how-to-add-frequencies-to-barplot-tp3051923p3052067.html
Sent from the R help mailing lis
Ok, thanks. I just found the new (?) function rgl.postscript() , which works
better for me anyway.
Remko
Duncan Murdoch-2 wrote:
>
> On 02/11/2010 8:24 PM, Remko Duursma wrote:
>>
>> Hi all,
>>
>>> library(rgl)
>>> plot3d(1,1,1)
>>>
Hi all,
> library(rgl)
> plot3d(1,1,1)
> snapshot3d("somefile.png")
Error in rgl.snapshot(...) :
pixmap save format not supported in this build
Why does this no longer work?
thanks,
Remko
> sessionInfo()
R version 2.12.0 (2010-10-15)
Platform: i386-pc-mingw32/i386 (32-bit)
locale:
[1] LC_
Dear Karena,
Please read the posting guide : your example cannot be reproduced because we
don't know in which package the 'running' function resides.
Generally speaking, use 'points' or 'lines' to add points or lines to the
current device.
greetings,
remko
--
View this message in context:
h
Hi Alex,
is this what you want?
par(xaxs="i", yaxs="i", cex.axis=0.3)
plot(1, type='n', ann=FALSE, axes=FALSE,xlim=c(0,100),ylim=c(0,100))
axis(1, at=1:100)
axis(2, at=1:100)
abline(h=1:100,col="grey")
abline(v=1:100,col="grey")
X <- sample(1:100, 10)
Y <- sample(1:100, 10)
rect(X,Y,X+1,Y+1,col=
Or,
tap <- tapply(rate, rating, mean)
data.frame(Rating=as.factor(rownames(tap)), Mean=as.vector(tap))
remko
--
View this message in context:
http://r.789695.n4.nabble.com/One-silly-question-about-tapply-output-tp3015202p3015274.html
Sent from the R help mailing list archive at Nabble.com.
?prop.test
--
View this message in context:
http://r.789695.n4.nabble.com/clinical-data-analysis-tp3014811p3014856.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo
This probably fixes it, although an example would be nice :
write.csv(dfr, row.names=FALSE)
you change the names with the ?names function before writing it to a csv
file.
remko
--
View this message in context:
http://r.789695.n4.nabble.com/writing-a-table-tp3014821p3014839.html
Sent from the
I don't know why I forgot that you can do this as well :
area.poly(intersect(p1,p2))
... a bit more straightforward.
greetings,
Remko
--
View this message in context:
http://r.789695.n4.nabble.com/calculate-area-between-intersecting-polygons-tp3012980p3014581.html
Sent from the R help mailin
like this:
format(strptime(datetime, "%m/%d/%Y %H:%M"), "%m/%d/%Y %H:%M %Z")
remko
--
View this message in context:
http://r.789695.n4.nabble.com/datetime-objects-tp3013417p3013604.html
Sent from the R help mailing list archive at Nabble.com.
__
R-
Here is a different solution:
library(gpclib)
p1 <- as(poly1, "gpc.poly")
p2 <- as(poly2, "gpc.poly")
area.poly(p2) + area.poly(p1) - area.poly(union(p1,p2))
I.e., take areas of both polygons and subtract the union (check
plot(union(p1,p2)) ) to get the area of the intersection.
greetings,
R
Dear Jonas,
if you can write the difference in y-values between your polygons as a
function, you can use
integrate() to get the area between the polygons.
It sounds like perhaps your x-values will not match between the polygons
because they come from different sources, so you probably have to do
Hi Berwin and all others who replied:
that did the trick, thanks for your help!
remko
> Actually, it turns out that this example is simplified enough. :)
>
> I put this snippet into a file, compiled it via "R CMD SHLIB", loaded
> it into R and then was very surprised about the result of ".Fort
call g(x,y,z)
end
subroutine g(x,y,z)
z = x*y
end
calling this from R shows that subroutine g is not called. The code
compiled as executable works fine.
thanks,
Remko
-----
Remko Duursma
Research Lecturer
Centre for Plants and the E
led in the latter
I deleted it from the second library, but it still gives me the same
error message.
Remko
---------
Remko Duursma
Research Lecturer
Centre for Plants and the Environment
University of Western Sydney
Hawkesbury Campus
Richmond NSW 2
e
error message.
Remko
---------
Remko Duursma
Research Lecturer
Centre for Plants and the Environment
University of Western Sydney
Hawkesbury Campus
Richmond NSW 2753
Mobile: +61 (0)422 096908
www.remkoduursma.com
On Wed, Oct 20, 2010 at 10:00 AM, Duncan Murdoch
wrote:
> On
not attached):
[1] grid_2.12.0 tools_2.12.0
---------
Remko Duursma
Research Lecturer
Centre for Plants and the Environment
University of Western Sydney
Hawkesbury Campus
Richmond NSW 2753
Mobile: +61 (0)422 096908
www.remkoduursma.com
___
How about:
y[y[,2] %in% x.samp[,2],]
gives you the subset of y where values in the second column are restricted
to your sample from x.
You can then sample from this matrix, if you need to...
greetings,
Remko
--
View this message in context:
http://r.789695.n4.nabble.com/drawing-samples-bas
Try something like this:
dfr <- read.table(textConnection("plate.id well.id Group HYB
rlt1
1 P1 A1 Control SKOV3hyb 0.190
2 P1 A2 Control SKOV3hyb 0.210
3 P1 A3 Control SKOV3hyb 0.205
4 P1 A4 Control SKOV3hyb 0.206
5 P
I think you want ?solve ...
Remko
--
View this message in context:
http://r.789695.n4.nabble.com/matrix-help-tp2714378p2714896.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
https://stat.ethz.ch/ma
Please provide a reproducible example, like:
library(ca)
data(author)
p <- ca(author)
# now look at this:
str(p)
to find that this object of class 'ca' has lots of different results in it -
it is up to you to decide which ones you make into a dataframe.
cheers,
Remko
--
View this message i
(a$timestamp,nrow(b )
greetings,
Remko
---------
Remko Duursma
Research Lecturer
Centre for Plants and the Environment
University of Western Sydney
Hawkesbury Campus
Richmond NSW 2753
Dept of Biological Science
Macquarie University
North Ryde
PM, Remko Duursma wrote:
>> Thanks for the tip - this cleans up the code a lot!
>> Unfortunately, there is no gain in speed.
>
> Playing a little bit dirty,
>
> punion <-
> function(...)
> {
> n <- nargs()
> if (0L == n) new("gpc.poly")
>
duce('union', x)
> leaveout <- Unionall(leaves)
>
>
> On Tue, Jun 1, 2010 at 9:53 PM, Remko Duursma
> wrote:
>>
>> Dear R-helpers,
>>
>> thanks for yesterday's speeding-up tip. Here is my next query:
>>
>> I have lots of polygons
Baptiste,
thanks for the tip but this would give me an approximate union, and I
really need a (nearly) exact one. I am also not sure how to set the
alpha parameter in a non-arbitrary way.
Remko
-
Remko Duursma
Research Lecturer
Centre for
soutline, leaves[[i]])
})
# about 1sec here.
# Check it:
plot(leavesoutline)
thanks!
Remko
---------
Remko Duursma
Research Lecturer
Centre for Plants and the Environment
University of Western Sydney
Hawkesbury Campus
Richmond NSW 2753
Dept of Biolog
ks,
Remko
-----
Remko Duursma
Research Lecturer
Centre for Plants and the Environment
University of Western Sydney
Hawkesbury Campus
Richmond NSW 2753
Dept of Biological Science
Macquarie University
North Ryde NSW 2109
Australia
Mobile: +61 (0)4
Duncan,
thanks for the tip! I actually saw this 2D function but had no idea
how to use it in 3D. Works great.
Remko
-
Remko Duursma
Research Lecturer
Centre for Plants and the Environment
University of Western Sydney
Hawkesbury Campus
Richmond
.tri(m, delaunayn(m)))
plot3d(m[,1],m[,2],m[,3], type='l', col="black", size=2)
rgl.triangles(m[tm, 1], m[tm, 2], m[tm, 3], col="green")
---------
Remko Duursma
Research Lecturer
Centre for Plants and the Environment
Uni
d luck,
remko
-----
Remko Duursma
Research Lecturer
Centre for Plants and the Environment
University of Western Sydney
Hawkesbury Campus
Richmond NSW 2753
Dept of Biological Science
Macquarie University
North Ryde NSW 2109
Australia
Mobile: +61 (0)422 096908
www.rem
mko
-----
Remko Duursma
Research Lecturer
Centre for Plants and the Environment
University of Western Sydney
Hawkesbury Campus
Richmond NSW 2753
Dept of Biological Science
Macquarie University
North Ryde NSW 2109
Australia
Mobile: +61 (0)422 096908
www.remkoduursma.
tings,
Remko
-----
Remko Duursma
Post-Doctoral Fellow
Centre for Plants and the Environment
University of Western Sydney
Hawkesbury Campus
Richmond NSW 2753
Dept of Biological Science
Macquarie University
North Ryde NSW 2109
Australia
Mobile: +61 (0)422 096908
www.remkoduursma.com
20
Albert,
try something like this:
extfiles <- list.files(pattern=".ext")
for(f in extfiles){
process.data(f)
#etc
}
greetings,
Remko
-----
Remko Duursma
Post-Doctoral Fellow
Centre for Plants and the Environment
University of W
http://en.wikipedia.org/wiki/Software_release_life_cycle#Beta
r
-
Remko Duursma
Post-Doctoral Fellow
Centre for Plants and the Environment
University of Western Sydney
Hawkesbury Campus
Richmond NSW 2753
Dept of Biological Science
Macquarie
any(duplicated(c(1,2,2)))
r
-
Remko Duursma
Post-Doctoral Fellow
Centre for Plants and the Environment
University of Western Sydney
Hawkesbury Campus
Richmond NSW 2753
Dept of Biological Science
Macquarie University
North Ryde NSW 2109
Australia
umbers:
index <- c(0,1)
and then map like this:
> mylis[[which(index == 0)]]
[1] "x"
> mylis[[which(index == 1)]]
[1] "y" "z"
Is that what you want?
Remko
-
Remko Duursma
Post-Doctoral Fellow
Centre for Plan
Oh right I think I did not catch that *because of* the caps. Sorry.
r
-
Remko Duursma
Post-Doctoral Fellow
Centre for Plants and the Environment
University of Western Sydney
Hawkesbury Campus
Richmond NSW 2753
Dept of Biological Science
See the function 'convhulln' in the 'geometry' package. It uses this
algorithm : http://www.qhull.org/
remko
---------
Remko Duursma
Post-Doctoral Fellow
Centre for Plants and the Environment
University of Western Sydney
Hawkesbury
Try the rgl package.
r
-
Remko Duursma
Post-Doctoral Fellow
Centre for Plants and the Environment
University of Western Sydney
Hawkesbury Campus
Richmond NSW 2753
Dept of Biological Science
Macquarie University
North Ryde NSW 2109
Australia
Because print.foo is not defined if you only include the function "g"
in your namespace.
remko
-----
Remko Duursma
Post-Doctoral Fellow
Centre for Plants and the Environment
University of Western Sydney
Hawkesbury Campus
Richmond NSW 275
Something like:
format(as.Date("20090501",format="%Y%m%d"), "%Y %m %d")
r
-----
Remko Duursma
Post-Doctoral Fellow
Centre for Plants and the Environment
University of Western Sydney
Hawkesbury Campus
Richmond NSW 27
strsplit("hello","")[[1]]
r
---------
Remko Duursma
Post-Doctoral Fellow
Centre for Plants and the Environment
University of Western Sydney
Hawkesbury Campus
Richmond NSW 2753
Dept of Biological Science
Macquarie University
run the script fine from a command window just fine, from the
same directory.
Any pointers?
thanks,
Remko
-
Remko Duursma
Post-Doctoral Fellow
Centre for Plants and the Environment
University of Western Sydney
Hawkesbury Campus
Richmond NSW 2753
D
;
> --
> Karl Ove Hufthammer
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, sel
it.
Remko
-
Remko Duursma
Post-Doctoral Fellow
Centre for Plants and the Environment
University of Western Sydney
Hawkesbury Campus
Richmond NSW 2753
Dept of Biological Science
Macquarie University
North Ryde NSW 2109
Australia
Mobile: +61 (0)422
The example is reproducible! Did you see the first post?
remko
-
Remko Duursma
Post-Doctoral Fellow
Centre for Plants and the Environment
University of Western Sydney
Hawkesbury Campus
Richmond NSW 2753
Dept of Biological Science
Macquarie
> col=c("blue","red")mydfr$[treatment]
Yes, but I would like to use the function for lots of other dataframes
as well, so embedding 'mydfr' in the function is not the ideal
solution...
remko
---------
Remko Duursma
Post-D
' function to find the 'treatment' variable (after all, it
finds the other variables just fine).
Can someone explain why this is, and how to fix this?
thanks for your help
Remko
-
Remko Duursma
Post-Doctoral Fellow
Centre for Pla
pt out of bounds
If I get the Google Docs authorization by turning the proxy off;
options( RCurlOptions = list(verbose = TRUE,
proxy = ""))
And then turn it back on, I can connect just fine.
thanks,
Remko
--------
server and the port number.
(Windows XP).
thanks,
Remko
-
Remko Duursma
Post-Doctoral Fellow
Centre for Plants and the Environment
University of Western Sydney
Hawkesbury Campus
Richmond NSW 2753
Dept of Biological Science
Macquarie University
What is the problem exactly?
Remko
-
Remko Duursma
Post-Doctoral Fellow
Centre for Plants and the Environment
University of Western Sydney
Hawkesbury Campus
Richmond NSW 2753
Dept of Biological Science
Macquarie University
North Ryde NSW 2109
If that is not what you mean, can you give a specific example?
remko
> -N
>
> On 8/4/09 4:57 PM, Remko Duursma wrote:
>>
>> Hi Noah,
>>
>> there are a few ways to do this. Easiest is to keep adding an element
>> to a list, and then make it into a datafr
rame(do.call("rbind", resultlis))
greetings,
Remko
-----
Remko Duursma
Post-Doctoral Fellow
Centre for Plants and the Environment
University of Western Sydney
Hawkesbury Campus
Richmond NSW 2753
Dept of Biological Science
Macquarie Universi
Search on http://finzi.psych.upenn.edu/search.html
gives lots of hits on "pie chart".
See for example ?pie3D in the plotrix package.
Or, be more specific about what you are looking for.
Remko
-----
Remko Duursma
Post-Doctoral Fellow
fr$ POBR <- c(nstates:1)[table(testdfr$POB)][testdfr$POB]
greetings,
Remko
-
Remko Duursma
Post-Doctoral Fellow
Centre for Plants and the Environment
University of Western Sydney
Hawkesbury Campus
Richmond NSW 2753
Dept of Biological Science
Macquarie Univer
mko
-----
Remko Duursma
Post-Doctoral Fellow
Centre for Plants and the Environment
University of Western Sydney
Hawkesbury Campus
Richmond NSW 2753
Dept of Biological Science
Macquarie University
North Ryde NSW 2109
Australia
Mobile: +61 (0)422 096908
On Mon, Jul 20, 2009 at 1:41 PM, Gabor
Grothendi
ected? If so, can you explain why?
thanks for your help,
Remko
-
Remko Duursma
Post-Doctoral Fellow
Centre for Plants and the Environment
University of Western Sydney
Hawkesbury Campus
Richmond NSW 2753
Dept of Biological Science
Macquarie Univ
nd what is what there.
Does anyone know of an implementation of this algorithm in R, or
elsewhere, or uses the fdim package successfully and can help me out?
thanks,
Remko
---------
Remko Duursma
Post-Doctoral Fellow
Centre for Plant and Food Scienc
Check out
http://www.datathief.org/
Remko
-
Remko Duursma
Post-Doctoral Fellow
Centre for Plant and Food Science
University of Western Sydney
Hawkesbury Campus
Richmond NSW 2753
Dept of Biological Science
Macquarie University
North Ryde NSW
Thanks for that... the error message threw me off.
r
-
Remko Duursma
Post-Doctoral Fellow
Centre for Plant and Food Science
University of Western Sydney
Hawkesbury Campus
Richmond NSW 2753
Dept of Biological Science
Macquarie University
North
estdfr$yvar <- rnorm(10)
sp <- interpSpline(yvar ~ Date, testdfr)
preddfr <- data.frame(Date=as.POSIXct("2008-08-02"))
predict(sp, preddfr)
thanks,
Remko
-----
Remko Duursma
Post-Doctoral Fellow
Centre for Plant and Food Science
Univ
x <- list(integer(0),1,2)
x[sapply(x, length) > 0]
-
Remko Duursma
Post-Doctoral Fellow
Centre for Plant and Food Science
University of Western Sydney
Hawkesbury Campus
Richmond NSW 2753
Dept of Biological Science
Macquarie University
Nort
'Maeswrap-Ex.R' file myself, there are no problems.
Any pointers?
thanks
Remko
-----
Remko Duursma
Post-Doctoral Fellow
Centre for Plant and Food Science
University of Western Sydney
Hawkesbury Campus
Richmond NSW 2753
Dept of Biological Scie
Thanks for the tip. I did some reading on setHook, etc.. but I am
terribly confused. Do you (or someone else!) have a quick example of
what the call will look like?
thanks
remko
-
Remko Duursma
Post-Doctoral Fellow
Centre for Plant and Food
() or another lattice function?
dev.cur() does not help me, it just tells me "windows 2".
(Windows XP).
thanks
Remko
-----
Remko Duursma
Post-Doctoral Fellow
Centre for Plant and Food Science
University of Western Sydney
Hawkesbury Campus
Ri
Have you tried flush.console() ?
r
-
Remko Duursma
Post-Doctoral Fellow
Centre for Plant and Food Science
University of Western Sydney
Hawkesbury Campus
Richmond NSW 2753
Dept of Biological Science
Macquarie University
North Ryde NSW 2109
Sorry, forgot this line after the textConnection bit:
r <- readLines(myfile)
-----
Remko Duursma
Post-Doctoral Fellow
Centre for Plant and Food Science
University of Western Sydney
Hawkesbury Campus
Richmond NSW 2753
Dept of Biological Scie
r[setdiff(1:length(r),notread)]
# make it into a dataframe (I think this can be done prettier, but whatever)
z <- paste(mydata, collapse="\n")
read.table(textConnection(z))
greetings
Remko
-
Remko Duursma
Post-Doctoral Fellow
Centre for
ese estimated parameters:
shapeest <- 1.101
rateest <- 2.49
h <- hist(mydata, breaks=50, plot=FALSE)
plot(h$mids, log(h$density))
curve(log(dgamma(x, shape=shapeest, rate=rateest)), add=TRUE)
#Remko
-----
Remko Duursma
Post-Doctoral Fellow
Cen
Remko
-
Remko Duursma
Post-Doctoral Fellow
Centre for Plant and Food Science
University of Western Sydney
Hawkesbury Campus
Richmond NSW 2753
Dept of Biological Science
Macquarie University
North Ryde NSW 2109
Australia
Mobile: +61 (0)422 096908
On Tue, Jan 27, 2009 at 3:38 AM, Dan31415
a <- 0
b <- temp
}
else {
a <- temp[1]
b <- temp[2]
}
}
segments(x0=from,x1=to,
y0=a+from*b,y1=a+to*b,...)
}
---------
Remko Duursma
Post-Doctoral Fellow
Cent
Dear R list,
I was wondering if there is an easy fix to this problem (there are workarounds,
as always):
Within a for loop, we can use "next" to skip to the next index,
but how can we skip the next n indices?
So, I would like something that looks like;
for(i in 1:10){
if(somecondition)n
Hi Sit,
# Read the data:
dat <- scan(textConnection("
0.293290E-05 0.117772E-05 -0.645205 *rs2282755*
0.307521E-05 0.000314 0.412997 *rs1336838*
0.484017E-05 0.218311 0.188669 *rs2660664
rs967785*
0.977861E-05 0.070474 0.294653
Dear R-helpers,
I have a numeric vector, like:
x <- c(1,2,3,4,5,6)
I make this into a string for output to a text file, separated by \n:
paste(x, collapse="\n")
Is there a way to alternate the collapse argument? So between the first two
elements of x, I want to separate by " ", then by "\n",
# Trim white space (leading and/or trailing). Includes tabs.
trim <- function(str)gsub('^[[:space:]]+', '', gsub('[[:space:]]+$', '', str))
#
levels(SurveyData$direction_) <- trim(levels(SurveyData$direction_))
> Date: Thu, 14 Aug 2008 15:55:38 -0700
> From: [EMAIL PROTECTED]
> To: r-help@r-proj
d, so that we have the vector r, and want to find x.
# I have a (very) ugly solution:
chars <- paste(r,collapse="")zeros <- strsplit(chars,"1")x <- nchar(zeros[[1]])
Thanks for your help!
Remko Duursma
[[alternative HTML version deleted]]
96 matches
Mail list logo