Displaying 20 results from an estimated 2000 matches similar to: "random walk w/ reflecting boundary: avoid control construct? [SEC=UNCLASSIFIED]"
2007 Oct 24
2
random walk w/ reflecting boundary: avoid control construct?
Dear expeRts,
recently I asked for a nice way to re-program a problem
without using control constructs such as "for" or
"sapply(1:length(x), ...". Is there a way to program
a random walk with a reflecting boundary without resorting
to such constructs? A working solution is
ranwalk <- function(length, bound) {
k <- cumsum(sample(c(-1, 1), length, replace=TRUE))
2007 Oct 07
0
Break [SEC=UNCLASSIFIED]
Hi,
You can exit out of the 'identify()' routine by either:
right-click > 'stop'
Or
click on 'stop > stop locator' in the top-left of the plot window.
The script should continue with line1, line2 etc.
Cheers Joe
Joe Crombie
Information and Risk Sciences
Bureau of Rural Science
Canberra Australia
p: +61 2 6272 5906
e: joe.crombie at brs.gov.au
2007 Oct 16
0
partitioning data [SEC=UNCLASSIFIED]
Hi Stephen,
Check the help for predict.glm(). The argument for passing new data is
actually 'newdata', as in:
> pred = predict(glm.model, newdata=form[150001:200000,-1],
> type="response")
Cheers Joe
-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org]
On Behalf Of stephenc at ics.mq.edu.au
Sent: Tuesday, 16
2007 Sep 20
1
Identify and plotting symbols. [SEC=UNCLASSIFIED]
Rolf turner wrote:
>I have been trying, unsuccessfully, to use identify() to (simply)
>return a list of the indices of points clicked on and overplot (with
>say a solid dot) each clicked-on point so that I can see where I've
>been. I.e. I don't want to see the indices printed on the screen; I
just want the points I've already selected to be highlighted.
>
>I
2007 Nov 30
0
vector sprintf argument [SEC=UNCLASSIFIED]
Hi Tom,
Try this:
> G <- "Number: %s"
> sprintf(G, toString(A))
[1] "Number: 3, 4, 5"
Cheers Joe
Joe Crombie
Biosecurity and Information Sciences
Bureau of Rural Science
Canberra Australia
p: +61 2 6272 5906
e: joe.crombie at brs.gov.au
-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org]
On Behalf Of
2007 Dec 21
1
using apply to loop [SEC=UNCLASSIFIED]
Hi Louis,
You could try this:
# find the index of the maximum value in each row of _data_, #
disregarding the last column classified <-
apply(data[,-(nclass+1)],1,which.max)
## or, if the maximum may be repeated:
classified <- apply(data[,-(nclass+1)], 1, FUN = function(x) which(x ==
max(x)))
# the variable _truth_ is just the last column of _data_ ?
truth <- data[,nclass + 1]
?table
2007 Sep 21
0
Time series graphs, question about using zoo [SEC=UNCLASSIFIED]
Hi Fang,
An easy way of doing this is by:
> matplot(one, pch = LETTERS[1:4], type = 'b')
Cheers Joe
Joe Crombie
Information and Risk Sciences
Bureau of Rural Science
Canberra Australia
p: +61 2 6272 5906
e: joe.crombie at brs.gov.au
-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org]
On Behalf Of fang liu
Sent: Friday,
2007 Jan 22
0
[UNCLASSIFIED] predict.survreg() with frailty term and newdata
Dear All,
I am attempting to make predictions based on a survreg() model with some censoring and a frailty term, as below: predict works fine on the original data, but not if I specify newdata.
# a model with groups as fixed effect
model1 <- survreg(Surv(y,cens)~ x1 + x2 + groups,
dist = "gaussian")
# and with groups as a random effect
fr <- frailty(groups,
2003 Jan 16
0
Summary: Faster way for weighted matching
I received some great ideas (see below) from a number of people to whom I am grateful. Here is the code I put together from many of their suggestions:
lx <- length(x)
lw <- length(w)
z <- matrix(abs( rep( x , lw ) - rep( w, each = lx ) ),
nrow=lw, ncol=lx, byrow=TRUE)
s <- pmax( abs( w - min(x) ), abs( w - max(x) ) )
z <- (1 - (z/rep(s,length=lx*lw))^3)^3
sums <-
2014 Nov 26
0
flac-1.3.1pre1
On Nov 25 00:43:22, mle+la at mega-nerd.com wrote:
> http://downloads.xiph.org/releases/flac/beta/
> Please test.
./test_replaygain.sh fails for me in tonegenerator(), saying:
./test_replaygain.sh[91]: mawk: not found
Testing FLAC replaygain 8000 (8000 x 1) ... -: ERROR: got partial sample
Apparently, the tone-generating awk script does not work with
my system's awk, which is
2012 May 03
1
Identifying case by groups in a data frame
Hi everyone,
I would like to identify the case by groups that is just bigger that
avg plus sd. For example, using species as group and petal.wid as my
variable in the iris data.
What's the better way to doit? creating a function?
So,the question is to identify the single element of each species that is just larger than a cut-off point (i.e. larger than mean + sd)
I made this, but I can not
2007 Sep 28
1
errorbar il lattice plot
Hi Everyone,
I would like to add errorbars to a lattice plot. I already have a function that
adds error bars to a plot (originally written by George Gilchrist) which takes
as arguments the coordinates of the point and then the size of the error bar. I
would like to integrate it in my lattice code but I seem to be stumped.
I can put the error bar function inside my code as if it were a panel
2008 Dec 27
0
Sonic Mega Collection crashes on startup.
Ubuntu 8.04
Wine 1.1.10
The sonic mega collection contains almost every genesis sonic game, along with some game gear sonics.
The game installed flawlessly, and the no-cd patch worked also. However, upon loading, it shows a faint shadow of the famous SEGA startup screen and then locks up and must be force killed. Changing it to various compat modes did nothing.
Normal Output:
Code:
name at
2010 Aug 29
1
PAM authentication fails
Hi,
I'm fighting all weekend on with auth and pam to authenticate local
system users. testuser is such local user and is in passwd and shadow. I
want to have local system users (testuser is one of them) and virtual
users. The virtual part works fine but I cannot get the local user to
connect.
Still pam fails finding the user. The suggested password mismatch at the
end is, in my eyes,
2012 Jan 31
0
Error in linearHypothesis.mlm: The error SSP matrix is apparently of deficient rank
Hi,
I have encountered this error when attempting a One-way Repeated-measure ANOVA
with my data.
I have read the "Anova in car: SSPE apparently deficient rank" thread
by I'm not sure the within-subject interaction has more degrees of freedom
than subjects in my case.
I have prepared the following testing script:
rm(list = ls())
2000 Sep 28
0
No subject
Prasad wrote:
> I wrote a function in R which uses tcltk package .... essentially I wanted
> to give within that function, a widget with 2 radiobuttons to choose
> between plotting Precip and Temperature plots. After the user has chosen
> one of the radiobuttons there is another widget that asking him to identify
> outliers. However, I am having a lot of problems...what R does is
2000 Sep 28
1
tcltk package functionality
Hello,
I wrote a function in R which uses tcltk package .... essentially I wanted
to give within that function, a widget with 2 radiobuttons to choose
between plotting Precip and Temperature plots. After the user has chosen
one of the radiobuttons there is another widget that asking him to identify
outliers. However, I am having a lot of problems...what R does is evaluate
the whole function
2009 Aug 20
0
Sweave truncation
Peter
Thank you for the information. I accidentally deleted Ken's post without
having read it.
Ken' s thought is great but as you said awful to implement
I thought that capture.output would come in handy some time when I first
saw it on an unrelated reply.
Just thought :- the latex listings package may have alternatives
If I remember correctly it has wrapping and other goodies but I
2006 Jan 23
1
too-large notches in boxplot (PR #7690)
PR #7690 points out that if the confidence intervals (+/-1.58
IQR/sqrt(n)) in a boxplot with notch=TRUE are larger than the
hinges -- which is most likely to happen for small n and asymmetric
distributions -- the resulting plot is ugly, e.g.:
set.seed(1001)
npts <- 5
X <- rnorm(2*npts,rep(3:4,each=npts),sd=1)
f <- factor(rep(1:2,each=npts))
boxplot(X~f)
boxplot(X~f,notch=TRUE)
I can
2005 Oct 08
1
add leading 0s to %d from png() {was Automatic creation of file names}
Dear useRs,
Is there a way to 'properly' format %d when plotting more than one
page on png()? 'Properly' means to me with leading 0s, so that the
PNGs become easy to navigate in a file/image browser. Lacking a better
solution I ended up using the code below, but would much prefer
something like
png("test_%d.png",bg="white",width=1000,height=700)
where %d