Hi,
a[length(a)] gives the value of last element. Is there an alternative
without using functions ?
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the postin
Hi,
Can anyone direct me ?
Thanks
[[alternative HTML version deleted]]
__
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 provide c
This was just discussed this week:
https://stat.ethz.ch/pipermail/r-help/2008-March/157082.html
On Fri, Mar 14, 2008 at 5:01 PM, Will Holcomb <[EMAIL PROTECTED]> wrote:
> I am having two problems creating data frames that I have solutions, but
> they really seem like kludges and I assume I just d
Hello,
I'm using filehash on the windows XP and it has been working fine with the
newest R version 2.6.2. However, on the windows vista, when I ran the same
code, I got the following error:
> dbCreate("simdb")#create simdb database
[1] TRUE
> db<-dbInit("simdb") #initiate an object of databa
On Fri, 14 Mar 2008, Anup Nandialath wrote:
> Dear friends,
>
> Please find below the code that I have employed for a rejection sampler
> to draw from asymmetric laplace distributions. I was wondering if this
> code can be written more efficiently? Are there more efficient ways of
> drawing ran
Uli Kleinwechter <[EMAIL PROTECTED]> wrote in
news:[EMAIL PROTECTED]:
> Hello,
>
> I have written a small script to read a dataset, compute some basic
> descriptives and write them to a file (see below). The variable
> "maizeseedcash" of which the statistics are calculated is contained
> in th
Try Sys.sleep()
On Fri, Mar 14, 2008 at 4:33 PM, Rosaura Cordero <[EMAIL PROTECTED]> wrote:
> hola, si me pudieran decir como hago para colocar dentro de un ciclo una
> pausa
>
> -
>
> ¿Con Mascota por primera vez? - Sé un mejor Amigo
>
>
>[[alternative HT
hola, si me pudieran decir como hago para colocar dentro de un ciclo una pausa
-
¿Con Mascota por primera vez? - Sé un mejor Amigo
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing
How do I write bold face in the legend - the function does not accept
font=2 as argument?
How do I plot a legend box with a background color, but not a border?
Or, better: How do I specify the color of the legend-box-borderline?
Okay, I abuse the legend, but have a look at
http://de.wikipedia.org
Dear useRs,
I have read in several sources [1] [2] [3] that Rmetrics includes an
Rcmdr-based graphical user interface named fBrowser GUI. However, I
have a hard time finding it anywhere (on the net, etc.), nor do I
manage to load it (having had Rmetrics installed).
Could anyone shed some light on
Hello,
I have written a small script to read a dataset, compute some basic
descriptives and write them to a file (see below). The variable
"maizeseedcash" of which the statistics are calculated is contained in
the data frame agr_inputs. My question is whether there is a way to make
R compute t
Dear friends,
Please find below the code that I have employed for a rejection sampler to draw
from asymmetric laplace distributions. I was wondering if this code can be
written more efficiently? Are there more efficient ways of drawing random
numbers from asymmetric laplace distributions??
Tha
This should do what you want for the data.frame:
> x <- list(Behavior_Therapy = c(6, 7, 6, 5, 5, 5, 7, 8, 9, 6, 6, 7),
+ Atenolol = c(4, 8, 10, 3, 6, 5, 6, 3, 7, 5, 4, 6),
+ Placebo = c(0, 7, 0, 7, 0, 7))
> # find the longest vector and make all th
On Fri, 14 Mar 2008, Henrique Dallazuanna wrote:
> If I understand:
>
> as.Date("2008-03-14") + 5*365
What about leap years? That is 2013-03-13.
> x <- as.Date("2008-03-14")
> xx <- as.POSIXlt(x)
> xx$year <- xx$year+5
> as.Date(xx)
[1] "2013-03-14"
is I think what is being asked for.
> On 14
I am having two problems creating data frames that I have solutions, but
they really seem like kludges and I assume I just don't understand the
proper R way of doing things.
The first situation is I have an set of uneven data vectors. When I try to
use them to create a data frame I would like the
Try
temp[1,,drop=FALSE]
See ?"[" for the explanation.
Gabor
On Fri, Mar 14, 2008 at 04:46:10PM -0400, Gregory Gentlemen wrote:
> Hi fellow R-users,
>
> I have run into a problem when trying to identify the number of rows in a
> matrix. Say we have an arbitrary 5 by 5 matrix called temp:
>
>
nrow is for number of rows in matrix/data.frame, here you can use:
NROW(temp[1,])
length(temp[1,])
But if you want the index of row try this:
unique(row(temp)[1,])
On 14/03/2008, Gregory Gentlemen <[EMAIL PROTECTED]> wrote:
> Hi fellow R-users,
>
> I have run into a problem when trying to iden
Hi fellow R-users,
I have run into a problem when trying to identify the number of rows in a
matrix. Say we have an arbitrary 5 by 5 matrix called temp:
temp <- matrix(norm(25), nrow=5)
The problem is that nrow(temp[1,]) returns NULL. I would like it to return 1
because in my larger program I
If I understand:
as.Date("2008-03-14") + 5*365
On 14/03/2008, Jillywadd <[EMAIL PROTECTED]> wrote:
>
> Hello!
>
> I currently have a table of data with a column of start dates and a column
> with some numbers representing years. I need to add these numbers to the
> dates to get an end date. T
Hello!
I currently have a table of data with a column of start dates and a column
with some numbers representing years. I need to add these numbers to the
dates to get an end date. The two types of data are obviously incompatible
and adddition of the two will not work. Does anyone know how I migh
library(reshape)
?rbind.fill
--- Suyan Tian <[EMAIL PROTECTED]> wrote:
> Hi Everyone:
>
> I need some help on combining two datasets into one.
> Since for those
> two datasets, there are different variables. Like
>
> In dataset 1, I have
>
> pt x1 x2
> 1 12 24
> 2 20 17
>
> In datas
Try:
merge(x, y, all=T)
On 14/03/2008, Suyan Tian <[EMAIL PROTECTED]> wrote:
> Hi Everyone:
>
> I need some help on combining two datasets into one. Since for those
> two datasets, there are different variables. Like
>
> In dataset 1, I have
>
> pt x1 x2
> 1 12 24
> 2 20 17
>
> In d
Hi Everyone:
I need some help on combining two datasets into one. Since for those
two datasets, there are different variables. Like
In dataset 1, I have
pt x1 x2
1 12 24
2 20 17
In dataset 2, I have
pt x2 x3
3 19 33
4 20 16
The final dataset I want should look as
pt x1 x2 x3
Park, Kyong H Mr ECBC said the following on 3/14/2008 12:25 PM:
> Classification: UNCLASSIFIED
> Caveats: NONE
>
> Dear R users,
>
> I'm interested in finding a random effect of the Block in the data shown
> below, but 'lme' does not work without the random effect. I'm not sure how
> to group
Classification: UNCLASSIFIED
Caveats: NONE
Dear R users,
I'm interested in finding a random effect of the Block in the data shown
below, but 'lme' does not work without the random effect. I'm not sure how
to group the data without continuous value which is shown in the error
message at the bott
Andreas Klein yahoo.de> writes:
>
> Hello.
>
> I have some problems, when I try to model an
> optimization problem with some constraints.
>
> The original problem cannot be solved analytically, so
> I have to use routines like "Simulated Annealing" or
> "Sequential Quadric Programming".
>
> Bu
Yes! mapply is awesome! Thanks.
Gabor Csardi wrote:
>
> cumsum( mapply(function(i,j) sum(a$data[i:j]), x, y) )
>
> Is this what you want?
> Gabor
>
> On Thu, Mar 13, 2008 at 06:02:13AM -0700, yoo wrote:
>>
>> Hi all, i have the following..
>>
>> a <- data.frame(data = seq(1,10))
>>
>
Ah so it does. I must have missed it entirely. Thanks
--- Achim Zeileis <[EMAIL PROTECTED]> wrote:
> On Fri, 14 Mar 2008, John Kane wrote:
>
> > This is only the second time that I remember
> haveing
> > even seen a reference to dput(). The first time
> was
> > about 3-4 days ago in something of
On Fri, 14 Mar 2008, John Kane wrote:
> This is only the second time that I remember haveing
> even seen a reference to dput(). The first time was
> about 3-4 days ago in something of a throw-away
> comment.
>
> Should it be in the posting guide and FAQ etc as a
> guide to new users?
The posting
--- "Liaw, Andy" <[EMAIL PROTECTED]> wrote:
> From: John Kane
>
> > --- "Liaw, Andy" <[EMAIL PROTECTED]> wrote:
> >
> > > From: Bert Gunter
> > >
> > > > ?"[" ?InternalMethods
> > > >
> > > > x[i,j] is just shorthand for "["(x,i,j) .
> > > (AFAIK)**All** operators
> > > > (+,-,...,subscr
From: John Kane
> --- "Liaw, Andy" <[EMAIL PROTECTED]> wrote:
>
> > From: Bert Gunter
> >
> > > ?"[" ?InternalMethods
> > >
> > > x[i,j] is just shorthand for "["(x,i,j) .
> > (AFAIK)**All** operators
> > > (+,-,...,subscripting,...) in R are functions,
> > stemming from
> > > its LISP-li
This is only the second time that I remember haveing
even seen a reference to dput(). The first time was
about 3-4 days ago in something of a throw-away
comment.
Should it be in the posting guide and FAQ etc as a
guide to new users?
--- Gabor Grothendieck <[EMAIL PROTECTED]>
wrote:
> Please us
Looks to me like you are trying to read sas.exe as your data rather
than MyData.sa7bdat
Larry
On Fri, Mar 14, 2008 at 8:21 AM, Samuel Okoye <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I am trying to read the SAS file MyData.sa7bdat in R! This file is saved
> under D:\data! I therefore wrote
>
--- "Liaw, Andy" <[EMAIL PROTECTED]> wrote:
> From: Bert Gunter
>
> > ?"[" ?InternalMethods
> >
> > x[i,j] is just shorthand for "["(x,i,j) .
> (AFAIK)**All** operators
> > (+,-,...,subscripting,...) in R are functions,
> stemming from
> > its LISP-like
> > heritage, and can actually called
re:" ... (I) would like to create a plot to examine for the classic elbow
criterion to use in determining the best number of clusters. Ideally I'd
like to plot percent variance explained (y axis) against number of clusters
(x axis) Is there a way to do this in R...?"
I found a way to prod
Dear list,
I am willing to perform a cox PH regression analysis on my "time to
reach a severity score of 5". I have 600 observations and 50 predictor
variables. So I first want to perform a log-rank test (using the
survdiff() function) on each individual variable in order to select a
subset o
From: Bert Gunter
> ?"[" ?InternalMethods
>
> x[i,j] is just shorthand for "["(x,i,j) . (AFAIK)**All** operators
> (+,-,...,subscripting,...) in R are functions, stemming from
> its LISP-like
> heritage, and can actually called by the usual functional
> syntax, f(...),
> instead of the opera
?"[" ?InternalMethods
x[i,j] is just shorthand for "["(x,i,j) . (AFAIK)**All** operators
(+,-,...,subscripting,...) in R are functions, stemming from its LISP-like
heritage, and can actually called by the usual functional syntax, f(...),
instead of the operator syntax.
Not sure where this is ex
Hi,
I would like to perform a forward selection procedure on a data set
with 6 observations and 10 predictors. I tried to run it with
regsubsets (I set nvmax=number of observations) but I keep getting
these warning messages:
Warning messages:
1: 5 linear dependencies found in: leaps.setup(
Hello,
I am trying to read the SAS file MyData.sa7bdat in R! This file is saved
under D:\data! I therefore wrote
> path <-"D:/SasData"
> sashome <- "C/Progra, Files/SAS Institute/9_1/SAS"
> sascmd <- file.path(sashome, "sas.exe")
> MyData <- read.ssd(path, "MyData", sascmd=sascm
Hello again R help.
This is a simple question perhaps(laughing as I type) with a simple answer.
Is the multcomp package appropriate for using with a lme built under
the nlme package.
I know i can get it to work (i.e report p-values for a tukey test) but
i am not unsure if this is appropriate fo
See ?"Memory-limits"
And BTW 'on Unix' is far from sufficient, as the help page will explain to
you.
On Fri, 14 Mar 2008, LIU, YUEFU [AG/1000] wrote:
> Hi! All,
>
> I was thinking to use R to handle my large scale data of 3 Mi records
> On Unix. Could you let me know if there is limits of R for
Dear Rob,
Rob Knell ha scritto:
> Hello everyone
> Not strictly an R question but close... hopefully someone will be able
> to help. I wish to compare the switchpoints in two switchpoint
> regressions. The switchpoints were estimated using the segmented
> library
It's a package.
running in
Hi! All,
I was thinking to use R to handle my large scale data of 3 Mi records
On Unix. Could you let me know if there is limits of R for its matrices
and vectors
and what is the maximum allowed size if there is ?
Thank you advance
Yuefu
St Louis
-
Of course, it might be clearer if instead of
!all(x < 100) I had put, any(x > 100)
Erik Iverson wrote:
> If your data.frame is completely numeric, this is easy.
>
> If your data.frame is called df, then do
>
> df[apply(df, 1, function(x) !all(x < 100)),]
>
> Look at ?apply
>
> Best,
> Erik
From: [EMAIL PROTECTED]
> Andrew McFadden <[EMAIL PROTECTED]> writes:
>
> > I am trying to determine the distances between two datasets
> of x and y
> > points.
>
> This can be done efficiently in the package 'spatstat'.
>
> library(spatstat)
> crossdist(x1, y1, x2, y2)
>
> where x
If your data.frame is completely numeric, this is easy.
If your data.frame is called df, then do
df[apply(df, 1, function(x) !all(x < 100)),]
Look at ?apply
Best,
Erik Iverson
IAIN GALLAGHER wrote:
> Hi list.
>
> I have a numerical dataset 22,000 rows deep and 43 columns wide. I would like
>
I just tried it and had no problem with that code. Are you sure the
packages are installed correctly? What does sessionInfo() say after you
got the error?
smoothScatter() _is_ in geneplotter, as is densCols().
Andy
From: Tom Hart
>
> Hi, I have been trying to plot density plots using the exa
Please use dput(x) to display data in your posts in easily copied form.
Try this:
library(zoo)
z <- zoo(matrix(1:48, 4, dimnames = list(NULL, month.abb)), 1968:1971)
zz <- zooreg(c(coredata(z)), start = as.yearmon(1968), freq = 12)
You could also consider using a ts series:
tt <- as.ts(zz)
O
Greetings, R Aficionados:
I'm running R2.6.2 on a DELL WinXP box with 2 Gig RAM.
My package GDD renderings of dashed lines aren't dashed. abline() will
produce a dashed line, but lines() won't. Here is some illustrative code:
library(GDD)
GDD("dashed line", type="gif", width=480, hei
Hello Again R help readers - I have posted in the past and want to
thank all those who replied with helpful suggestions.
This regards mixed model anova, and the nlme package.
My purpose is to make a comparison of barnacle recruit density from 3
different regions. In each of these regions i have
keep <- apply( DATA, 1, min ) >= 100
DATA <- DATA[ keep, ]
See ?apply for more.
Gabor
On Fri, Mar 14, 2008 at 01:26:49PM +, IAIN GALLAGHER wrote:
> Hi list.
>
> I have a numerical dataset 22,000 rows deep and 43 columns wide. I would like
> to remove those rows which contain only values le
Hi list.
I have a numerical dataset 22,000 rows deep and 43 columns wide. I would like
to remove those rows which contain only values less than 100 (ie if any value
in the row is greater than 100 the row stays in the dataset). I am unsure how
to test each individual value across the rows and th
Hello everyone
Not strictly an R question but close... hopefully someone will be able
to help. I wish to compare the switchpoints in two switchpoint
regressions. The switchpoints were estimated using the segmented
library running in R, and I have standard errors for the estimates. I
initial
Hi, I have been trying to plot density plots using the example on:
http://addictedtor.free.fr/graphiques/graphcode.php?graph=139
I used to use this function, but I cannot get any old code or even the example
to work.
library("geneplotter")
require("RColorBrewer")
x1 <- matrix(rnorm(1e4),
hello,
I want to perform the Apriori association rules algorithm to my data. The set
of data contains missing values and consists in a combination of continuous and
categorical variables.
After discretizing the continuous variables, I wrote the following instruiction
to perform Apriori, but I ob
Hello.
I have a problem with shell langage.
To delete a not empty directory using the OS shell I have to do like this:
rd /s dossier1
and dossier1 contain an other directory dossier2.
But when I use the function shell like this:
shell(paste("rd /s",shQuote("dossier1",type="cmd")))
it
Try this:
> window(old, time(new)) <- ifelse(is.na(new), old[time(new)], new)
> old
PPAR pcp
(05/19/06 23:58:00) NA NA NA
(05/20/06 00:00:00) 956.23 252.30 NA
(05/20/06 00:02:00) 955.68 244.85 0
(05/20/06 00:04:00) 955.70 236.45 0
(05/20/06 00:06:00) 955.
>>> "Devred, Emmanuel" <[EMAIL PROTECTED]> 13/03/2008 18:08:45
>>>
Dear R-users,
>I haven't found a way in the searchable archive to overplot a contour
>(lines) over a surface.
I got round this by using the plot.axis parameter, which accepts a set
of plotting commands and isn't fussy about what
Thanks - that is exactly what I was looking for
Rainer
On Fri, Mar 14, 2008 at 1:10 PM, Henrique Dallazuanna <[EMAIL PROTECTED]> wrote:
> Try this:
>
> x[x %in% y]
>
>
>
> On 14/03/2008, Rainer M Krug <[EMAIL PROTECTED]> wrote:
> > Hi
> >
> > Consider the following code
> >
> > > x <- re
Use %in%:
x [ x %in% y ]
G.
On Fri, Mar 14, 2008 at 12:37:45PM +0200, Rainer M Krug wrote:
> Hi
>
> Consider the following code
>
> > x <- rep(1:13, 13)
>
> > y <- 1:3
>
> I want to select all elements in x which are equal to 1, 2 or 3.
>
> I know that I could use
>
> > sel <- x==y[1] | x=
Try this:
x[x %in% y]
On 14/03/2008, Rainer M Krug <[EMAIL PROTECTED]> wrote:
> Hi
>
> Consider the following code
>
> > x <- rep(1:13, 13)
>
> > y <- 1:3
>
> I want to select all elements in x which are equal to 1, 2 or 3.
>
> I know that I could use
>
> > sel <- x==y[1] | x==y[2] | x==y[3
Hello.
I have some problems, when I try to model an
optimization problem with some constraints.
The original problem cannot be solved analytically, so
I have to use routines like "Simulated Annealing" or
"Sequential Quadric Programming".
But to see how all this works in R, I would like to
start
Hi
Consider the following code
> x <- rep(1:13, 13)
> y <- 1:3
I want to select all elements in x which are equal to 1, 2 or 3.
I know that I could use
> sel <- x==y[1] | x==y[2] | x==y[3]
> x[sel]
to obtain the values, but in my analysis, the y-vector is thousands of
elements long.
Is ther
Christophe Genolini wrote:
> Hi the list
>
> Is it possible to give two names for a class ? One long name for using
> in programmation, and one short name for the "quick and durty" uses ?
>
Not easily.
> With function, we can do
>
> mcf <- myCoolFunction <- function(x)
>
That creates a n
Hello.
I have a problem with shell langage.
To delete a not empty directory using the OS shell I have to do like this:
rd /s dossier1
and dossier1 contain an other directory dossier2.
But when I use the function shell like this:
shell(paste("rd /s",shQuote("dossier1",type="cmd")))
it does
> Not easily.
Ok
> So you could probably write a function that tracked down and copied
> all the pieces, but it's not easy.
b. Well, you're right, it's not worth it.
So I will define a class ClusterizLongData then a constructor
cld <- clusterizLongData <- function(){new("ClusterizLongData"
Gabor,
Many thanks for your suggestion. This solution is very close, but not exactly
what I had in mind, because na.omit removes the entire row in which an NA
appears. I want to replace values in old with non-NA values from corresponding
times in new. If a timestamp from old does not appear
Hi the list
Is it possible to give two names for a class ? One long name for using
in programmation, and one short name for the "quick and durty" uses ?
With function, we can do
mcf <- myCoolFunction <- function(x)
With class, I define "clusterizedLongData", I want to use it with the
full
Thanks everyone.
On 3/14/08, Simon Blomberg <[EMAIL PROTECTED]> wrote:
>
> Or maybe use assign?
>
> > assign("natural_nums", 1:10)
> > natural_nums
> [1] 1 2 3 4 5 6 7 8 9 10
> >
>
> Cheers,
>
> Simon.
>
> On Fri, 2008-03-14 at 14:39 +1000, [EMAIL PROTECTED] wrote:
> > I'm not sure why yo
70 matches
Mail list logo