Hi Murali,
Just an idea, probably not the best :
x<-1:4
y<-1:6
z<-matrix(1:(length(x)*length(y)),nrow=length(x))
I <- matrix(1,nrow=length(x),ncol=length(y))
I[row(I)==col(I)] <- 0
sum (outer (x, y, '*') * I)
sum (outer (x, y, '*') * z * I)
Hope this helps,
Nael
On Wed, Jul 2, 2008 at 6:3
Hi Michal,
This paper by John Fox may help you to precise what you are looking for and
to perform your analyses
http://cran.r-project.org/doc/contrib/Fox-Companion/appendix-bootstrapping.pdf
Nael
On Tue, Jul 22, 2008 at 3:51 PM, Michal Figurski <
[EMAIL PROTECTED]> wrote:
> Dear all,
>
> I don't
Not very elegant but seems to work:
pats.df <- as.data.frame(t(sapply (1:length(pats), function (i)
do.call(cbind,pats[[i]]
colnames(pats.df) <- names(pats[[1]])
# then
pats2 <- lapply (1:nrow(pats.df), function (i) as.list(t(pats.df)[,i]))
Nael
On Wed, Jul 23, 2008 at 3:23 PM, Michael Frie
ith all kinds of other
functionalities, which work fine).
#This function is unimportant; it generates random paths
randomstring<-function(a=1,n=31){
z<-vector(length=a)
for (h in 1:a){
x<-"n"
for (i in 1:n){
if (runif(1)>0.5){
y<-round(runif(1,-.5,9.5))
}
Dear Dr. Ripley,
Thank you very much for your comments concerning do.call and call. Obviously,
until this week I was fully unaware of the existence of both functions. I
changed the following code
x<-do.call(method,methodArgs)
into
x<-call(method,Path)
eval(x)
and after deleting `
You were very close to an answer :
as.vector(unlist(df[1,]))
Nael
On Wed, Aug 27, 2008 at 7:53 AM, Ronnen Levinson <[EMAIL PROTECTED]> wrote:
>
> Hi.
> How do I convert a one-dimensional array of characters to a character
> vector? In the example below I am trying to get the result c("a",
Sorrry for re-sending this message as 1) a non-subscriber initially,
then 2) from an un-subscribed e-mail.
As context, I am a newbie, but preparing for a moderately deep dive into
new areas af analysis while becoming familiar with R, at the same time.
I have looked at the dependencies, amd im
to the chosen
environment
> test2 <- function(){
+ a <- 1
+ b <- 2
+ assign("a", a, envir=parent.frame(n=1))
+ assign("b", b, envir=.GlobalEnv)
+ return(NULL)
+ }
>
> # Suppose test2 is launched by another function
> test2.launcher <- function() {
+ test2()
Try do.call("rbind", nameofyourlist)
Nael
On Sat, Sep 27, 2008 at 8:51 AM, Matthew Pettis <[EMAIL PROTECTED]>wrote:
> Hi,
>
> I have a list output from the 'lapply' function where the value of
> each element of a list is a data frame (each data frame in the list
> has the same column types). How
Hi John,
Wouldn't you get the same with just mapply(sub, patt, repl, X) ?
Nael
On Tue, Oct 7, 2008 at 9:58 PM, Thaden, John J <[EMAIL PROTECTED]> wrote:
> R pattern-matching and replacement functions are
> vectorized: they can operate on vectors of targets.
> However, they can only use one pat
Can this be an answer ?
which(v %in% names(table(v)[table(v)>1]))
[1] 2 5
Nael
On Wed, Oct 8, 2008 at 8:36 PM, liujb <[EMAIL PROTECTED]> wrote:
>
> Dear R users,
>
> I have this vector that consists numeric numbers. Is there a command that
> detects the repeated numbers in a vector and returns
Hi Armin,
Do you know the rocr package ? This is very easy to draw ROC curves and to
calculate AUC with it.
http://rocr.bioinf.mpi-sb.mpg.de/
Hope this will help.
Nael
On Dec 17, 2007 2:58 AM, Stephen Weigand <[EMAIL PROTECTED]> wrote:
> RSiteSearch("AUC")
>
> would lead you to
>
> http://finzi.
Hi Robin,
Before someone gives a better solution, you can try this :
x1<-array(1:10,c(2,5))
x2<-array(1:9,c(3,3))
ArrayAdd<-function(array1,array2){
x<-array(0,c(max(nrow(array1),nrow(array2)),max(ncol(array1),ncol(array2
x[1:nrow(array1),1:ncol(array1)]<-x[1:nrow(array1),1:ncol(array1
Try c(q1,q2)
Nael
On Jan 25, 2008 4:45 PM, <[EMAIL PROTECTED]> wrote:
> How can I join two lists? I have q1 and q2 and I want to merge them. I
> have tried to use the comand merge, but not work. Any solutions? Thanks!
>
> > q1
> $Input1
> 7.84615384615385
> 0.5
>
> $Input2
> 8.92307
> GenDummyVar <- function (NumMonth) rep(c(rep(0, NumMonth-1), 1, rep(0,
12-NumMonth)), 17)
> NameDummy <- c("DJan", "DFeb", "DMar", "DApr", "DMay", "DJun", "DJul",
"DAug", "DSep", "DOct", "DNov", "DDec")
> for (NumMonth in 1:12) assign(NameDummy, GenDummyVar (NumMonth))
> DJan
[1] 0 0 0 0 0 0 0
Oops.. the last line should have been :
for (NumMonth in 1:12) assign(NameDummy[NumMonth], GenDummyVar (NumMonth))
On Fri, Apr 25, 2008 at 10:18 AM, N. Lapidus <[EMAIL PROTECTED]> wrote:
> > GenDummyVar <- function (NumMonth) rep(c(rep(0, NumMonth-1), 1, rep(0,
> 12-NumMonth)),
Hi Mohamed
Try:
lapply (NameOfYourList, function (dat, NumCol) dat[,NumCol], c(12,13))
But there must be a shorter way to write this.
Nael
On Fri, May 23, 2008 at 3:37 PM, mohamed nur anisah <
[EMAIL PROTECTED]> wrote:
> Dear all,
>
> i have 2 lists of data with each of the list contain 14 c
explicit.
Nael
On Fri, May 23, 2008 at 3:54 PM, N. Lapidus <[EMAIL PROTECTED]> wrote:
> Hi Mohamed
>
> Try:
> lapply (NameOfYourList, function (dat, NumCol) dat[,NumCol], c(12,13))
>
> But there must be a shorter way to write this.
>
> Nael
>
>
> On Fri,
And if you have "thousands of names" like this:
names(L) <- paste ("names", 1:length(L), sep="")
Nael
On Sun, May 25, 2008 at 10:38 PM, Erin Hodgess <[EMAIL PROTECTED]>
wrote:
> try this:
>
> > names(L) <- c("name1","name2","name3")
> > L
> $name1
> [1] "Fred"
>
> $name2
> [1] "Mary"
>
> $name3
Hi Zhihua,
M <- data.frame (x=c(10, 13, 8, 11), y=c('A', 'B', 'A', 'A'))
which (M$x >= 10 & M$y == 'A')
# [1] 1 4
Hope it helps,
Nael
2008/3/7 N. Lapidus <[EMAIL PROTECTED]>:
> Hi Zhihua,
>
> M <- data.frame (x=c(10
Hi Pierre-Jean,
Sensitivity (Se) and specificity (Sp) are calculated for cutoffs stored in
the "performance" x.values of your prediction for Se and Sp:
For example, let's generate the performance for Se and Sp:
sens <- performance(pred,"sens")
spec <- performance(pred,"spec")
Now, you can have a
Dear All,
I have a problem which *should* be pretty straightforward to resolve - but I
can't work out how!
I have a list of 3 coefficient estimates for 4 different datasets:
Coefs<-list(c(1,0.6,0.5),c(0.98,0.65,0.4),c(1.05,0.55,0.45),c(0.99,0.50,0.47))
All I want to do is take the sum (or mean
Excellent - the "as.data.frame" trick was just what I needed!
Many thanks,
Nick
From: baptiste auguie [baptiste.aug...@googlemail.com]
Sent: 14 September 2009 17:48
To: Masca, N.
Cc: r-h...@stat.math.ethz.ch
Subject: Re: [R] Which "apply&q
Hi,there,
I could install "Rgraphviz" in R version 2.6. I could not install this in R
version 2.7 or 2.8.
Please try in version2.6.
ram basnet wrote:
>
> Dear R users,
>
> I am not so used to this R software. I have to use the package "
> Rgraphviz" but found some problem in the installatio
Hi,
I am working with a phylog tree and I would like to extract a subset of the
tree based on the species names (conserving the evolutionary distance and
relationships between the pairs of species I am interested in). I see there
is an option to select a subset of the tree using node names
(phylog
hello all,
I trying to use the package 'odfWeave'
and I get the follow error:
### error message
#
...
Removing content.xml
Post-processing the contents
Error in .Call("RS_XML_Parse", file, handlers, as.logical(addContext), :
E
Hello,
When making a graph, plot and boxplot automatically sort my factor
levels (y axis) into alphabetical order. Is there a way to make it
NOT do this? I've tried:
sort.by="none", sorted=FALSE, sort=FALSE, reorder=FALSE.
Thank you.
__
R-help@r-pro
Hello. I'm trying find the ratios between each of the integers in a
vector. I have:
for (n in x) {
ratio <- (x[n]/x[n-1])
ratio.all <- c(ratio.all, ratio)
}
Of course this doesn't work, nor does diff(n)/diff(n-1). Is there a
way to specify a pair of integers in a ve
:
>
>
> # Vector
> x=rnorm(10,0,1)
>
> # Suggestion
> new.ratio=function(x) x[2:length(x)]/x[1:(length(x)-1)]
>
> # My horrible function
> my.ratio=function(x){
>
> temp=NULL
> for (n in 1:length(x)) temp=c(temp,x[n]/x[n-1])
> temp
> }
>
>
Hi
I have 2 data.frames each of the same number of rows (approximately 3 or
more entries).
They also have the same number of columns, lets say 2.
One column has the date, the other column has a double precision number. Let
the column names be V1, V2.
Now I want to calculate the correlation of
Hi
I have 2 data.frames each of the same number of rows (approximately 3 or
more entries).
They also have the same number of columns, lets say 2.
One column has the date, the other column has a double precision number. Let
the column names be V1, V2.
Now I want to calculate the correlation of
I want write article by russian language using Sweave. For cyrillic text
LaTeX use T2A encoding
\usepackage[T2A]{fontenc}
But in Sweave.sty we find:
\RequirePackage[T1]{fontenc}
It is source of critical problem.
For example Rnw file
$ cat estimation.Rnw
\documentclass[A4paper]{article}
\us
2009/4/17 Peter Dalgaard
> Doesn't \usepackage[noae]{Sweave} do the trick? Sweave.sty has this
> conditionalized.
>
>
Yes, it is working. Thanks
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mai
I have a data frame, for exampe
> dat <- data.frame(a=rnorm(5),b=rnorm(5),c=rnorm(5))
ab c
1 -0.1731141 0.002453991 0.1180976
2 1.2142024 -0.413897606 0.7617472
3 -0.9428484 -0.609312786 0.5132441
4 0.1343336 0.178208961 0.7509650
5 -0.1402286 -0.333476839 -
I want using russian letters for my diagrams. I do it in this manner
m <- "заголовок"
Encode(m) <- "UTF-8"
plot(1,1,main=m)
But it is not convenient . How to configure R for using UTF-8 for all
string, to work without Encode-function, as
plot(1,1,main="заголовок")
[[al
Does R has package for providing work for binary digit: arithmetic
operation, convert to/from decimal digit, etc? I not found it, but think
that CRAN contain it.
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://
Nor can I jump to the R homepage from the CRAN mirror.
I had that yesterday (Saturday) afternoon in Nova Scotia, but it is
working now (Sunday AM).
--
George N. White III <[EMAIL PROTECTED]>
__
R-help@r-project.org mailing list
https://s
n linux.
5. does the slow system exhibit a lot more disk activity? Sometimes
this is hard to detect, but most systems do provide some statistics.
Try running some I/O intensive benchmark at the same time your R
job is running.
--
George N. White III <[EMAIL PROTECTED]>
___
, /ivo
How are you viewing the files? Problems with evince using an old
poppler version (such as you get with Fedora 8) were reported
recently, and seem to have been fixed with the newer version
of poppler used in debian unstable.
--
George N. White III <[EMAIL PROTEC
dencies on commonly required -devel packages, but of course there
will still be problems with packages that use uncommonly required
libs.
--
George N. White III <[EMAIL PROTECTED]> <[EMAIL PROTECTED]>
__
R-help@r-project.org mailing list
http
40 matches
Mail list logo