Thank you for the answer.
Is there any way to combine if() and switch() in one line? In my case,
something like :
>if(trade$Trade.Status=="DEL")switch(.)
I would like to avoid the loop .
From: Joris Meys [mailto:jorism...@gmail.com]
Sent: Wednesday, May 26, 2010 9:15 PM
To: arnaud Gaboury
The loop is due to the switch statement, not the condition. Without
condition it would become:
for (i in 1:length(Y)){
new.vect[i]<-switch(
EXPR = X[i],
Sell="Buy",
Buy="Sell",
X[i])
}
You can make an sapply construct too off course :
new.vect <- sapply
hello...
I am trying to develop an analysis similar to the proposed by Urban
and Keitt (2001) for connectivity between patches in a landscape. To
do that, my first problem is to convert the raster map, into a graph
(with area of the patch as an attribute for the node, and the distance
between patch
Peter and Dirk:
Thanks for the quick response -- I'm trying to get multiple CPU
responses as Peter indicated should happen, but those R commands only
illicit a single CPU response.
When I check the libraries:
ldd /usr/lib/R/bin/exec/R
linux-vdso.so.1 => (0x7fffd05ff000)
libR
I don't know if my understanding of P is right.
P ?= (the number of lives at the end of the interval)/(the number of lives
at the beginning of the interval)
### Compute proportion of a cohort that survives through the interval
### The formula is P0=L1/LO
## Original data is a vector of death da
Hello:
I am working on getting some statistics related to clinical trials and
stuff. I have to work with ICD9 codes.
Is anyone aware of any R package that deals with ICD9 codes verification and
manipulation.
Thanks
Vishwanath
[[alternative HTML version deleted]]
___
Hi all,
I am running a LMM and have two fixed factors: Trt (with 2 levels) and
Microhabitat (with 3 levels), and a randon factor: Group nested within Trt.
I have unequal variances between the two Trt levels. Does this matter in a
LMM?
Thanks for your time
Rebecca
[[alternative HTML vers
Simply keep track of the next free component, or use
nextComp = length(list_of_lists)+1,
then use
list_of_lists[[nextComp]] = fitJC1
Unlike with vectors, with lists you don't have to specify length and can add
as many list components as you want later The length of the list will
automatically
I assume you installed WinEdt 6. See
https://stat.ethz.ch/pipermail/r-help/2010-May/238540.html
and related messages. RWinEdt does not work (yet) with WinEdt 6, so you'll have
to downgrade back to WinEdt 5.x (or use another editor for the time being).
HTH, Michael
-Original Message-
From
Eric Fail wrote:
Hi Ruser
As so usual I'm trying to replicate some SAS code. I wold like to know
if there is a wildcard operators, as " : " in SAS, in R?
When running:
lm(y ~ x1 + x2 + x3 + x4 + x5 + x6 x9860, data=mydata)
I would like to be able to get around it by just writing somet
Hi Eric,
Try
lm(y ~ . , data = mydata)
HTH,
Jorge
On Thu, May 27, 2010 at 12:58 AM, Eric Fail <> wrote:
> Hi Ruser
>
> As so usual I'm trying to replicate some SAS code. I wold like to know if
> there is a wildcard operators, as " : " in SAS, in R?
>
> When running:
>
> lm(y ~ x1 + x2 + x3 +
Hi Ruser
As so usual I'm trying to replicate some SAS code. I wold like to know
if there is a wildcard operators, as " : " in SAS, in R?
When running:
lm(y ~ x1 + x2 + x3 + x4 + x5 + x6 x9860, data=mydata)
I would like to be able to get around it by just writing something
like this:
Thanks! I tried that before but for some reason didn't
notice that it was working correctly.
PS: How would I append another element to the list? This
doesn't work:
x = append(list_of_fits, fitJC1)
# still works, from original list construction
x[3]
# but this doesn't work
x[4]
Cheers!
Ni
On May 26, 2010, at 10:50 PM, David Winsemius wrote:
On May 26, 2010, at 6:24 PM, Frostygoat wrote:
Please pardon the simplicity of this question of biological nature.
I'm trying to calculate a statistic, px, the proportion of a cohort
that survives through the interval x:x+1. I have the ve
This is a time series so its best to represent it as such using a ts
object. Below tt is the vector of data you asked for and tt.ts is the
same vector converted into a ts series:
Lines <- "Year 1903 1904 1905 1906
Jan 125.0 30.0 113.0 5.0
Feb 128.0 100.0 70.0 388.0
Mar 155.0 79.0 230.0 323.0
Apr
On May 26, 2010, at 6:24 PM, Frostygoat wrote:
Please pardon the simplicity of this question of biological nature.
I'm trying to calculate a statistic, px, the proportion of a cohort
that survives through the interval x:x+1. I have the vector from
which the calc is to be made but I can't figur
Dear users,
I have several columns of data (each column containing monthly data for a
particular year from january - december) . I would wish to combine the
columns to get a Single column of continuous data as shown in (b) below. I
have read this data as table in R
(a) Data example
Year
Dear R family
I have a question as to how to get an answer I want to derive with the
outcome from R-package, "wmtsa".
My concern is that I want to decide equivalent degrees of freedom
(EDOF) based on the following outcome.
library(wmtsa)
W <- wavMODWT(X, wavelet="s8")
z1 <- wavEDOF(W)
print(z1)
#
On Wed, May 26, 2010 at 8:53 PM, Kim Jung Hwa wrote:
> I'm using 'tck' option to *reduce* the length of tick marks but it is not
> working, can anyone please tell me where I'm going wrong...
>
> require(graphics)
> require(grDevices)
> x <- seq(-10, 10, length= 30)
> y <- x
> f <- function(x,y) { r
Please pardon the simplicity of this question of biological nature.
I'm trying to calculate a statistic, px, the proportion of a cohort
that survives through the interval x:x+1. I have the vector from
which the calc is to be made but I can't figure out how to tell R to
take the current value and d
c concatenates all arguments. For example, c(c(0,1,2), c(3,4,5)) gives
a vector 0,1,2,3,4,5.
Another example:
> c(list(a=c(0,1), b = c(2,3)), list(c = c(4,5), d = c(5,6)))
$a
[1] 0 1
$b
[1] 2 3
$c
[1] 4 5
$d
[1] 5 6
So instead of a list of two lists, you get a single list with 4 components.
I
Erik Iverson wrote:
Nick Matzke wrote:
Hi all,
If I would like to make a list of complex objects -- in my case,
phylogenetic trees, but it could be e.g. statistical results from
something like lm, or whatever -- how can I put them into a list?
When I try the obvious methods, e.g. cat, app
Hi All,
I'm using 'tck' option to *reduce* the length of tick marks but it is not
working, can anyone please tell me where I'm going wrong...
require(graphics)
require(grDevices)
x <- seq(-10, 10, length= 30)
y <- x
f <- function(x,y) { r <- sqrt(x^2+y^2); 10 * sin(r)/r }
z <- outer(x, y, f)
z[is
try 'slab=' option...
HTH,
Kim
On Wed, May 26, 2010 at 7:29 PM, Xin Ge wrote:
> Hi Kim and Others,
>
> Can anyone please help me on how can I edit default labels ( "Study 1",
> "Study 2",...)
>
> using forest() - same question as below. Which option I should try?
>
> It would be a great help. T
Hi Kim and Others,
Can anyone please help me on how can I edit default labels ( "Study 1",
"Study 2",...)
using forest() - same question as below. Which option I should try?
It would be a great help. Thanks in advance,
On Sun, Dec 13, 2009 at 7:14 PM, Kim Jung Hwa wrote:
> Hi All,
>
> I'm usin
Mr. Murrell,
It is exactly what I want. Thanks very much.
Walmes.
> Date: Thu, 27 May 2010 10:27:02 +1200
> From: p.murr...@auckland.ac.nz
> To: walmeszevi...@hotmail.com
> CC: r-help@r-project.org
> Subject: Re: [R] Is possible a mini-plot into a big plot with Lattice?
>
> Hi
>
> On 27/05/20
Jonathan,
That would have been a good question for the r-sig-debian list ...
On 26 May 2010 at 14:16, Jonathan Greenberg wrote:
| Rhelpers:
|
| I recently installed the 64-bit version of R on my Debian system, and
| afterwards was asked if it was compiled using ATLAS. Is there a way
| to test
Hi
On 27/05/2010 8:09 a.m., Walmes Marques Zeviani wrote:
Hello,
I want to do with Lattice functions (qqmath, histogram) a figure like this
below.
n<- 1000
x<- rnorm(n)
qqnorm(x); qqline(x)
op<- par(fig=c(.02,.5,.5,.98), new=TRUE)
hist(x, xlab="", ylab="", main="", axes=FALSE)
box()
par(op)
If you didn't specify an external BLAS when you ran R configure
script, you are not using ATLAS. If you're not sure and you still have
the output of the configure script, at the end it'll say whether it
uses an external BLAS.
Alternatively, you may also want to generate two random 5000x5000
matric
Thank you all!
Particulary Wu Gong whose answer is very compact
--
View this message in context:
http://r.789695.n4.nabble.com/counts-of-a-vector-tp2232047p2232353.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org m
Rhelpers:
I recently installed the 64-bit version of R on my Debian system, and
afterwards was asked if it was compiled using ATLAS. Is there a way
to test to see if R is using ATLAS?
--j
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailm
### Special cumsum
### Do cumsum when TRUE, and reset to 0 when FALSE
x <- c( TRUE, TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, TRUE )
## The rle function computes the lengths of equal values of a vector
## And gives two vecters: $lengths and $values
## The sequence function creates and concaten
Hi Alistair,
?match will help, but you need to extract the site names first. Quick and
dirty :
seed <- substr(rownames(bank.plot),1,5)
site <- rownames(site.veg)
for(i in 1:length(seed)){
bank.plot[i,]<-site.veg[match(seed[i],site),]
}
Cheers
Joris
On Wed, May 26, 2010 at 2:50 PM, Alistair Au
Thanks for the info. I'll give that a try.
On May 25, 2010, at 5:36 PM, jim holtman wrote:
readLines will read until it reached an end-of -file. try
readLines(con, n=1)
to read one line at a time an then process it.
On Tue, May 25, 2010 at 2:07 PM, Joe Stuart
wrote:
Hi,
I'm trying to
Remove the "" around the options. You also have to put it in a sapply, as
switch only works on single values. But I wouldn't call this optimal...
elevation.DM <-sapply(Population,switch, CO= 2169, CN = 1121,
Ga =500, KO = 2500, Mw = 625, Ng = 300 )
Cheers
Joris
On May 26, 2010, at 3:30 PM, ecvet...@uwaterloo.ca wrote:
I have 3 columns of numbers, and i want to find the mean of each
separately, and then the mean of all of the means.
ive tried:
av3daysB<- mean(mean(avr1), mean(avr2), mean(avr3))
av3daysB
sapply(list(avr1, avr2, avr3), mean)
mean(c
On May 26, 2010, at 3:36 PM, Stefan Scheurer wrote:
Hi,
I am not so sure about an error note I got when using shapiro.test.
I imported some data into R by wrinting it into a .txt file via
tab1<-read.table("etctxt",header=T)
attach(tab1)
The following object(s) are masked _by_ .Gl
Try this:
av3daysB<- mean(c(mean(avr1), mean(avr2), mean(avr3)))
On Wed, May 26, 2010 at 4:30 PM, wrote:
> I have 3 columns of numbers, and i want to find the mean of each
> separately, and then the mean of all of the means.
> ive tried:
>
> av3daysB<- mean(mean(avr1), mean(avr2), mean(avr3))
I think we agree for the most part. I also like Henrik's suggestion, but
someone (probably multiple) with more experience in TTY and similar areas needs
to be involved. I think it will be easier to do in R than in most other
programs. I would be willing to contribute to such a project if ther
Hi,
I am not so sure about an error note I got when using shapiro.test.
I imported some data into R by wrinting it into a .txt file via
> tab1<-read.table("etctxt",header=T)
> attach(tab1)
The following object(s) are masked _by_ .GlobalEnv :
ozon
> ozon$V1 [1] 2.5 3.0 5.6 4.
Dear R- helper,
I am trying to analyze repeated measure .
there are three factors: a ,b and time
a and b factors have two levels and time has 90 different timepoints.
This is the r-code I've tried;
gls(y~factor(a)*factor(b)*time, data=, corr=corAR1(form=~time|id))
Here, the reason why I did n
I have 3 columns of numbers, and i want to find the mean of each
separately, and then the mean of all of the means.
ive tried:
av3daysB<- mean(mean(avr1), mean(avr2), mean(avr3))
av3daysB
but it only gives me the mean of the first column (avr1)
Any suggestions?
Thanks,
Emilija
__
# Thanks again to everyone who provided suggestions.
# I was curious about which approaches would be the fastest... so a
little benchmarking
# My approach was by far the worst :)
# The approach suggested by Duncan Murdoch and Peter Langfelder, based
on indexing , was by far the fastest (~ 66times
How does mlest generate the estimate for sigmahat, the variance-covariance
matrix? It produces different values than when using cov(data.frame).
--
View this message in context:
http://r.789695.n4.nabble.com/variance-covariance-matrix-of-mlest-in-library-mvnmle-tp2232127p2232127.html
Sent from
Why exactly do you need lda and not another method? For lda to be
applicable, you should check :
1) whether the regressors are normally distributed within the classes
2) whether the variance-covariance matrices are equal for all classes
Essentially, this means that the boundary between both classe
b...@email.unc.edu wrote:
Erik,
What R editor do you use? I've tried SciTE but it won't color the code.
Brian
If you're looking for code colouring then try StatEt and Eclipse
(http://www.walware.de/goto/statet and
http://www.eclipse.org/eclipse/). It's cross platform and runs really
w
Brian Frizzelle wrote:
I've written a function that takes some input data output from a
simulation model and creates some graphs. It's not very complicated
code, and it works perfectly fine if I just run the code as is.
But I have converted it into a function so we call it externally, and
whe
Hello Greg,
First, I wish to thank/compliment you for the coding you did. I am sure it
will help that guy more then what I had made - I simply didn't know how to
do it the way you did it, so I did what I could.
Regarding the formatting of tables - he needs that output to go for
assignments he is
Hello,
I want to do with Lattice functions (qqmath, histogram) a figure like this
below.
n <- 1000
x <- rnorm(n)
qqnorm(x); qqline(x)
op <- par(fig=c(.02,.5,.5,.98), new=TRUE)
hist(x, xlab="", ylab="", main="", axes=FALSE)
box()
par(op)
Is possible?
Thanks.
Walmes Zeviani.
Joris' suggestions are good ones.
I use Emacs with ESS (and now org-babel) for R programming and for
interaction with the R process. But I use Emacs for everything. Emacs is
actually pretty easy to install these days on Windows, and Vincent
Goulet provides a nice package with all you need to g
To find out what tools are available in R, you can check out the Time
Series task view on CRAN:
http://cran.r-project.org/web/views/TimeSeries.html
My personal preference is for package dlm, but here I am probably
biased.
[discaimer: the following is a sponsored link]
For more information on D
I'm not Erik, but what the heck.
What platform, linux or Windows? On Windows, I use Tinn-R, which is great
for using with R as you get full control over the console. You need to take
into account that you should install R with the SDI option, and that you
have to configure Tinn-R the first time fr
Well, that's embarrassing. Thank you for finding that.
--
View this message in context:
http://r.789695.n4.nabble.com/error-variable-names-are-limited-to-256-bytes-when-sourcing-code-tp2231800p2232244.html
Sent from the R help mailing list archive at Nabble.com.
___
Erik,
What R editor do you use? I've tried SciTE but it won't color the code.
Brian
__
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 provi
Inline below:
> From: Tal Galili [mailto:tal.gal...@gmail.com]
> Sent: Wednesday, May 26, 2010 12:26 AM
> To: Greg Snow
> Cc: Faiz Rasool; R-help@r-project.org
> Subject: Re: [R] Getting sink to work with "message" on R 2.11.0 - what didI
> miss?
>
> Hello Greg,
> Thank you for the coding.
>
>
I was about to say the same. loading the code line per line gave the error a
few lines after that one. Which explains...
Cheers
Joris
On Wed, May 26, 2010 at 9:27 PM, Erik Iverson wrote:
> Is the '`' character supposed to be there before the ## Add error bars
> comment?
>
> If that is the probl
Is the '`' character supposed to be there before the ## Add error bars
comment?
If that is the problem, let it be a good lessonto use an editor with
syntax highlighting. :)
Brian Frizzelle wrote:
All,
I think there may be some misunderstanding about my problem. In my code,
which is
Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com
> -Original Message-
> From: r-help-boun...@r-project.org
> [mailto:r-help-boun...@r-project.org] On Behalf Of speretti
> Sent: Wednesday, May 26, 2010 10:22 AM
> To: r-help@r-project.org
> Subject: [R] counts of a vector
>
>
>
All,
I think there may be some misunderstanding about my problem. In my code,
which is written as an R function, all of my variable names are short. I get
that error when I try to source the function so I can call it. I just do not
know why I'm getting the error, especially since I have written o
see ?switch
X<- rep(c("Buy","Sell","something else"),each=5)
Y<- rep(c("DEL","INS","DEL"),5)
new.vect <- X
for (i in which(Y=="DEL")){
new.vect[i]<-switch(
EXPR = X[i],
Sell="Buy",
Buy="Sell",
X[i])
}
cbind(new.vect,X,Y)
On Wed, May 26, 2010 at 7:43 P
On 26-May-10 18:40:46, Barry Rowlingson wrote:
> On Wed, May 26, 2010 at 6:00 PM, Wu Gong wrote:
>>
>> I can only repeat your error message :)
>>
>>> n256 <- paste(rep("A",256),collapse="")
>>> assign(n256, 1)
>>> n257 <- paste(rep("A",257),collapse="")
>>> assign(n257, 1)
>> Error in assign(n257,
Barry Rowlingson lancaster.ac.uk> writes:
> If a variable name can have 26 upper case + 26 lower case + 10
> numbers then the number of possible variable names is:
>
> 711659926691456588820198688981513283237719214167524272940980007340737850\
> 0715055503674260501908537449489553399876624278448108
How about?
hi.rle<-rle(walevel>5.79)
lo.rle<-rle(walevel<5.36)
plot(walevel)
abline(h=5.8,col=2,lty=3)
abline(h=5.35,col=3,lty=3)
hi.lo.rle<-sort(c(cumsum(hi.rle$lengths),cumsum(lo.rle$lengths)))
abline(v=hi.lo.rle)
You can use the $values from the rle to sort things out. Probably
want to igno
On Wed, May 26, 2010 at 6:00 PM, Wu Gong wrote:
>
> I can only repeat your error message :)
>
>
>> n256 <- paste(rep("A",256),collapse="")
>> assign(n256, 1)
>> n257 <- paste(rep("A",257),collapse="")
>> assign(n257, 1)
> Error in assign(n257, 1) : variable names are limited to 256 bytes
>
If a
Computational Finance and Financial Engineering
1st R/Rmetrics Summer School and 4th User/Developer Meeting
Meielisalp, Lake Thune Switzerland, June 27 - July 1, 2010
Late Registration: https://www.rmetrics.org/meielisalp2010-registration
Students: Apply for Student Scholarships
Check out this thread for numerous solutions:
https://stat.ethz.ch/pipermail/r-help/2007-June/134557.html
On Wed, May 26, 2010 at 1:22 PM, speretti wrote:
>
> Hi,
>
> I need help to find an efficient way to transform a vector like:
>
> a<-c(1,1,0,1,0,0,0,1,1,1,1,0,1,0,1,1)
>
> in a vector that co
speretti wrote:
Hi,
I need help to find an efficient way to transform a vector like:
a<-c(1,1,0,1,0,0,0,1,1,1,1,0,1,0,1,1)
in a vector that counts only di 1 elements, like:
b<-c(1,2,0,1,0,0,0,1,2,3,4,0,1,0,1,2)
Thank you!
One way:
rl <- rle(a)
unlist(mapply("*", lapply(rl$lengths, fun
I can only repeat your error message :)
> n256 <- paste(rep("A",256),collapse="")
> assign(n256, 1)
> n257 <- paste(rep("A",257),collapse="")
> assign(n257, 1)
Error in assign(n257, 1) : variable names are limited to 256 bytes
-
A R learner.
--
View this message in context:
http://r.7896
Hi,
I need help to find an efficient way to transform a vector like:
a<-c(1,1,0,1,0,0,0,1,1,1,1,0,1,0,1,1)
in a vector that counts only di 1 elements, like:
b<-c(1,2,0,1,0,0,0,1,2,3,4,0,1,0,1,2)
Thank you!
--
View this message in context:
http://r.789695.n4.nabble.com/counts-of-a-vector-tp
Dear R gurus,
Thank you all for continuous support and guidance -- learning without you
would not be efficient.
I have a question regarding LD analysis and how to best code it up in R.
I have a file of (V52 and 671 time points across all columns) and another
file of phonetic features (each vow
On 05/26/2010 10:55 AM, Michal Figurski wrote:
Dear R-helpers,
I am working with 'cph' models from 'rms' library. When I build simple
survival models, based on 'Surv(time, event)', everything is fine and I
can make nice plots using plot(Predict(f, time=3)).
However, recently I tried to be more
>
> # There must a better way, but this works; add
>
>labels = levels(dat$fac)[panel.number()],
>
> # to your panel.axis() call in axis.VarLabs.
Thanks Peter. I had tried that but it didn't work. Now just realised I
was hitting a scoping problem and that my example was subtly different
to
On Wed, May 26, 2010 at 10:20 AM, Peter Ehlers wrote:
> On 2010-05-26 4:03, Gavin Simpson wrote:
>>
>> Dear List,
>>
>> I have been writing a Lattice function to draw what we call
>> stratigraphic diagrams, these are diagrams with a panel for each species
>> showing a time series of abundance, but
Dear group,
Here is my df :
trade <-
structure(list(Trade.Status = c("DEL", "INS", "INS"), Instrument.Long.Name =
c("SUGAR NO.11",
"CORN", "CORN"), Delivery.Prompt.Date = c("Jul/10", "Jul/10",
"Jul/10"), Buy.Sell..Cleared. = c("Sell", "Buy", "Buy"), Volume = c(1L,
2L, 1L), Price = c("15.2500",
On 2010-05-26 4:03, Gavin Simpson wrote:
Dear List,
I have been writing a Lattice function to draw what we call
stratigraphic diagrams, these are diagrams with a panel for each species
showing a time series of abundance, but drawn vertically to represent
time passing from bottom of plot towards
tree.pred <- yourfunction works!
Thanks, Josh!
On Wed, May 26, 2010 at 9:35 AM, Joshua Wiley wrote:
> If you use return you need to assign the results to an object. For
> instance
>
> tree.pred <- yourfunction
>
> then tree.pred will contain whatever data you returned from your
> function.
I've not been able to install rjags successfully in Ubuntu 10.04 :
** testing if installed package can be loaded
Error : .onLoad failed in loadNamespace() for 'rjags', details:
call: dyn.load(file, DLLpath = DLLpath, ...)
error: unable to load shared library
'/home/scott/R/i486-pc-linux-gnu-li
If you use return you need to assign the results to an object. For instance
tree.pred <- yourfunction
then tree.pred will contain whatever data you returned from your
function. If you truly want your function to assign objects
internally that are available in your general workspace, instead of
HI, Dear R community,
I am writing the following function to create one data set(*tree.pred*) and
one vector(*valid.out*) from loops. Later, I want to use the data set from
this loop to plot curves. I have tried return, list, but I can not use the
*tree.pred* data and *valid.out* vector.
auc.t
What exactly are you trying to do?
An example (which you should have provided)
> A <- matrix(1:100,nrow=10,ncol=10)
> B <- A[10,1:3]
> B
[1] 10 20 30
> is.matrix(B)
[1] FALSE
> matrix(B)
[,1]
[1,] 10
[2,] 20
[3,] 30
This is logic, as you convert a vector to a matrix, and he will a
Not a direct answer, but from your description it looks like you are better
of with supervised classification algorithms instead of unsupervised
clustering. see the library randomForest for example. Alternatively, you can
try a logistic regression or a multinomial regression approach, but these
are
On May 26, 2010, at 11:58 AM, wrote:
I am assigning subset of a matrix A [n,3] where n>1 to a temporary
matrix TMP
I do not know how many rows of A will be assigned to TMP because
this is established by a
run-time test.
I expect TMP to be a matrix [m,3], m >=1
But when 1 row only is tra
Dear R-helpers,
I am working with 'cph' models from 'rms' library. When I build simple
survival models, based on 'Surv(time, event)', everything is fine and I
can make nice plots using plot(Predict(f, time=3)).
However, recently I tried to be more specific and used 'Surv(start,
stop, event)'
I am assigning subset of a matrix A [n,3] where n>1 to a temporary matrix TMP
I do not know how many rows of A will be assigned to TMP because this is
established by a
run-time test.
I expect TMP to be a matrix [m,3], m >=1
But when 1 row only is transferred from A to TMP then TMP becomes [3,1]
Unfortunately, this is not a robust implementation, and is derailed by
Error in uniroot(f, c(-1, 1)) :
f() values at end points not of opposite sign
--
View this message in context:
http://r.789695.n4.nabble.com/Code-to-calculate-internal-rate-of-return-tp864645p2231910.html
Sent from the R
Hi,
I have a 1.000 observations with 10 attributes (of different types: numeric,
dicotomic, categorical ecc..) and a measure M.
I need to cluster these observations in order to assign a new observation
(with the same 10 attributes but not the measure) to a cluster.
I want to calculate for the
Joris,
I want to add a line in a function with a print "warning" if one element of
the column is <>0.
I could use if(sum(u$POSITION)<>0) as a condition, but I can imagine having
one element equal to -2, and another one to 2. So in this case, sum=0, but
the condition is false in fact (minimum of o
Dear all,
I'm trying to fit a curve to some 1 year failure-time data, so that I can
extrapolate and predict failure rates up to 3 years. The data is in the
general form:
Treatment Time Status
Treatment A28 0
Treat
Hello
Can someone please let me know how to test for Autocorrelation in R ( eg.
like durbin-watson statistic or any other test) after performing Non linear
least squares and what can be the best solution for it.
Thanks
Regards
Ruchita
[[alternative HTML version deleted]]
__
I've written a function that takes some input data output from a
simulation model and creates some graphs. It's not very complicated
code, and it works perfectly fine if I just run the code as is.
But I have converted it into a function so we call it externally, and
when I try to source the co
new...@r wrote:
>
> Hey Everyone!
>
> I wanted to carry out Hierarchical clustering using distance matrices i
> have calculated ( instead of euclidean distance etc.)
>
> I understand as.dist is the function for this, but the distances in the
> dendrogram i got by using the following script(1)
Hello all,
I am going slightly mad trying to create a table for running
co-correspondence analysis.
What I have is seed bank and vegetation data, and my aim is to see if
the vegetation found in a site (containing several seed bank samples)
can predict the composition of a seed bank sample wi
On May 26, 2010, at 1:25 AM, Ian Dworkin wrote:
# This is more about trying to find a more effecient way to code some
simple vectorized computations using ifelse().
# Say you have some vector representing a factor with a number of
levels (6 in this case), representing the location that samples
Presumably nothing is accepting connections on port 9754. Unless you've
got a server listening for connections there, then this is the expected
behaviour. (If you wanted to write a server then, obviously, use
server=TRUE.) If there is a server, then it is probably not working.
Very unlikely
Dear all,
as far as my understanding goes, isoMDS uses the Kruskal definition of
stress, i.e. : "the square root of the ratio of the sum of squared
differences between the input distances and those of the configuration to
the sum of configuration distances squared." (as stated in the help files).
Dear All
I have some doubt about socket establishment. I am sending this question
again. Sorry to bothering you a lot.
Example : make.socket(host = "localhost", port=9754, fail = TRUE, server =
FALSE)
*Error in make.socket(host = "localhost", port = 9754, fail = TRUE, server =
FALSE) : socket not
On Tue, May 25, 2010 at 9:30 PM, Peter Ehlers wrote:
> Albart,
>
> On 2010-05-25 1:51, Albart wrote:
>>
>> Hello list,
>>
>> I am making graphics for an article which I want to publish. The article
>> is
>> about several methods (to calculate breeding values of individuals)
>> applied
>> in severa
Arnaud,
check the vector :
> u$POSITION<>0
[1] TRUE TRUE ...
what I do is putting u$POSITION==0
[1] FALSE FALSE ...
when you apply the sum() function on that vector, FALSE becomes 0 and TRUE
becomes 1. So this actually gives you a way of counting the amount of
positions that are not zero. if you
[Environment: Win XP, R 2.10.1]
I'm trying to install the packages JGR and iWidgets required by the
extracat package to make the interactive plots
in the package work. I've tried various things, but nothing seems to
work. Here is my most recent attempt,
followed by my sessionInfo().
Does an
I prefer smoothing splines, Frank prefers regression splines. The
former is built into the survival package:
options(na.action=na.exclude) # This should be the default IMHO
coxfit1<- coxph(Surv(rtime,rcens) ~ pspline(cts), data=data1)
summary(coxfit1) #shows the linear and nonlinear tests
1 - 100 of 144 matches
Mail list logo