Re: [R] date handling

2005-12-13 Thread paul sorenson
d = as.POSIXlt(c(2005-07-01, 2005-07-02, 2005-07-03, 2005-07-04, 2005-07-05)) d$mon and d$year will get you part way there. That is assuming your dates are formated -mm-dd. strptime() might also be useful. Richard van Wingerden wrote: Hi, Given a frame with calendar date's:

Re: [R] Bivariate Splines in R

2005-12-13 Thread Martin Maechler
Cal == Cal Stats [EMAIL PROTECTED] on Mon, 12 Dec 2005 10:25:38 -0800 (PST) writes: Cal Hi.., is there a function in R to fit bivariate splines Cal ? I came across 'polymars' (POLSPLINE) and 'mars' Cal (mda) packages. Are these the one to use or are there Cal other specific

Re: [R] date handling

2005-12-13 Thread JeeBee
D = as.POSIXlt(c(2005-07-01, 2005-07-02, 2005-07-03, 2005-07-04, 2005-07-05)) (Years = 1900+D$year) [1] 2005 2005 2005 2005 2005 (Months = D$mon+1) [1] 7 7 7 7 7 weekdays(D) [1] Friday Saturday Sunday Monday Tuesday # you better check this one carefully !!! (Weeknumbers =

[R] Technique for reading large sparse fwf data file

2005-12-13 Thread Doran, Harold
Dear list: A datafile was sent to me that is very large (92890 x 1620) and is *very* sparse. Instead of leaving the entries with missing data blank, each cell with missing data contains a dot (.) The data are binary in almost all columns, with only a few columns containing whole numbers,

[R] Labeling a range of bars in barplot?

2005-12-13 Thread Dan Bolser
Hi, I am plotting a distribution of (ordered) values as a barplot. I would like to label groups of bars together to highlight aspects of the distribution. The label for the group should be the range of values in those bars. As this is hard to describe, here is an example; x - rlnorm(50)*2

[R] Labeling a range of bars in barplot?

2005-12-13 Thread Hans Gardfjell
Is this what you want... op-par(xpd=TRUE) segments(0,-1,20,-1,col=2) text(10,-1,Interval,pos=1) Cheers, Hans Gardfjell Dept. of Ecology and Environmental science Umeå University, Sweden Dan Bolser wrote: Hi, I am plotting a distribution of (ordered) values as a barplot. I would like to

[R] about empirical sample size in partial correlations

2005-12-13 Thread [EMAIL PROTECTED]
Hello everyone I have estimated the partial correlations of a matrix (n=160, vars=7) with command pcor.shrink (library corpcor) and then i want to estimate their respective confidence intervals. So i have tried to use the command pcor.confint(pcor,kappa,alpha) from library GeneNT. My problem

[R] Question

2005-12-13 Thread Davia Cox
Hello, I have a problem that I am trying to solve and I am not sure how to do it in R. Suppose, that 16 numbers are choosen at random from 0 to 9, what's the probability that their average will be between 4 and 6. I typed the following code: set.seed(100) sample(0:9, 16, replace =TRUE)

Re: [R] Question

2005-12-13 Thread Davia Cox
Please disregard this message and don't post it to the web. I found the answer. Thanks Davia S. Cox 517-575-8031 cell [EMAIL PROTECTED] Human potential, though not always apparent, is there waiting to be discovered and invited forth. -William W. Purkey On Dec 13, 2005, at 6:20 AM, Davia

[R] Problem with understanding output of Cox model

2005-12-13 Thread May, Roel
Hi all, I am using a 'tricked' Cox Hazard regression model for discrete choice habitat modelling. However, I'm having a hard time understanding the meaning of the first line the following part of the summary() output: Rsquare= 0.307 (max possible= 0.475 ) Likelihood ratio test= 91.8 on 12 df,

Re: [R] Time delay function or plot animation

2005-12-13 Thread Ulrike Grömping
Tobias, thanks to you and others, who made the same suggestion. This is exactly what I was looking for, Sys.sleep(0.1) does the job much more quietly than my previous solution ... Regards, Ulrike -- Original Message --- From: Tobias Verbeke [EMAIL PROTECTED] To: Ulrike

Re: [R] Comments please, how to set your mailer to read R-help in digest format

2005-12-13 Thread Hans-Peter
2005/12/12, Michael Dewey [EMAIL PROTECTED]: There are occasional comments on this list about how difficult it is to read the digest format. [snip] Any other comments welcome of course. I use google mail with a R-Label. In this way, all my R-Mails are available in the R-Label-view and are

[R] help for multivariate analysis

2005-12-13 Thread Matteo Vidali
dear R users, I need some help for multivariate analysis. I have 2 anaesthetic treatment groups (20 patients/group) where I register heart frequency and pressure for 60 min (repeated measures every 5 minutes). I would like to perform a test to check if treatments are different in controlling

[R] help with writing function

2005-12-13 Thread Oarabile Molaodi
I'm trying to write a function that takes a vector of length n and then takes the first value of the vector i.e j=1 and forms a new vector of length n (i.e replicate the first value n times). This function will then calculate the absoulte difference of the original vector and the new vector

Re: [R] Question

2005-12-13 Thread Sean Davis
On 12/13/05 6:20 AM, Davia Cox [EMAIL PROTECTED] wrote: Hello, I have a problem that I am trying to solve and I am not sure how to do it in R. Suppose, that 16 numbers are choosen at random from 0 to 9, what's the probability that their average will be between 4 and 6. I typed the

Re: [R] Question

2005-12-13 Thread Uwe Ligges
Davia Cox wrote: Hello, I have a problem that I am trying to solve and I am not sure how to do it in R. Suppose, that 16 numbers are choosen at random from 0 to 9, what's the probability that their average will be between 4 and 6. I typed the following code: set.seed(100)

[R] sample matrix

2005-12-13 Thread Carlos Mauricio Cardeal Mendes
Please, I´d like to store this sample matrix as a new object. How can I do this ? pulse - c(67, 67, 68, 68, 68, 69, 69, 69, 69, 69, 70, 70, 70, 70, 71, 71, 72, 72, 73, 74) m - NULL x - 0 for (i in 1:5) { x - sample(pulse,3) m - mean(x) cat(x,m,\n) } Thanks, Mauricio

Re: [R] Generation of missiing values in a time serie...

2005-12-13 Thread Alvaro Saurin
Hi, First, thank you. It 'almost' works: I can convert a matrix to a 'zoo' object, but it can not convert it to a 'ts'. The sitruation is this: I load a set of samples with h_types - list (0, 0, character(0), character(0), 0, 0, 0, 0, 0) h_names - list (time, flow, type, dir,

[R] Incomplete Beta

2005-12-13 Thread Albert Sorribas
Is there any function available in R for computing the incomplete Beta function? I'll appreciate any suggestion -- Albert Sorribas Grup de Bioestadística i Biomatematica Departament de Ciències Mèdiques Bàsiques Universitat de Lledia tel: +34 973 702 406 FAX: +34 973 702 426 Home page:

Re: [R] Generation of missiing values in a time serie...

2005-12-13 Thread Gabor Grothendieck
Your variable mat is not a matrix; its a data frame. Check it with: class(mat) Here is an example: x - cbind(A = 1:4, B = 5:8) tt - c(1, 3:4, 6) library(zoo) x.zoo - zoo(x, tt) x.ts - as.ts(x.zoo) On 12/13/05, Alvaro Saurin [EMAIL PROTECTED] wrote: Hi, First, thank you. It 'almost'

[R] Constrained Log-Likelihood with SQP Solver

2005-12-13 Thread Diethelm Wuertz
Dear R-Users, I'm searching for somebody who can support me or even likes to collaborate with me in setting up an R-package for constrained maximim log-likelihood parameter estimation. For example fitting the parameters of a MA(1)-APARCH(1,1) model for a time series of 17'000 points (e.g.

[R] superimpose density line over hist

2005-12-13 Thread Albert Vilella
Hi all, I'm trying to superimpose a rchisq density line over a histogram with something like: hist(alnlength) lines(density(rchisq(length(alnlength), 4)),col=red) But the rchisq line won't appear anywhere, Anyone knows what I am missing here? Thanks in advance, Albert.

[R] How to make a plot?

2005-12-13 Thread Gabor Grothendieck
Does anyone have an idea of how to make a chart in R like the ones here that use a graphic: http://bigpicture.typepad.com/comments/images/slide1.gif __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

[R] sample matrix as a new object

2005-12-13 Thread Carlos Mauricio Cardeal Mendes
Please, I´d like to store this sample matrix as a new object. How can I do this ? pulse - c(67, 67, 68, 68, 68, 69, 69, 69, 69, 69, 70, 70, 70, 70, 71, 71, 72, 72, 73, 74) m - NULL x - 0 for (i in 1:5) { x - sample(pulse,3) m - mean(x) cat(x,m,\n) } Thanks, Mauricio

Re: [R] Technique for reading large sparse fwf data file

2005-12-13 Thread Doran, Harold
I should have also noted in this email how I have allocated memory and an error that appears. I'm using Windows, so as in FAQ 2.2 I did C:\Program Files\R\R-2.2.0\bin\Rgui.exe --sdi --max-mem-size=2Gb # Check memory size in R example(memory.size) mmry.s memory.size() [1] 11894064 mmry.s

[R] help with multivariate analysis

2005-12-13 Thread Matteo Vidali
dear R users, I need some help for multivariate analysis. I have 2 anaesthetic treatment groups (20 patients/group) where I register heart frequency and pressure for 60 min (repeated measures every 5 minutes). I would like to perform a test to check if treatments are different in controlling

Re: [R] Bivariate Splines in R

2005-12-13 Thread Liaw, Andy
From: Martin Maechler Cal == Cal Stats [EMAIL PROTECTED] on Mon, 12 Dec 2005 10:25:38 -0800 (PST) writes: Cal Hi.., is there a function in R to fit bivariate splines Cal ? I came across 'polymars' (POLSPLINE) and 'mars' Cal (mda) packages. Are these the one to use or

Re: [R] superimpose density line over hist

2005-12-13 Thread Liaw, Andy
One thing to check: Are the data in the same range as chisq with 4 df? Andy From: Albert Vilella Hi all, I'm trying to superimpose a rchisq density line over a histogram with something like: hist(alnlength) lines(density(rchisq(length(alnlength), 4)),col=red) But the rchisq line

Re: [R] Question

2005-12-13 Thread Ted Harding
On 13-Dec-05 Uwe Ligges wrote: Davia Cox wrote: [...] My question is in order to run a true random sample, We have to disappoint you: Your computer cannot generate true random samples. At least on Linux (and probably most Unix) systems, /dev/random must be a pretty good approximation

[R] QQ plot for deviance residuals in generalized linear models

2005-12-13 Thread Peter Flom
Hello In an article in J. Computational and Graphical Statistics, v 13, p. 36-47, Ben and Yohai propose quantile quantile plots for deviance residuals of generalized linear models, Normal quantile plots of these residuals are unsatisfactory, but B and Y propose a QQ plot of the deviance

Re: [R] superimpose density line over hist

2005-12-13 Thread Dimitris Rizopoulos
try hist(alnlength, prob = TRUE) moreover I think that you do not need to sample from the Chi-squared to draw its density; you could use dchisq(seq(...), 4)) instead. I hope it helps. Best, Dimitris Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School of Public Health

Re: [R] superimpose density line over hist

2005-12-13 Thread Romain Francois
Le 13.12.2005 14:23, Albert Vilella a écrit : Hi all, I'm trying to superimpose a rchisq density line over a histogram with something like: hist(alnlength) lines(density(rchisq(length(alnlength), 4)),col=red) But the rchisq line won't appear anywhere, Anyone knows what I am missing here?

Re: [R] How to make a plot?

2005-12-13 Thread JeeBee
That can be done very easy using a program that can deal with layers, for example the Gimp. Just make one layer containing the barplot and one layer containing the background image. Then you can do all kind of nice things. Directly in R, I don't have a clue, but it wouldn't surprise me if

Re: [R] Incomplete Beta

2005-12-13 Thread Thomas Lumley
On Tue, 13 Dec 2005, Albert Sorribas wrote: Is there any function available in R for computing the incomplete Beta function? pbeta(). The incomplete Beta function is the cdf of the Beta distribution -thomas I'll appreciate any suggestion -- Albert Sorribas Grup de

Re: [R] Problem with understanding output of Cox model

2005-12-13 Thread Thomas Lumley
On Tue, 13 Dec 2005, May, Roel wrote: Hi all, I am using a 'tricked' Cox Hazard regression model for discrete choice habitat modelling. However, I'm having a hard time understanding the meaning of the first line the following part of the summary() output: Rsquare= 0.307 (max possible=

[R] interruption when pasting code into R under linux

2005-12-13 Thread Sebastian Leuzinger
hello, has anyone come across the following rather mysterious problem: when pasting large bits of code (100 and more lines) into the R console with the central mouse button (under linux), only part of the code is pasted, and the text interrupts somewhere arbitrarily. It does not happen when

Re: [R] sample matrix as a new object

2005-12-13 Thread JeeBee
You mean writing to a file? Maybe you should read the R Data Import/Export Manual http://cran.r-project.org/doc/manuals/R-data.html or as pdf http://cran.r-project.org/doc/manuals/R-data.pdf You might also want to read the manual pages of these two commands: help('dump') help('write.table')

Re: [R] superimpose density line over hist

2005-12-13 Thread Ted Harding
On 13-Dec-05 Albert Vilella wrote: Hi all, I'm trying to superimpose a rchisq density line over a histogram with something like: hist(alnlength) lines(density(rchisq(length(alnlength), 4)),col=red) But the rchisq line won't appear anywhere, Anyone knows what I am missing here?

Re: [R] Question

2005-12-13 Thread Prof Brian Ripley
On Tue, 13 Dec 2005 [EMAIL PROTECTED] wrote: On 13-Dec-05 Uwe Ligges wrote: Davia Cox wrote: [...] My question is in order to run a true random sample, We have to disappoint you: Your computer cannot generate true random samples. At least on Linux (and probably most Unix) systems,

Re: [R] superimpose density line over hist

2005-12-13 Thread Ted Harding
On 13-Dec-05 Albert Vilella wrote: Hi all, I'm trying to superimpose a rchisq density line over a histogram with something like: hist(alnlength) lines(density(rchisq(length(alnlength), 4)),col=red) But the rchisq line won't appear anywhere, Anyone knows what I am missing here?

[R] Forcing model parameters to a constant (in GLMs)

2005-12-13 Thread David Reitter
Hi, I'm looking for a way to bind specific model parameters to a constant (in my case: 0) before fitting the model. I'm fitting multinomial logistic regression models (via glm()). Assuming a model with a categorial response variable c {c1,c2,c3} that is a matrix like c2:b2 b2.1 b2.2

Re: [R] superimpose density line over hist

2005-12-13 Thread Albert Vilella
This certainly did the trick, Thanks Ted, Sean, Romain, Dimitris, Lian and Andy, alnlength-rchisq(1000,4) x-0.25*(0:100) hist(alnlength,breaks=0.25*(0:100)) lines(x,1000*dchisq(x,4)*0.25) And apologies for my newbieness in the posting, Albert.

[R] Polytopic Vector Analysis (PVA)

2005-12-13 Thread Melanie Edwards
I am curious whether anybody has or is developing this capability within R. I have not found any software yet that has this capability and I am not sure whether it is too new a method and nobody is actually using it, or if there are other means to get the same analysis that I do not know of. Any

Re: [R] sample matrix

2005-12-13 Thread Ferdinand Alimadhi
Hi Mauricio, Although you question is not clear, I'm supposing that you want to save as a new object (matrix) whatever is printed out from cat(x,m,\n). If this is the case, then your result is a matrix with 5 rows and 4 columns. For each row, the first 3 values are x and the last value is m.

[R] bug in geoR (?)

2005-12-13 Thread Antonio, Fabio Di Narzo
I've enconuntered this problem with the last cran version of geoR: library(geoR) day - rep(1:2, each=5) coords - matrix(rep(runif(10),2), 10, 2) data - rnorm(10) data[1] - NA as.geodata(cbind(coords, data, day), realisations=4) as.geodata: 1 points removed due to NA in the data Errore in

Re: [R] Incomplete Beta

2005-12-13 Thread Ted Harding
On 13-Dec-05 Thomas Lumley wrote: On Tue, 13 Dec 2005, Albert Sorribas wrote: Is there any function available in R for computing the incomplete Beta function? pbeta(). The incomplete Beta function is the cdf of the Beta distribution But don't forget to multiply by beta(,):

Re: [R] Generation of missiing values in a time serie...

2005-12-13 Thread Alvaro Saurin
On 13 Dec 2005, at 13:08, Gabor Grothendieck wrote: Your variable mat is not a matrix; its a data frame. Check it with: class(mat) Here is an example: x - cbind(A = 1:4, B = 5:8) tt - c(1, 3:4, 6) library(zoo) x.zoo - zoo(x, tt) x.ts - as.ts(x.zoo) Fixed, but anyway it fails:

Re: [R] convergence error (lme) which depends on the version of nlme (?)

2005-12-13 Thread Douglas Bates
On 12/12/05, Leo Gürtler [EMAIL PROTECTED] wrote: Dear list members, the following hlm was constructed: hlm - groupedData(laut ~ design | grpzugeh, data = imp.not.I) the grouped data object is located at and can be downloaded: www.anicca-vijja.de/lg/hlm_example.Rdata The following

Re: [R] Generation of missiing values in a time serie...

2005-12-13 Thread Gabor Grothendieck
Please provide a reproducible example. Note that dput(x) will output an R object in a way that can be copied and pasted into another session. On 12/13/05, Alvaro Saurin [EMAIL PROTECTED] wrote: On 13 Dec 2005, at 13:08, Gabor Grothendieck wrote: Your variable mat is not a matrix; its a data

[R] fSeries

2005-12-13 Thread Braesch Lucas
I'm trying to use garchFit from fSeries, with Student or Skewed Student conditionnal distribution. Let's say that eps (vector) is my series of daily log-returns: data(EuStockMarkets) eps = diff(log(EuStockMarkets[,CAC])) library(fSeries) g = garchFit(series = eps, formula.var = ~garch(2,2),

Re: [R] Question

2005-12-13 Thread Ted Harding
On 13-Dec-05 Prof Brian Ripley wrote: On Tue, 13 Dec 2005 [EMAIL PROTECTED] wrote: On 13-Dec-05 Uwe Ligges wrote: Davia Cox wrote: [...] My question is in order to run a true random sample, We have to disappoint you: Your computer cannot generate true random samples. At least on Linux

Re: [R] help with writing function

2005-12-13 Thread Robert Burrows
On Tue, 13 Dec 2005, Oarabile Molaodi wrote: I'm trying to write a function that takes a vector of length n and then takes the first value of the vector i.e j=1 and forms a new vector of length n (i.e replicate the first value n times). This function will then calculate the absoulte

Re: [R] How to make a plot?

2005-12-13 Thread Romain Francois
Le 13.12.2005 14:32, Gabor Grothendieck a écrit : Does anyone have an idea of how to make a chart in R like the ones here that use a graphic: http://bigpicture.typepad.com/comments/images/slide1.gif Hi Gabor, Here's a first draft. The following code will produce a pdf (i only found

Re: [R] Generation of missiing values in a time serie...

2005-12-13 Thread Alvaro Saurin
I think I have found the error. It appears when there are two entries with the same time. Using as input file: - CUT # Output format for PCKs: # TIME FLOW P [+-] SEQ TS X RTT SIZE # 123.125683 0 P + 967 123.125683 13394 0.798205 1472 123.241137 0 P + 968 123.241137 12680

Re: [R] Incomplete Beta

2005-12-13 Thread Peter Dalgaard
Thomas Lumley [EMAIL PROTECTED] writes: On Tue, 13 Dec 2005, Albert Sorribas wrote: Is there any function available in R for computing the incomplete Beta function? pbeta(). The incomplete Beta function is the cdf of the Beta distribution ..except for the normalizing constant, I

[R] creating a subset of a dataset using ifelse statement?

2005-12-13 Thread t c
I am using R in a Microsoft Windows environment. I have a dataset called “mp1b”. I have a variable called h. h can take a value from -1 to 5. If h 1, I want to create a new dataset called mp2 that is the same as mp1b: “mp2-mp1b” If h 0, I want to set create a

Re: [R] interruption when pasting code into R under linux

2005-12-13 Thread Uwe Ligges
Sebastian Leuzinger wrote: hello, has anyone come across the following rather mysterious problem: when pasting large bits of code (100 and more lines) into the R console with the central mouse button (under linux), only part of the code is pasted, and the text interrupts somewhere

Re: [R] Incomplete Beta

2005-12-13 Thread Prof Brian Ripley
On Tue, 13 Dec 2005 [EMAIL PROTECTED] wrote: On 13-Dec-05 Thomas Lumley wrote: On Tue, 13 Dec 2005, Albert Sorribas wrote: Is there any function available in R for computing the incomplete Beta function? pbeta(). The incomplete Beta function is the cdf of the Beta distribution But

Re: [R] help with writing function

2005-12-13 Thread Gregory Snow
Does this do what you want: IED - function(risk){ tmp - outer(risk,risk,-) tmp - abs(tmp) return(tmp[lower.tri(tmp)]) } -- Gregory L. Snow Ph.D. Statistical Data Center, IHC [EMAIL PROTECTED] (801) 408-8111 -Original Message- From: [EMAIL PROTECTED]

Re: [R] interruption when pasting code into R under linux

2005-12-13 Thread Marc Schwartz (via MN)
On Tue, 2005-12-13 at 15:50 +0100, Sebastian Leuzinger wrote: hello, has anyone come across the following rather mysterious problem: when pasting large bits of code (100 and more lines) into the R console with the central mouse button (under linux), only part of the code is pasted, and

[R] batch mode problem

2005-12-13 Thread Jörg Schaber
Hi, ok, I know I should be using a later version than 1.7.1 (64 bit) but it's not in my power. So here is the problem: In my R script I declare a data.frame that consists of 40 vectors, each having 125 numeric elements. This is no problem as long as I run the sript in interactive mode, but

Re: [R] Labeling a range of bars in barplot?

2005-12-13 Thread Marc Schwartz (via MN)
On Tue, 2005-12-13 at 10:53 +, Dan Bolser wrote: Hi, I am plotting a distribution of (ordered) values as a barplot. I would like to label groups of bars together to highlight aspects of the distribution. The label for the group should be the range of values in those bars. As this is

Re: [R] Generation of missiing values in a time serie...

2005-12-13 Thread Gabor Grothendieck
Yes, this is the definition of a time series and therefore of a zoo object. A time series is a mathematical function, i.e. it assigns a single element of the range to each element of the domain. This data does not describe a time series. Also it has no underlying regularity as the warning message

[R] Frailty with a Weibull PH Model

2005-12-13 Thread Singh, Jatinder
Hi, I am trying to fit a Weibull PH model with a gaussian frailty term (kidney data). Is the following approach correct? 1. Fit the model using survReg with the frailty term added in. Kidn1-survreg(formula = Surv(rtime, event)~ age+sex+gn+an+pkn+frailty.gaussian(patient), data=kidney,

[R] Ploting graphics using X tints from a color

2005-12-13 Thread Sérgio Nunes
Hi, I'm trying to draw a 2D plot using multiple tints of red. The (simplified) setup is the following: || year | x | y || My idea is that each year is plotted with a different tint of red. Older year (lightest) - Later year (darkest). I've managed to plot this with different scales of grays

Re: [R] Incomplete Beta

2005-12-13 Thread Ted Harding
On 13-Dec-05 Prof Brian Ripley wrote: On Tue, 13 Dec 2005 [EMAIL PROTECTED] wrote: On 13-Dec-05 Thomas Lumley wrote: On Tue, 13 Dec 2005, Albert Sorribas wrote: Is there any function available in R for computing the incomplete Beta function? pbeta(). The incomplete Beta function is

[R] Manipulating matrices

2005-12-13 Thread Sérgio Nunes
Hi, I'm pretty new to R and I've been having some problems filtering data in matrices. I have the following initial dataset: || year | name | varA || I have multiple values for varA for the same year and the same name. Having this as the input I would like to obtain the following: || year |

[R] Fwd: Re: Wavelet reconstruction

2005-12-13 Thread Elizabeth Lawson
I realized that I may not have answered the question you were asking and that no one else has responded. I can across a similar problem and may have an answer to your question now. If you have both the wavelet coefficients and the scaling coefficients then create a fake sequence of the same

Re: [R] creating a subset of a dataset using ifelse statement?

2005-12-13 Thread Ferdinand Alimadhi
?ifelse ; it's clear that you can use it in your case. Where cluster_q is comming from ( I suppose is the column name you want to filter by!)? What if you use the simpler syntax : if(h1) mp2-mp1 else mp2-subset(mp1b,cluster_q==h) ? THT t c wrote: I am using R in a Microsoft Windows

[R] correct C function usage

2005-12-13 Thread Ido M. Tamir
Hello, I am not sure if I am interfacing with C correctly and _safely_ or if there is a better way esp. with regards to terminating the returned array. I am trying to fill an int array with values whose actual size is determined in the C function and is always maximally as large as

Re: [R] Generation of missiing values in a time serie...

2005-12-13 Thread Gabor Grothendieck
In thinking about this some more, the trick I discussed is probably not the best way to do it since its possible that in the future zoo will completely disallow illegal zoo objects. I think a better way might be to construct it like this: aggregate(zoo(z.data), round(z.time, 1), tail, 1) where

[R] what does this warnings mean? and what should I do?

2005-12-13 Thread ronggui
I use lmer to fit a mixed effect model.It give some warnings.what does this warnings mean? and what should I do? (fm2.mlm - lmer(qd ~ edu + jiankang + peixun +hunyin + cadcj + age + age2 + sex + dangyuan + Comp.1 + Comp.2+trust.cz1 +(trust.cz1|commid), data = individual,na.action =

Re: [R] Ploting graphics using X tints from a color

2005-12-13 Thread Romain Francois
Le 13.12.2005 19:34, Sérgio Nunes a écrit : Hi, I'm trying to draw a 2D plot using multiple tints of red. The (simplified) setup is the following: || year | x | y || My idea is that each year is plotted with a different tint of red. Older year (lightest) - Later year (darkest). I've managed to

Re: [R] Ploting graphics using X tints from a color

2005-12-13 Thread hadley wickham
I'm trying to draw a 2D plot using multiple tints of red. The (simplified) setup is the following: || year | x | y || You might find this function useful: map_colour_gradient - function(x, low=red, mid=white,high=black, midpoint = 0) { x - as.numeric(x) low.rgb - col2rgb(low,

[R] Age of an object?

2005-12-13 Thread Trevor Hastie
It would be nice to have a date stamp on an object. In S/Splus this was always available, because objects were files. I have looked around, but I presume this information is not available. Trevor Hastie

Re: [R] Ploting graphics using X tints from a color

2005-12-13 Thread Romain Francois
Le 13.12.2005 21:40, Romain Francois a écrit : Le 13.12.2005 19:34, Sérgio Nunes a écrit : Hi, I'm trying to draw a 2D plot using multiple tints of red. The (simplified) setup is the following: || year | x | y || My idea is that each year is plotted with a different tint of red. Older

Re: [R] creating a subset of a dataset using ifelse statement?

2005-12-13 Thread Uwe Ligges
t c wrote: I am using R in a Microsoft Windows environment. I have a dataset called “mp1b”. I have a variable called h. h can take a value from -1 to 5. If h 1, I want to create a new dataset called mp2 that is the same as mp1b: “mp2-mp1b” If h 0, I want

Re: [R] batch mode problem

2005-12-13 Thread Uwe Ligges
Jörg Schaber wrote: Hi, ok, I know I should be using a later version than 1.7.1 (64 bit) but it's not in my power. So here is the problem: In my R script I declare a data.frame that consists of 40 vectors, each having 125 numeric elements. This is no problem as long as I run the

Re: [R] Ploting graphics using X tints from a color

2005-12-13 Thread Ben Bolker
Sérgio Nunes snunes at gmail.com writes: Hi, I'm trying to draw a 2D plot using multiple tints of red. The (simplified) setup is the following: || year | x | y || My idea is that each year is plotted with a different tint of red. Older year (lightest) - Later year (darkest). how

Re: [R] correct C function usage

2005-12-13 Thread Prof Brian Ripley
On Tue, 13 Dec 2005, Ido M. Tamir wrote: Hello, I am not sure if I am interfacing with C correctly and _safely_ or if there is a better way esp. with regards to terminating the returned array. You need to pass the length to the C routine and check you do not overwrite it. (As in the parts

Re: [R] export from R to MySQL

2005-12-13 Thread Meinhard Ploner
On Dec 12, 2005, at 6:50 PM, David James wrote: Prof Brian Ripley wrote: On Mon, 12 Dec 2005, Sean Davis wrote: On 12/12/05 9:21 AM, bogdan romocea [EMAIL PROTECTED] wrote: Sean Davis wrote: but you will have to create the table by hand There's no need for manual steps. To take

Re: [R] fSeries

2005-12-13 Thread Diethelm Wuertz
Braesch Lucas wrote: I'm trying to use garchFit from fSeries, with Student or Skewed Student conditionnal distribution. Let's say that eps (vector) is my series of daily log-returns: data(EuStockMarkets) eps = diff(log(EuStockMarkets[,CAC])) library(fSeries) g = garchFit(series = eps,

Re: [R] Manipulating matrices

2005-12-13 Thread jim holtman
aggregate(x$varA, by=list(x$year, x$name), mean) On 12/13/05, Sérgio Nunes [EMAIL PROTECTED] wrote: Hi, I'm pretty new to R and I've been having some problems filtering data in matrices. I have the following initial dataset: || year | name | varA || I have multiple values for varA for

[R] getting faster results

2005-12-13 Thread Elizabeth Lawson
Hey, Can anyone answer this question. I am working with really large datasets and most of the programs I have been running take quite some time. I heard that R may be faster in Unix. I sthis true and if so can anyone reccomend which system and requirements may allow things to go

Re: [R] Polytopic Vector Analysis (PVA)

2005-12-13 Thread Kjetil Brinchmann Halvorsen
Melanie Edwards wrote: I am curious whether anybody has or is developing this capability within R. I have not found any software yet that has this capability and I am not sure whether it is too new a method and nobody is actually using it, googling around I found that this (PVA) is a variant

Re: [R] Generation of missiing values in a time serie...

2005-12-13 Thread Kjetil Brinchmann Halvorsen
Gabor Grothendieck wrote: Yes, this is the definition of a time series and therefore of a zoo object. A time series is a mathematical function, i.e. it assigns a single element of the range to each element of the domain. This data does not describe a time series. Since nobody else has

Re: [R] getting faster results

2005-12-13 Thread Berton Gunter
Please read the posting guide and repost. Your question is too vague to respond to sensibly. Speed in R depends on two things: How you program and what sort of system resources R has available (especially memory). OS's can certainly make a difference, but this is a 2nd order effect, I think. --

[R] Simplifying matrices ?

2005-12-13 Thread Sérgio Nunes
Hi again, the previous answers were great. I was able to do what was planned. Now, I would like to do the following to a matrix: || year | event | team | total || where I can have multiple event per team, but each team only has a year and a total. Thus, this table has multiple lines for the

Re: [R] bug in geoR (?)

2005-12-13 Thread Paulo Justiniano Ribeiro Jr
Dear Fabio PLease download the latest geoR from: www.est.ufpr.br/geoR and let me know in case the problem persists P.J. On Tue, 13 Dec 2005, Antonio, Fabio Di Narzo wrote: Date: Tue, 13 Dec 2005 17:18:14 +0100 From: Antonio, Fabio Di Narzo [EMAIL PROTECTED] To: [EMAIL PROTECTED] Cc:

[R] Sorting vectors according to a desired correlation coef

2005-12-13 Thread Sierra, Carlos
Dear all First time posting in this list. This is my question: I have three vectors (x, y, z) containing random numbers from three different distributions (normal, random, exponential). I want to sort the vectors so the pairwise correlation coefficient between them is 0.5. How can I do this. I

Re: [R] lme intervals

2005-12-13 Thread Spencer Graves
Have you tried ?intervals and ?intervals.lme? The following is an example under ?intervals.lme: fm1 - lme(distance ~ age, Orthodont, random = ~ age | Subject) intervals(fm1) Also, have you checked Pinheiro and Bates (2000) Mixed-Effects Models in S and S-Plus (Springer)?

Re: [R] Simplifying matrices ?

2005-12-13 Thread Jacques VESLOT
unique(x[,-2]) Sérgio Nunes a écrit : Hi again, the previous answers were great. I was able to do what was planned. Now, I would like to do the following to a matrix: || year | event | team | total || where I can have multiple event per team, but each team only has a year and a total. Thus,

[R] Glitch when creating online help

2005-12-13 Thread Hong Ooi
___ Hi, I'm writing up the online help for a package I'm developing (in-house only, sorry), and I've come across an odd glitch when trying to nest a list inside the arguments section of the .Rd file. I was just

[R] broken package?

2005-12-13 Thread Jeff D. Hamann
I've just tried to install the tseries package (which seems to include quite a bit) and got the following results: package 'dynlm' successfully unpacked and MD5 sums checked package 'leaps' successfully unpacked and MD5 sums checked package 'chron' successfully unpacked and MD5 sums checked

[R] About help on 'mahalanobis'

2005-12-13 Thread Henrik Bengtsson
Hi, help on 'mahalanobis' (in the stats package in Rv2.2.0) now says: Description: Returns the Mahalanobis distance of all rows in 'x' and the vector mu='center' with respect to Sigma='cov'. This is (for vector 'x') defined as D^2 = (x - mu)' Sigma^{-1} (x -

[R] Memory shortage running Repeated Measures (nlme)

2005-12-13 Thread Evandro do Nascimento Silva
Dear group, I tried to run a Repeated Mesures Anova for Mixed effects model and I got a warnning after entering the model specification saying: Reached total allocation of 254Mb: see help(memory.size). here is part of the log: ***

Re: [R] Glitch when creating online help

2005-12-13 Thread Hong Ooi
___ Ah, I think I've solved it. Apparently \describe needs to have a newline before it, or things get funny. Thus \arguments{ \item{item1}{ This is item 1. } \item{itemlist}{ Here is a list.

Re: [R] broken package?

2005-12-13 Thread Prof Brian Ripley
On Tue, 13 Dec 2005, Jeff D. Hamann wrote: I've just tried to install the tseries package (which seems to include quite a bit) and got the following results: package 'dynlm' successfully unpacked and MD5 sums checked package 'leaps' successfully unpacked and MD5 sums checked package 'chron'

Re: [R] Ploting graphics using X tints from a color

2005-12-13 Thread Roger Bivand
On Tue, 13 Dec 2005, Sérgio Nunes wrote: Hi, I'm trying to draw a 2D plot using multiple tints of red. The (simplified) setup is the following: || year | x | y || My idea is that each year is plotted with a different tint of red. Older year (lightest) - Later year (darkest). I've managed