Again my example was't very clear: there were not enough same numbers in the
VECTOR.
What I need is something like this:
VECTOR<-c(0,3,6,3,11,2,11,4,3,4,7,7,6,4,8)
MATRIX<-c()
for(i in 1:length(VECTOR)){
v<-(unique(VECTOR[i:length(VECTOR)])[1:5])
MATRIX<-rbind(MATRIX,v)
}
MATRIX<
Yet another question:
Let's say I do the following:
set.seed(123)
tmpf <- function(){
x <- rpois(rpois(1,4),2)
}
n <- 3
m <- replicate(n, tmpf())
m
sub.m <- lapply(m, function(x)x[x>2])
'sub.m' gives me:
[[1]]
[1] 3 4
[[2]]
[1] 4 5
[[3]]
[1] 4
The question is: What do I need to do such that
Jim and Patrick,
Both of you made the same suggestion, which works great!
A follow-up question: Suppose I change the condition 'x>2' in 'lapply'
to 'x>4', as follows:
set.seed(123)
tmpf <- function() {
x <- rpois(rpois(1,4),2)
}
n <- 3
m <- replicate(n,tmpf())
m
sub.m <- lapply(m, function(x)x[x
Dear all,
I have the following problem:
- I have written a program in R which runs out of physical memory
on my MacBook Pro with 1.5 GB RAM
- The memory usage is much higher then I would expect from the
actual data in my global environment
- When I save the workspace, quit R, restart
You likely want the answer that Sarah has already given but in
addition you might also want to look at the thread below,
the point being that detaching a package still leaves portions:
https://www.stat.math.ethz.ch/pipermail/r-help/2006-July/109056.html
On 8/25/06, Sarah Goslee <[EMAIL PROTECTED
Try this and note we must pay attention to which environment
the expression is evaluated in.
fit.sum <- function(x, env = parent.frame())
eval(parse(text = paste(x, collapse = "+")), env = env)
# test
x1 <- x2 <- 1
fit.sum(c("x1","x2"))
On 8/25/06, Maria Montez <[EMAIL PROTECTED]> wrote:
>
Thank you for your answers yesterday. I now have another question!
Suppose that instead of creating a formula for a regression model I
simply wanted to add the variables. I believe I cannot use the
as.formula anymore. Again I tried to use expression to no avail. I get
an expression but I can't
Try:
embed(VECTOR, 5)[,5:1]
On 8/25/06, Atte Tenkanen <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Here is a vector and the result from the embed-command:
>
> VECTOR=c(0,3,6,3,11,2,4,3,7,6,4,5,10,2,3,5,8)
>
> > embed(VECTOR, dimension=5)
> [,1] [,2] [,3] [,4] [,5]
> [1,] 113630
>
AAh. Then my hypothesis has been rejected. Oh well!
Cheers,
Simon.
>Simon,
>
>Congratulations!
>
>It used to be that
>
> R Ihaka and R Gentleman
> R: A Language for Data Analysis and Graphics
> Journal of Computational and Graphical Statistics, 1996
>
>was used to cite R.
>
>I
On Fri, 25 Aug 2006, Luke Keele wrote:
> II am translating some gauss code into R, and gauss has a matrix
> product function called the horizontal direct product (*~), which is
> some sort of variant on the Kronecker product.
>
> For example if x is 2x2 and y is 2x2
>
> the horizontal direct produ
event.nab.2 is 0/1 and I dichotomized va to get va.2 to see if I could
get geeglm to work. glm has no problem with the data but geeglm chokes.
Each subject (patient.id) has at most 2 observations and more than 3/4
of the subjects have 2 observations. I have even worse problems trying
to use glmmPQL
try this:
> set.seed(123)
> tmpf <- function() {
+ x <- rpois(rpois(1,4),2)
+ }
> n <- 3
> m <- replicate(n,tmpf())
> m
[[1]]
[1] 3 2 4
[[2]]
[1] 0 2 4 2 2 5 2
[[3]]
[1] 2 0 4 1 0
> lapply(m, function(x)x[x>2])
[[1]]
[1] 3 4
[[2]]
[1] 4 5
[[3]]
[1] 4
>
On 8/25/06, xpRt.wannabe <[EMAIL PROTE
Try this:
xyplot(runif(365)~I(as.Date("1999-01-01") + 1:365),
scales=list(x=list(at=seq(as.Date('1999-1-1'), length=12, by='1
month'), labels=NULL)))
On 8/25/06, Benjamin Tyner <[EMAIL PROTECTED]> wrote:
> I would like a tick mark for each month; for example,
>
> xyplot(runif(365)~I(as.D
hi michael : ( i stupidly didn't send the initial email to the whole list so
they will have to read from the bottom ), it's clearer now but "fitting a
gaussian" still may not be the right thing to do in this case. someone else
can answer better but it sounds to me like you want to do some kind
Hi,
There are two ways that I know of:
detach("package:zoo")
or use detach() with the number of that package's
place in the search list.
> library(zoo)
> search()
[1] ".GlobalEnv""package:zoo" "package:methods"
[4] "package:graphics" "package:grDevices" "package:utils"
[7] "pack
On Fri, 25 Aug 2006, Prof Brian Ripley wrote:
> On Fri, 25 Aug 2006, Marc Kirchner wrote:
>
>> Dear "R-help"ers,
>>
>> using snow on socket connections, I ran into the following error
>>
>> > cl <- makeSOCKcluster(hosts)
>> Error in socketConnection(port = port, server = TRUE,
>> blocki
maybe something like:
"%*~%" <- function(x, y){
n <- nrow(x)
out <- matrix(0, n, ncol(x) * ncol(y))
for(i in 1:n)
out[i, ] <- c(y[i, ] %o% x[i, ])
out
}
x <- matrix(1:4, 2, 2, TRUE)
y <- matrix(5:8, 2, 2, TRUE)
x %*~% y
I hope it helps.
Best,
Dimitris
Dimitr
Aah, that works. The missing "package:..."
H.
>>> Sachin J <[EMAIL PROTECTED]> 8/25/2006 1:16 PM >>>
try detach("package:zoo")
Sachin
Horace Tso <[EMAIL PROTECTED]> wrote:
Sachin,
I did try that, ex
detach(zoo)
Error in detach(zoo) : invalid name
detach("zoo")
Error in detach("zoo")
On Fri, 25 Aug 2006, Horace Tso wrote:
> Dear list,
>
> I know it must be obvious and I did my homework. (In fact I've
> RSiteSearched with keyword "remove AND library" but got timed
> out.(why?))
Probably because the site is offline.
> How do I unload a library? I don't mean getting ride o
Sachin,
I did try that, ex
detach(zoo)
Error in detach(zoo) : invalid name
detach("zoo")
Error in detach("zoo") : invalid name
But zoo has been loaded,
sessionInfo()
Version 2.3.1 (2006-06-01)
i386-pc-mingw32
attached base packages:
[1] "methods" "datasets" "stats" "tcltk" "uti
try detach("package:zoo")
Sachin
Horace Tso <[EMAIL PROTECTED]> wrote:
Sachin,
I did try that, ex
detach(zoo)
Error in detach(zoo) : invalid name
detach("zoo")
Error in detach("zoo") : invalid name
But zoo has been loaded,
sessionInfo()
Version 2.3.1 (2006-06-01)
i386-pc-mingw32
Dear Janet,
Performing a traceback after the error gives a hint:
> tmp.pcc<-polychor(tmp.mat, ML=T, std.err=T)
> traceback()
8: stop("at least one element of ", sQuote("lower"), " is larger than ",
sQuote("upper"))
7: checkmvArgs(lower = lower, upper = upper, mean = mean, corr = corr,
see ?detach
Horace Tso <[EMAIL PROTECTED]> wrote:
Dear list,
I know it must be obvious and I did my homework. (In fact I've
RSiteSearched with keyword "remove AND library" but got timed
out.(why?))
How do I unload a library? I don't mean getting ride of it permanently
but just to unloa
I don't know if mount -l shows "something interesting" below.
We're wondering if there is an issue with the gcc compiler, which has been
updated since we last updated R. Do you see anything that could be wrong with
the info below?
We plan on updating to R 2.3.1, hoping that will clear thing
II am translating some gauss code into R, and gauss has a matrix
product function called the horizontal direct product (*~), which is
some sort of variant on the Kronecker product.
For example if x is 2x2 and y is 2x2
the horizontal direct product, z, of x and y is defined (in the Gauss
man
On 8/24/2006 4:34 PM, Gaspard Lequeux wrote:
> Hej,
>
> On Thu, 24 Aug 2006, Duncan Murdoch wrote:
>
>> On 8/24/2006 11:19 AM, Gaspard Lequeux wrote:
>>>
>>> On Wed, 23 Aug 2006, Duncan Murdoch wrote:
>>>
On 8/23/2006 5:15 PM, Gaspard Lequeux wrote:
> When exporting a image from rgl
Thank you. Yes, I do feel that I am under-qualified to even ask
questions of y'all. Plus I'm an astronomer, which doesn't help! ;)
I'll try again.
I have two columns of data, the first column (x) is a distance (or
length or separation) and the second column (y) is a flux (or number
of cou
Dear list,
I know it must be obvious and I did my homework. (In fact I've
RSiteSearched with keyword "remove AND library" but got timed
out.(why?))
How do I unload a library? I don't mean getting ride of it permanently
but just to unload it for the time being.
A related problem : I have some
I would like a tick mark for each month; for example,
xyplot(runif(365)~I(as.Date("1999-01-01") + 1:365),
scales=list(x=list(format="%b %Y",tick.number=12)))
I know I could make x numeric and use 'at' and 'labels', but I was
wondering if there is a more direct route I'm missing. (In partic
Dear List,
The following code produces a list, which is what I what:
set.seed(123)
tmpf <- function() {
x <- rpois(rpois(1,4),2)
}
n <- 3
m <- replicate(n,tmpf())
m
[[1]]
[1] 3 2 4
[[2]]
[1] 0 2 4 2 2 5 2
[[3]]
[1] 2 0 4 1 0
Now I need something that would to extract iteratively (or as many
Hello, Ted,
Thank you for your help!
So I can not contrast the mean yields between sections 1-8 and 9-11
under "Trt" but I can contrast mean yields for sections 1-3 and 6-11
because there exists significant interaction between two factors
(Trt:section4, Trt:section5). Could I use the commands
Hi,
I'm making an interface, where a Tcl/Tk window have few listbox widgets.
I need to select separate parameters from separate listboxes.
It is clear how to get cursor selection value, once you know which listbox
widget you clicked.
The problem is I can't figure out which one tcltk command to use
--- Prof Brian Ripley <[EMAIL PROTECTED]> wrote:
> savePlot is just an internal version of dev.copy, part of the support for
> the menus on the windows() graphics device.
>
> It is described in `An Introduction to R' (the most basic R manual).
"the most basic R manual" doesn't quite answer my q
Hi,
Here is a vector and the result from the embed-command:
VECTOR=c(0,3,6,3,11,2,4,3,7,6,4,5,10,2,3,5,8)
> embed(VECTOR, dimension=5)
[,1] [,2] [,3] [,4] [,5]
[1,] 113630
[2,]2 11363
[3,]42 1136
[4,]342 113
[5,]
On Fri, 25 Aug 2006, Charles wrote:
> Hello all,
> I am using the function lm to do my weighted least
> square regression.
>
> model<-lm(Y~X1+X2, weight=w)
>
> What I am confused is the r.squared.
What r.squared? There is no r.squared in that object, but it is
calculated by the summary method
Michael Koppelman wrote:
> I apologize if this is redundant. I've been Googling, searching the
> archive and reading the help all morning and I am not getting closer
> to my goal.
>
> I have a series of data( xi, yi). It is not evenly sampled and it is
> messy (meaning that there is a lot of scat
Hello all,
I am using the function lm to do my weighted least
square regression.
model<-lm(Y~X1+X2, weight=w)
What I am confused is the r.squared.
It does not seem that the r.squared for the weighted
case is an ordinary 1-RSS/TSS.
What is that precisely?
Is the r.squared measure comparable to tha
On 8/25/06, Sebastian P. Luque <[EMAIL PROTECTED]> wrote:
> On Fri, 25 Aug 2006 17:51:24 +0200,
> Stefan Grosse <[EMAIL PROTECTED]> wrote:
>
> > Dear List, I try to make a xyplot with different colors and symbols, I
> > came this far:
>
> > library(DAAG)
> > xyplot(csoa~it|sex*agegp,data=tinting,gr
R> trellis.par.set(superpose.symbol=list(pch=c(1, 2)))
Warning message:
Note: The default device has been opened to honour attempt to modify trellis
settings in: trellis.par.set(superpose.symbol = list(pch = c(1, 2)))
R>
xyplot(csoa~it|sex*agegp,data=tinting,groups=target,auto.key=list(space="ri
I didn't see a response to this, and am not an expert, but wanted to
point you in the right direction.
You should ask this question on the bioconductor mailing list.
The site is very much alive at this end (though I'm very close to it,
physically), so you'll need to provide some more information
Hi
and if speed is an issue and object is numeric matrix something like
function(x) which(colSums(abs(diff(x)))==0)
is a little bit quicker
Cheers
Petr
On 25 Aug 2006 at 13:39, [EMAIL PROTECTED] wrote:
Date sent: Fri, 25 Aug 2006 13:39:48 +1000
From: <[EMAIL PR
Thanks Matthew. This does help. But from the discription of the function and
examples, we are not able to use groups argument and the trellis settings you
mentioned.
Jen.
- Original Message -
From: Wiener, Matthew, [EMAIL PROTECTED]
Sent: 2006-08-25, 09:46:44
To: jennystadt; r-help
Adam D. I. Kramer wrote:
> Hello,
>
> I have an HLM-like situation: a data frame with rows representing
> individuals, and columns representing some statistics for the individual
> (e.g., a mean and variance for that individual, plus the number of
> observations for that person).
>
>
On Fri, 25 Aug 2006 17:51:24 +0200,
Stefan Grosse <[EMAIL PROTECTED]> wrote:
> Dear List, I try to make a xyplot with different colors and symbols, I
> came this far:
> library(DAAG)
> xyplot(csoa~it|sex*agegp,data=tinting,groups=target,pch=list(1,2),auto.key=list(space
> = "right"))
> this pro
Hello,
I have an HLM-like situation: a data frame with rows representing
individuals, and columns representing some statistics for the individual
(e.g., a mean and variance for that individual, plus the number of
observations for that person).
I'm interested in computing a confide
yep, it works!
impressingly elegant. R seems worth to dig into the details. I'll try harder.
Thank You very much
Peter
-Ursprüngliche Nachricht-
Von: Prof Brian Ripley [mailto:[EMAIL PROTECTED]
Gesendet: Freitag, 25. August 2006 17:53
An: Marx Peter
Cc: r-help@stat.math.ethz.ch
Betreff
On Fri, 25 Aug 2006, [EMAIL PROTECTED] wrote:
> Hi,
>
> I have a casting/formatting question on hist.POSIXt:
>
> The histogram plot from POSIXct works perfect (with help of Prof. Ripley
> -thanks!).
> When processing the hist(plot=FALSE) output and then plotting the
> results over the x-axis (bi
Dear List,
I try to make a xyplot with different colors and symbols, I came this far:
library(DAAG)
xyplot(csoa~it|sex*agegp,data=tinting,groups=target,pch=list(1,2),auto.key=list(space
= "right"))
this produces a plot with different colors and symbols but unfortunately
the legend does only fol
On Fri, 25 Aug 2006, Marc Kirchner wrote:
> Dear "R-help"ers,
>
> using snow on socket connections, I ran into the following error
>
> > cl <- makeSOCKcluster(hosts)
> Error in socketConnection(port = port, server = TRUE,
> blocking = TRUE : all connections are in use
>
> wi
On Fri, 25 Aug 2006, Marc Kirchner wrote:
>
> As - for administrative reasons - I would prefer to use snow's
> SOCK capabilities (instead of MPI and the like), I wonder if there is a
> way to increase the number of simultaneous open connections allowed in
> an R session (~100 would be sufficient).
I apologize if this is redundant. I've been Googling, searching the
archive and reading the help all morning and I am not getting closer
to my goal.
I have a series of data( xi, yi). It is not evenly sampled and it is
messy (meaning that there is a lot of scatter in the data). I want to
fi
It's the "|source" in your formula that tells lattice to separate them.
If you drop that, you'll get all points without S and P distinguished at
all. If you add a groups argument, you should get them presented with
different colors/symbols/etc. depending on your trellis settings (warning:
unteste
Hi,
I have a casting/formatting question on hist.POSIXt:
The histogram plot from POSIXct works perfect (with help of Prof. Ripley
-thanks!).
When processing the hist(plot=FALSE) output and then plotting the
results over the x-axis (bins) coming from hist(), I lose the date/time
labels, getting in
Hi All,
I want to plot y~ x under the condition of variable a and b. Followed is the
dataset:
plotid lndenlnvol source
369 9037.0 10.419002 -4.101039226 S
370 9037.0 9.840548 -2.432385723 S
371 9037.0 8.973351 -1.374842169 S
372 9037.0 8.242756 -0
biglm fits linear and generalized linear models to large data sets, using
bounded memory.
What's New: generalized linear models.
-thomas
Thomas Lumley Assoc. Professor, Biostatistics
[EMAIL PROTECTED] University of Washington, Seattle
Dear "R-help"ers,
using snow on socket connections, I ran into the following error
> cl <- makeSOCKcluster(hosts)
Error in socketConnection(port = port, server = TRUE,
blocking = TRUE : all connections are in use
with "showConnections(all=T)" showing 50 open connections
On Fri, 25 Aug 2006, Joerg van den Hoff wrote:
>
> maybe someone's interested:
> I made the same observation of seemingly very slow recursion recently: just
> for fun I used the (in)famously inefficient
>
> fib <- function(n = 1) {
> if (n < 2)
> fn <- 1
> else
> fn <- fib(n - 1) + f
Dear Rense,
(This question was posted a few days ago when I wasn't reading my email.)
So-called effect decompositions are simple functions of the structural
coefficients of the model, which in a model fit by sem() are contained in
the $A component of the returned object. (See ?sem.) One approach,
i tried fib(30):
R: 8.99s
Python (interpreted): 0.96s
Python (interpreted but using psyco library): 0.03s
C++: 0.015s
cheers
Damien
--- On Fri 08/25, Joerg van den Hoff < [EMAIL PROTECTED] > wrote:
From: Joerg van den Hoff [mailto: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTEC
Hi R-users,
I am trying to calculate the correlation between 3 vectors of numbers.
Is there any other solution then passing by kendall.w function which
need ranks in input?
Thanks,
Bianca Dimulescu
__
R-help@stat.math.ethz.ch mailing list
https://stat
Thank you! That is exactly what I needed.
Roger D. Peng wrote:
> Take a look at ?plot.stepfun.
>
> 'ecdf()' returns an object of class "ecdf" inheriting from class
> "stepfun" and 'plot.ecdf()' calls 'plot.stepfun'.
>
> -roger
>
> Catherine Carter wrote:
>
>> Hi everyone,
>>
>> I have what may a
On Fri, 2006-08-25 at 09:08 -0400, Catherine Carter wrote:
> Hi everyone,
>
> I have what may appear to be a newbie question, but I have looked
> everywhere I can think to look and I cannot find an answer. On page 35
> of "An Introduction to R" the following command appears:
> plot(ecdf(eruptio
Thank you, Thomas and Joerg! Joerg's example is extremely useful. In
fact I had wanted to compare R with other interpreting language myself.
I heard that Ruby is not fast among scripting languages. I thus believe
that there is room to improve R's recursive function.
Jason
--- Joerg van den Hoff
Take a look at ?plot.stepfun.
'ecdf()' returns an object of class "ecdf" inheriting from class "stepfun" and
'plot.ecdf()' calls 'plot.stepfun'.
-roger
Catherine Carter wrote:
> Hi everyone,
>
> I have what may appear to be a newbie question, but I have looked
> everywhere I can think to look
Hi everyone,
I have what may appear to be a newbie question, but I have looked
everywhere I can think to look and I cannot find an answer. On page 35
of "An Introduction to R" the following command appears:
plot(ecdf(eruptions), do.points=FALSE, verticals=TRUE). What is the
do.points argument?
--- Gabor Grothendieck <[EMAIL PROTECTED]>
wrote:
> Use cbind to create a two column matrix, mat,
> and multiply that by the appropriate inflation
> factors.
> Then use rowsum to sum the rows according to the
> id grouping factor.
>
> inf.fac <- list(year1 = 1, year2 = 5, year3 = 10)
> mat <- cb
Thomas Lumley wrote:
> On Thu, 24 Aug 2006, Jason Liao wrote:
>
>> I recently coded a recursion algorithm in R and ir ran a few days
>> without returning any result. So I decided to try a simple case of
>> computing binomial coefficient using recusrive relationship
>>
>> choose(n,k) = choose(n-1,
Andrej Kastrin <[EMAIL PROTECTED]> writes:
> Simon Blomberg wrote:
> > Hi all,
> >
> > We've just had a paper accepted for publication in Nature. We used R for
> > 95% of our analyses (one of my co-authors sneaked in some GenStat when I
> > wasn't looking.). The preprint is available from the Na
Simon Blomberg wrote:
> Hi all,
>
> We've just had a paper accepted for publication in Nature. We used R for
> 95% of our analyses (one of my co-authors sneaked in some GenStat when I
> wasn't looking.). The preprint is available from the Nature web site, in
> the open peer-review trial section.
On Fri, 25 Aug 2006, Stefan Grosse wrote:
> Dear List,
>
Stefan,
> after updating the exactRanksumTests package I receive a warning that
> the package is not developed any further and that one should consider
> the coin package.
>
> I don't find the signed rank test in the coin package, only th
Dear Tom,
To add a few things to explore:
- I'd definitely go with LaTeX. Depending on how much formatting control you
want, though, and if your coworkers are reluctant to jump into LaTeX, you
might start with reStructuredText (http://docutils.sourceforge.net/rst.html)
or text2tags (http://txt
Dear all,
I would like to thank everybody who replied for their useful
suggestions. Maybe, I am going through the book statistics to teach
(fresh) myself.
Wish you have a nice weekend.
Regards, Muhammad Subianto
On this day 24/08/2006 18:59, Muhammad Subianto wrote:
> Dear all,
> I apologize i
Piet Bell skreiv:
> The publisher of our paper has requested:
>
> 1. all tick marks should point inwards instead of outwards.
Point him to William S. Cleveland’s excellent book /The Elements of Graphing
Data/, where Cleveland strongly recommends that tick marks should point
*outwards* ‘because t
Dear List,
after updating the exactRanksumTests package I receive a warning that
the package is not developed any further and that one should consider
the coin package.
I don't find the signed rank test in the coin package, only the Wilcoxon
Mann Whitney U-Test. I only found a signed rank test in
Hi all,
We've just had a paper accepted for publication in Nature. We used R for
95% of our analyses (one of my co-authors sneaked in some GenStat when I
wasn't looking.). The preprint is available from the Nature web site, in
the open peer-review trial section. I searched Nature for previous
Deepayan Sarkar gmail.com> writes:
> Right. the grid call shouldn't be necessary, "axis.line" controls the
> panel borders. And tck can be a vector, to get rid of the ugly bumps
> on top:
>
> xyplot(x ~ x | g, type = "l", lwd = lwd,
>scales = list(tck = c(-1, 0)),
>par.settings =
76 matches
Mail list logo