Displaying 20 results from an estimated 6000 matches similar to: "[R/S] strange solution"
2004 Sep 01
0
Re: [S] [R/S] strange solution
Hi, Erin:
A cleaner way is to pass "n2" to "outer" as a "..." argument, as
in the following modification of your code:
boot1 <- function(y,method="f",p=1) {
n1 <- length(y)
n2 <- n1*p
n3 <- n2 - 1
a <- 0.5*(outer(1:n3,1:n3,function(x,y, n2.){n2. - pmax(x,y)}, n2.=n2))
return(a)
}
y1 <- c( 9, 8, 7, 3, 6)
boot1(y=y1,p=4)
2004 Sep 01
1
[R/S] strange
Dear R and S People:
I have run across something very strange. Here is a function that I wrote
for R:
boot1 <- function(y,method="f",p=1) {
n1 <- length(y)
n2 <- n1*p
n3 <- n2 - 1
a <- 0.5*(outer(1:n3,1:n3,function(x,y){n2 - pmax(x,y)}))
return(a)
}
and here is the R output:
> y1
[1] 9 8 7 3 6
> source("boot1.R")
> boot1(y=y1,p=4)
[,1] [,2]
2004 Sep 02
0
Re: [S] [R/S] question re solution
> Someone else mentioned Venables and Ripley (2000) S
> Programming (Springer). Please see this or some other discussion of
the
> "..." argument.
The "Introduction to R" (from Cran website) also talks about it. See pg
49 - section 10.4 (was just reading this the other day).
Cheers
Manoj
-----Original Message-----
From: r-help-bounces at stat.math.ethz.ch
2004 Sep 02
1
[R/S] question re solution
Dear R and S People:
First, thank you to so many people for your help to my problem.
Here is the solution:
a <- 0.5*(outer(1:n3,1:n3,function(x,y,n2.){n2. - pmax(x,y)},n2.=n2))
I have one final pesky question, please:
During my experiments, I tried the following:
a <- 0.5*(outer(1:n3,1:n3,function(x,y,n2.=n2){n2. - pmax(x,y)}))
Why doesn't this work please?
thank you!
Sincerely,
2005 Jun 06
2
intervals and data frames
Dear R people:
I have a vector which runs from -1 to 1, by .1, inclusively.
Easy to set up. x <- seq(-1,1,.1)
I then sample 3 numbers from x.
y <- sample(x, 3)
Suppose one of my values is -0.7. I want to set up an interval
around that
y1 <- pmax(y-0.1,-1)
y2 <- pmin(y+0.1,1)
For the value -.7, the interval will run from -.8 to -.6.
There will be several intervals.
Again, nothing
2007 Oct 08
0
another try with Rmpi on Linux
Dear R People:
Here are my latest attempts for Rmpi:
This is the list of locations for mpi.h:
/home/faculty/hodgess/mpich2-1.0.5p4/src/include/mpi.h
/home/faculty/hodgess/include/mpi.h
/home/faculty/hodgess/lam-7.1.4/romio/adio/sgi/mpi3.1/mpi.h
/home/faculty/hodgess/lam-7.1.4/share/include/mpi.h
/usr/src/linux-2.4.21-20.EL/drivers/addon/fusion_20505/lsi/mpi.h
2006 Nov 14
3
lpSolve and mixed signs
Hi R People:
If you have a linear programming problem in which
some of the constraints have the "<=", some
have ">=" and some have "=", all in the same problem,
should the solver work?
I'm having trouble with that. Any help much appreciated!
Sincerely,
Erin Hodgess
mailto: hodgess at gator.uhd.eud
whoops!
mailto: hodgess at gator.uhd.edu
2004 Feb 09
1
Subset function of lm(); "rolling regressions"
Folks,
I asked a question on this mailing list about the subset support of
lm(). In a flash, I got three helpful responses from
Rajarshi Guha <rxg218 at psu.edu> <http://jijo.cjb.net>
Erin Hodgess <hodgess at gator.uhd.edu>
and
Peter Dalgaard <p.dalgaard at biostat.ku.dk>
:-) and it was just great.
The mistake I was making was in not understanding the notion of a
2003 Nov 14
3
Expressions and Functions
Dear R People:
When the D function is used for a symbolic derivative,
an expression is returned, which is fine.
How do you change that expression to a function, please?
I've been experimenting with substitute and deparse, but no success
yet.
This is R 1.8.0 for Windows.
thanks in advance for the help!
Sincerely,
Erin Hodgess
mailto: hodgess at gator.uhd.edu
2004 Jan 06
2
dist(x,y)
Hi Ryszard!
There is a dist function in R.
It's in the mva package.
You can set the kind of distance that you want.
Thanks,
Erin
mailto:hodgess at gator.uhd.edu
2006 Jun 28
1
installing R on RedHat
Dear R People:
Yet again, I am attempting to install R on RedHat Linux.
Here is my sorry attempt to date:
[hodgess at gator hodgess]$ rpm -vi R.rpm
warning: R.rpm: V3 DSA signature: NOKEY, key ID 97d3544e
error: cannot write to %sourcedir /usr/src/redhat/SOURCES
I only want to write it to my own userid, since I am the only one
who uses it.
Any suggestions would be much appreciated.
Thanks,
2007 Oct 08
0
shared object for Rmpi
Dear R yet again!
I finally got the Rmpi package to install! Yay!.
However, when I go into R to use it, there is an error with the dyn.load
file.
This should be simple (allegedly).
Please help.
Thanks,
Sincerely,
Erin
mailto: hodgess at gator.uhd.edu
/home/faculty/hodgess/R-2.6.0/bin
[hodgess at gator bin]$ ./R CMD INSTALL Rmpi_0.5-4.tar.gz
2004 Mar 28
2
splitting a character vector
Dear R People:
Suppose I have the following;
xa <- c("There are 5 dogs")
I would like to have a new character vector such that
xb[1] is There
xb[2] is are
xb[3] is 5
xb[4] is dogs
Since the original vector has length 1, substring will not work.
Any suggestions would be MOST welcome!
thanks
Erin Hodgess
Associate Professor
Department of Computer and Mathematical Sciences
2004 Sep 30
2
dev.print and win.print
Dear R Users:
Was there an answer to the question about
using dev.print and win.print to print as horizontal = FALSE,
please?
I was working on it and I didn't find the solution.
R 1.9.1 Windows
Thanks,
Erin Hodgess
mailto: hodgess at gator.uhd.edu
2006 Feb 27
2
install RPM file on Redhat
Dear R People:
I downloaded the RPM for Red Hat Linux.
How do I install this, please? When I looked
at the R Intallation manual, it seemed to be
referring to installing from source.
Thanks in advance!
Sincerely,
Erin Hodgess
Associate Professor
Department of Computer and Mathematical Sciences
University of Houston - Downtown
mailto: hodgess at gator.uhd.edu
2006 Aug 02
2
listing of permutations
Dear R People:
Suppose I have the 4 numbers: 1,2,3,4.
I would like to create a listing of the permutations
of 4 items taken 4 at a time.
Is there a built in function for that, please?
Thanks in advance!
R 2-3-1 for Windows or Linux
Sincerely,
Erin Hodgess
Associate Professor
Department of Computer and Mathematical Sciences
University of Houston - Downtown
mailto: hodgess at gator.uhd.edu
2006 Aug 29
3
Substring and strsplit
Dear R People:
I am trying to split a character vector into a set of individual
letters:
Ideal:
x3 <- c("dog")
"d" "o" "g"
I tried the following:
> strsplit(x3)
Error in strsplit(x3) : argument "split" is missing, with no default
> strsplit(x3,1)
[[1]]
[1] "dog"
I know that this is incredibly simple, but what am I doing
2007 Mar 28
0
By sentence
Hi again!
Please try something like this:
> zone1.df
zone sex len
1 1 male 15
2 1 fema 20
3 1 fema 17
4 2 fema 19
5 2 male 18
> str(zone1.df)
'data.frame': 5 obs. of 3 variables:
$ zone: Factor w/ 2 levels "1","2": 1 1 1 2 2
$ sex : Factor w/ 2 levels "fema","male": 2 1 1 1 2
$ len : int 15 20 17 19 18
>
2004 Mar 27
3
availability of version 1.9.0?
Dear R People:
When will version 1.9 (for Windows) be ready, please?
My reason for asking: there is an interesting library from
Bioconductor called tkWidgets. However, it will only
work with version 1.9.0 or higher.
Are there ways around this, or should I just be patient?
Thanks so much in advance!
Sincerely,
Erin Hodgess
Associate Professor
Department of Computer and Mathematical Sciences
2006 Jan 08
2
sending methods to a new package
Dear R People:
When creating a package, how do you include new methods and classes,
please?
I'm using the pacakge.skeleton command as a starting point.
Thanks,
Sincerely,
Erin Hodgess
Associate Professor
Department of Computer and Mathematical Sciences
University of Houston - Downtown
mailto: hodgess at gator.uhd.edu