Re: [R] histogram tick labels

2008-06-09 Thread S Ellison
Lawrence, use hist(..., axes=F) then put your own axis on with axis(1,...) Example: y<-rnorm(200) hist(y,axes=F) axis(2) axis(1, at=seq(-3,3,1)) Steve E >>> "Lawrence Hanser" <[EMAIL PROTECTED]> 06/09/08 7:02 AM >>> Dear Friends, I am doing a rather simple histogram on a vector of data, MR. I

Re: [R] label points on a graph

2008-06-09 Thread Jim Lemon
Paul Adams wrote: Hello everyone, I have a plot and I am wanting to label points as 1 through 20 I have the following code for the plot: dat<-read.table(file="C:\\Documents and Settings\\Owner\\My Documents\\colon cancer1.txt",header=T,row.names=1) file.show(file="C:\\Documents and Settings\\Own

[R] Plot Coloured Triangle

2008-06-09 Thread Antje
Hi there, I'd like to plot a triangle with each point having a certain color defined and fill it with the interpolated values. The following code shall represent somehow, three points with x,y, and the "amount" of red for example... point1 <- c(1.1, 1.7, 255) point2 <- c(2.2, 1.5, 180) point3

[R] Help with biplot function

2008-06-09 Thread Muri Soares
Hi All, Is there a way to omit the variables in the graphical output of the biplot function (so that only the categories are shown in the plot)? In addition does the identify function work with the biplot function? Thank you, [[alternative HTML version deleted]] _

[R] package mgcv

2008-06-09 Thread Amandine PIERROT
Hello ! I am working on generalized additive models using the package mgcv, and I would like to know where I could find information about the estimated splines so I could reconstruct the full function instead of just having values at given points (with predict.gam, type="terms") ? Thanks in adv

Re: [R] package mgcv

2008-06-09 Thread Simon Wood
Amandine, The coefficients of the splines are in the `coefficients' part of the fitted `gam' object, but what they mean depends on what basis you used Chapter 4 of Wood S.N. (2006) Generalized Additive Models: An Introduction with R. Chapman and Hall/CRC Press, gives the details for all the

[R] Overlaying the matrices

2008-06-09 Thread Shubha Vishwanath Karanth
Hi R, I have a matrix, > x1=matrix(NA,6,6,dimnames=list(letters[1:6],LETTERS[1:6])) > x1 A B C D E F a NA NA NA NA NA NA b NA NA NA NA NA NA c NA NA NA NA NA NA d NA NA NA NA NA NA e NA NA NA NA NA NA f NA NA NA NA NA NA > x2=matrix(rpois(9,1),3,3,dimnames=list(c("b","a"

Re: [R] Overlaying the matrices

2008-06-09 Thread Henrique Dallazuanna
Perhaps somethink like about this: x1[rownames(x2),colnames(x2)] <- x2 x1 On Mon, Jun 9, 2008 at 8:26 AM, Shubha Vishwanath Karanth < [EMAIL PROTECTED]> wrote: > Hi R, > > > > I have a matrix, > > > > > x1=matrix(NA,6,6,dimnames=list(letters[1:6],LETTERS[1:6])) > > > x1 > > A B C D E F >

Re: [R] editing a data.frame

2008-06-09 Thread john.polo
that did the trick. thanks a lot! john jim holtman wrote: Actually change the TreeTag to characters first because you are trying to store in a new factor value that is not there yr1bp$TreeTag <- as.character(yr1bp$TreeTag) yr1bp$TreeTag[1501]<-sub("1.00", "1", yr1bp$TreeTag[1501]) # change b

Re: [R] Overlaying the matrices

2008-06-09 Thread Dimitris Rizopoulos
try this: x1 <- matrix(NA, 6, 6, dimnames = list(letters[1:6], LETTERS[1:6])) x2 <- matrix(rpois(9, 1), 3, 3, dimnames = list(c("b","a","f"), c("D","E","F"))) x1[rownames(x2), colnames(x2)] <- x2 x1 I hope it helps. Best, Dimitris Dimitris Rizopoulos Biostatistical Centre School o

Re: [R] Overlaying the matrices

2008-06-09 Thread Shubha Vishwanath Karanth
Suppose if I modify the question as: > x A B C D E a 0 0 0 0 1 b 0 1 0 2 1 c 1 2 0 1 2 d 0 0 0 2 0 e 0 1 2 0 2 > y D E F b 2 1 2 a 4 0 1 f 1 4 1 I need to get a matrix, which has the dimension being the union of the row names and column names of both x and y such that the new matrix 'xx' sho

[R] package mgcv - actual bases

2008-06-09 Thread Amandine PIERROT
Thank you for your answer ! Actually I'm doing an internship about GAM for mid-term french load forecasting (at "EDF", Electricité De France). I'm working with your book and I was asked to simulate data on my own, in order to see if gam (from mgcv) gave good estimations of the functions I had

[R] Student Distribution and Funtion qt

2008-06-09 Thread Antje Schafföner
Hello, I am trying to calculate and plot mean and confidence intervall for a set of data. This is the code that I am currently using: means <- sapply(data, mean, na.rm=TRUE) n <- sapply(data,length) stdev <- sqrt(sapply(data, var, na.rm=TRUE)) ciw <- qt(0.98, n) * stdev / sqrt(n) par(mgp=

[R] [R-pkgs] Fwd: mgcv 1.4 on CRAN

2008-06-09 Thread Simon Wood
mgcv 1.4 is now on CRAN. It includes new features to allow mgcv::gam to fit almost any (quadratically) penalized GLM, plus some extra smoother classes. New gam features - * Linear functionals of smooths can be included in the gam linear predictor, allowing, e.g., function

Re: [R] Store filename

2008-06-09 Thread DAVID ARTETA GARCIA
Hi Henrique, Daniel and Jim, and rest of the list. Your comments have been really useful. Daniel, you mention whether I am looping over some files stored in a directory. Is that actually doable with R? I mean, is it possible to read all the files in the same directory and run my script thro

Re: [R] Student Distribution and Funtion qt

2008-06-09 Thread Ted Harding
On 09-Jun-08 13:14:02, "Antje Schafföner" wrote: > Hello, > I am trying to calculate and plot mean and confidence intervall for a > set of data. This is the code that I am currently using: > > > means <- sapply(data, mean, na.rm=TRUE) > n <- sapply(data,length) > stdev <- sqrt(sapply(data, v

Re: [R] Store filename

2008-06-09 Thread jim holtman
list.files() will return the files in your current directory and you can use that in a 'for' statement to loop through processing: for (fileName in list.files()){ input <- read.table(fileName,) } On Mon, Jun 9, 2008 at 10:07 AM, DAVID ARTETA GARCIA < [EMAIL PROTECTED]> wrote: >

[R] Systemfit (was RE: How to force two regression coefficients to be equal but opposite in sign?)

2008-06-09 Thread Woolner, Keith
Thank you, Greg, and also to Scott Ellison, who replied privately. I am in the process of trying out both suggestions. After I sent my initial message, I came across the Systemfit package, which allows specification of constraints on parameters. In theory, this should solve my problem perfectly.

[R] Two y-axes boxplot

2008-06-09 Thread stephen sefick
I am aware of the inherent risks of having plots with more than two axes, but I am trying to produce the graphs that I have been tasked with. That being said I am having a hard time figuring out how to have two axes onto a boxplot. below is the sample code.I would like BC on the plot produce

[R] Problems with strptime

2008-06-09 Thread Vittorio
Perhaps I'm missing a real, stupid point but I can't understand the following behaviour: > strptime("30 march 2008 02:30 AM",format="%d %B %Y %I:%M %p") [1] "2008-03-30 02:30:00" > strptime("30 march 2008 00:30 AM",format="%d %B %Y %I:%M %p") [1] NA Why times 00:nn are not available and how s

[R] Missing Data and applying

2008-06-09 Thread Michael Pearmain
Hi All, Newbie question that i'm sure is easy, but i can't seem to apply properly I read in a datafram from a CSV file and i want to tell R that from coloum "n_0" to "n_32" the value "-1" is missing data i was looking at the is.na(xx) <- c(..,...,) idea but i can't seem to apply it properly, can

Re: [R] Plot Coloured Triangle

2008-06-09 Thread Greg Snow
Here is an example that may get you started: point1 <- c(1.1, 1.7, 255) point2 <- c(2.2, 1.5, 180) point3 <- c(1.8, 2.2, 60) mydf <- as.data.frame( rbind(point1, point2, point3) ) names(mydf) <- c('x1','x2','red') fit <- lm(red~x1+x2, data=mydf) df2 <- expand.grid( x1=seq(min(mydf$x1), max(mydf

Re: [R] Missing Data and applying

2008-06-09 Thread jim holtman
This might help the first question: > da <- (-1):1 > x <- data.frame(a1=sample(da,10,TRUE), a2=sample(da,10,TRUE), a3=sample(da,10,TRUE)) > x a1 a2 a3 1 0 1 0 2 0 0 1 3 0 1 0 4 -1 0 -1 5 1 0 -1 6 1 1 -1 7 1 -1 -1 8 -1 0 0 9 1 1 0 10 0 1 0 > is.na(x[1:3]) <- x[1:3

Re: [R] Problems with strptime

2008-06-09 Thread jim holtman
%I is only defined for 01-12: %I Hours as decimal number (01–12). so there is not time of 00:30 AM. I supposed you mean 12:30 AM On Mon, Jun 9, 2008 at 11:17 AM, Vittorio <[EMAIL PROTECTED]> wrote: > Perhaps I'm missing a real, stupid point but I can't understand the > following behaviour: >

[R] xyplot.zoo question about strip.left and layout

2008-06-09 Thread Klaus Nordhausen
Dear R masters, I have large multivariate time series as zoo objects and want to plot them using lattice. Since I have many variates in one object I would like to have the strips on the left, using strip.left = TRUE. However when I use this the variable names are converted into numbers. How ca

[R] sprintf()

2008-06-09 Thread Paulo Cardoso
Hi, I'm not being able to represent the result of sprintf("%E", pi) [1] "3.141593E+00" Into this: "3.141593E+" Thanks in advance Paulo __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting gu

Re: [R] sprintf()

2008-06-09 Thread Henrique Dallazuanna
Try: sprintf("%E00", pi) On Mon, Jun 9, 2008 at 1:28 PM, Paulo Cardoso <[EMAIL PROTECTED]> wrote: > Hi, > > I'm not being able to represent the result of sprintf("%E", pi) > [1] "3.141593E+00" > > Into this: > "3.141593E+" > > Thanks in advance > > Paulo > > _

Re: [R] sprintf()

2008-06-09 Thread Paulo Cardoso
Yes works, Thank you Henrique. I’m so basic with R! Paulo From: Henrique Dallazuanna [mailto:[EMAIL PROTECTED] Sent: segunda-feira, 9 de Junho de 2008 17:37 To: Paulo Cardoso Cc: r-help@r-project.org Subject: Re: [R] sprintf() Try: sprintf("%E00", pi) On Mon, Jun 9, 2008 at 1:28 PM, P

Re: [R] array of arrays

2008-06-09 Thread Michael Prince
Thanks to all three of you. I used a 4 dimensional array as you suggested. I will have to do a lot of loops with loop variables i and j. I should perhaps save my results from time to time, no ? If I need to save "object1" and "object2", the command should be save(object1,object2,file=paste("save"

[R] converting a data set to a format for time series analysis

2008-06-09 Thread Ricardo Pietrobon
I currently have a data set describing human subjects enrolled into an international clinical trial, the name of the hospital enrolling this human subject, the date when the subject was enrolled, and a vector with variables representing characteristics of the site (e.g., number of beds in a hospita

Re: [R] sprintf()

2008-06-09 Thread jim holtman
But be careful if your number does not contain only 0: > sprintf("%E00", pi*1000) [1] "3.141593E+0300" > sprintf("%E", pi*1000) [1] "3.141593E+03" On Mon, Jun 9, 2008 at 12:42 PM, Paulo Cardoso <[EMAIL PROTECTED]> wrote: > Yes works, > > Thank you Henrique. > > I'm so basic with R! > > Paulo >

Re: [R] converting a data set to a format for time series analysis

2008-06-09 Thread jim holtman
Will something like this work for you: > x <- read.table(textConnection("subject hospitaldate_enrollment hospital_beds + 1 hospitalA 1/3/2002300 + 2 hospitalA 1/6/2002300 + 3 hospitalB 2/4/2002150 + 4 hospitalC 3/2/200

Re: [R] sprintf()

2008-06-09 Thread jim holtman
Here is one way of getting the digits: > x <- sprintf("%E", 0.04) > x [1] "4.00E-06" > gsub("([[:digit:]]+$)", > substr("\\1",nchar("\\1")+1,nchar("\\1")+4), x, perl=TRUE) [1] "4.00E-0006" > On Mon, Jun 9, 2008 at 12:56 PM, jim holtman <[EMAIL PROTECTED]> wrote: > But be carefu

Re: [R] converting a data set to a format for time series analysis

2008-06-09 Thread Ricardo Pietrobon
Jim, thanks a lot. This does the trick for dates, but what I have been struggling the most with is actually the conversion from having one subject per row to having one month per row. I didn't explain that well at all in my previous email and so let me try again. The idea is that the current dat

[R] Basic Question on Keys/Values

2008-06-09 Thread Dumblauskas, Jerry
As a java programmer, I'm having issue conceptualizing the following use case: Given an value, passed into a function, how do I pull out the lookup? Ie. A list of keys (key1, key2, key3) A list of values (val1,val2,val3) I want to write a function (or is there something built in?) such that Cal

Re: [R] Java to R interface

2008-06-09 Thread Dumblauskas, Jerry
So the system path is set. In your props you set the jar (otherwise you will not compile) But, in your class you run with did you pass as a system call the path to jri? In my system I pass it in as such -Djava.library.path=C:\R\R-2.7.0\library\rJava\jri If I remove that I get your error (i

Re: [R] txt file, 14000+ rows, only last 8000 appear

2008-06-09 Thread RobertsLRRI
You are asked to follow the posting guide and to provide "commented, minimal, self-contained, reproducible code". Code entered: Influenza<-read.delim("C://Documents and Settings//rroberts//desktop//H5N1//0v8a1n3.dat.txt") Influenza rows 6505 ... 14421 So the first 6504 rows aren't displayed

Re: [R] Basic Question on Keys/Values

2008-06-09 Thread Douglas Bates
On Mon, Jun 9, 2008 at 12:55 PM, Dumblauskas, Jerry <[EMAIL PROTECTED]> wrote: > As a java programmer, I'm having issue conceptualizing the following use > case: > Given an value, passed into a function, how do I pull out the lookup? > Ie. > A list of keys (key1, key2, key3) > A list of values (v

[R] Probs with paste

2008-06-09 Thread EVANS David-William
Hello all, After some months doing ok with R, I am embarrassed that I have to make this my first posting to the help list. I am trying to run the following (actually in a loop but shortened for the post): risk.factors <- c("file$A", "file$B", "file$C", "file$D", "file$E") table(pas

Re: [R] xyplot.zoo question about strip.left and layout

2008-06-09 Thread Gabor Grothendieck
Or perhaps this way is more logical since it takes the names from the screens: test2<-xyplot(z, as.table=TRUE , screens = colnames(z), strip=FALSE , strip.left = TRUE, layout=c(1,3,2)) On Mon, Jun 9, 2008 at 2:10 PM, Gabor Grothendieck <[EMAIL PROTECTED]> wrote: > Try: > > strip.left = strip.cu

[R] ayuda con la funcion filter

2008-06-09 Thread wilquin Minaya
Hola Necesito crea una funcion usando filter que en vez de sustituir los datos por los puntos de alrededor lo haga por la mediana. Puedo utilizar esta funcion de esta manera para utilizar la media y para utilizar la mediana filter(MATDINAMIC$VELOCIDADFIN[1:1000],rep(1/

Re: [R] xyplot.zoo question about strip.left and layout

2008-06-09 Thread Gabor Grothendieck
Try: strip.left = strip.custom(factor.levels = colnames(z)) On Mon, Jun 9, 2008 at 12:18 PM, Klaus Nordhausen <[EMAIL PROTECTED]> wrote: > Dear R masters, > > I have large multivariate time series as zoo objects and want to plot them > using lattice. > > Since I have many variates in one obje

Re: [R] Basic Question on Keys/Values

2008-06-09 Thread Douglas Bates
On Mon, Jun 9, 2008 at 1:11 PM, Dumblauskas, Jerry <[EMAIL PROTECTED]> wrote: > I've received a couple of responses telling me to use list (I was trying > to use 2 equal length vectors but having an issue pulling out the index > subscript). Should you ever need to do that for another application,

Re: [R] Basic Question on Keys/Values

2008-06-09 Thread Dumblauskas, Jerry
I've received a couple of responses telling me to use list (I was trying to use 2 equal length vectors but having an issue pulling out the index subscript). I can use lists now, and stop thrashing :) Thx again for the assistance! -Original Message- From: [EMAIL PROTECTED] [mailto:[EM

Re: [R] Probs with paste

2008-06-09 Thread Charilaos Skiadas
I have to say it is not clear at all what you expected. risk.factors [1] is the character vector "file$A". You ask it to do a paste of that, so of course it will just return itself. Then you do a table, and naturally it tells you that it found "file$A" exactly once. So what you have forgotte

Re: [R] Probs with paste

2008-06-09 Thread jim holtman
Try this: riskFactors <- c("A", "B", "C") table(file[[riskFactor[1]]]) in a loop for (i in riskFactor) table(file[[riskFactor[i]]]) On Mon, Jun 9, 2008 at 10:44 AM, EVANS David-William < [EMAIL PROTECTED]> wrote: > Hello all, > > > > After some months doing ok with R, I am embarrassed that I h

[R] Boxplot custom axis

2008-06-09 Thread stephen sefick
I would like to add another axis on side 4 (see code below) #order the box plot any damn way I want too order1 <- factor(as.character(x$Site), levels=c("Betty's Branch", "Stevens Creek", "North Augusta", "520", "Horse Creek", "Stan's", "place","Downstream", "IP", "Vo

[R] nonlinear fitting on many voxels

2008-06-09 Thread Ayman Oweida
After many months, I am now banging my head against the wall because I can't find a solution to this seemingly trivial problem.  Any help would be appreciated: I am trying to apply a nonlinear fitting routine to a 3D MR image on a voxel-by-voxel basis.  I've tested the routine using simulated d

[R] Cross-validation in R

2008-06-09 Thread Luis Orlindo Tedeschi
Folks; I am having a problem with the cv.glm and would appreciate someone shedding some light here. It seems obvious but I cannot get it. I did read the manual, but I could not get more insight. This is a database containing 3363 records and I am trying a cross-validation to understand the process.

[R] Crosscorr.plot

2008-06-09 Thread Doran, Harold
Just out of curiosity, why might this be occuring: > class(x6) [1] "mcmc" > crosscorr.plot(x6) NULL # Replicable code example(lmer) x6 <- mcmcsamp(fm1, n=1000) crosscorr.plot(x6) __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listi

Re: [R] nonlinear fitting on many voxels

2008-06-09 Thread Charles C. Berry
On Mon, 9 Jun 2008, Ayman Oweida wrote: After many months, I am now banging my head against the wall because I can't find a solution to this seemingly trivial problem.  Any help would be appreciated: I am trying to apply a nonlinear fitting routine to a 3D MR image on a voxel-by-voxel basis. 

[R] using spec.pgram

2008-06-09 Thread Anthony Mathelier
Hi everyone, first of all, I would like to say that I am a newbie in R, so I apologize in advance if my questions seem to be too easy for you. Well, I'm looking for periodicity in histograms. I have histograms of certain phenomenons and I'm asking whether a periodicity exists in these data. So, I

Re: [R] txt file, 14000+ rows, only last 8000 appear

2008-06-09 Thread IAIN GALLAGHER
I'm pretty sure I've had similar problems to this in the past and the problem has been a badly formatted text file ie you think it's all tab delimited but it's not. I can't be more specific (because it's your file) but it would be worth copying the non appearing rows into a separate file and se

[R] piper diagram

2008-06-09 Thread Dylan Beaudette
Hi, Is anyone on the list familiar with an R implementation of Piper Diagrams? Example: http://faculty.uml.edu/nelson_eby/89.315/IMAGES/Figure%209-78.jpg I am thinking that two calls to triax.plot (plotrix) along with some kind of affine-transformed standard plot would do the trick. Not so sure

Re: [R] txt file, 14000+ rows, only last 8000 appear

2008-06-09 Thread jim holtman
You also might use 'count.fields' to see how many values are on each line. Also do you have any comment charaters in the text? Here is a large file that is fine: > # create a large file > myFile <- tempfile() > myConn <- file(myFile, 'w') > for (i in 1:2) writeLines("1 2 3 4 5 6", myConn) > c

Re: [R] piper diagram

2008-06-09 Thread Bert Gunter
ternaryplot() in the vcd package might help. -- Bert Gunter Genentech Nonclinical Statistics -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Dylan Beaudette Sent: Monday, June 09, 2008 1:36 PM To: R-help@r-project.org Subject: [R] piper diagram Hi, Is

[R] missing data

2008-06-09 Thread wilquin Minaya
hi I would like to know how I can complete those missing data from these programs: program number one DATOS2 <- sin(seq(1,20,0.1)) > DATOS2[103] <- NA > DATOS2[65] <- NA > DATOS2[134] <- NA this is the other one > data(pressure) > DATOS3 <- pressure > DATOS3[4,1] <- NA > DATO

[R] Plot timer in a for loop

2008-06-09 Thread Ken Spriggs
Hello, This code works fine but is so fast I can't see anything but the last plot. for (i in nrow(X)){ plot(as.numeric(d[i,])) } I'd like to view a plot every 500 milliseconds, nrow(X) = 400. How? Thanks -- View this message in context: http://www.nabble.com/Plot-timer-in-a-for-loop-

[R] help with function filter

2008-06-09 Thread wilquin Minaya
Hi everybody I need to create a program using the function filter with this vector. MATDINAMIC$VELOCIDADFIN[1:1000] That´s why I want to identify when use the mean and the median because I have problems. I want to know if I am using correct this: filter(MATDINAMIC$VELOCIDADFIN[

[R] Comparing two groups of proportions

2008-06-09 Thread Ivan Adzhubey
Hi, I have a seemingly common problem but I can't find a proper way to approach it. Let's say we have 5 samples (different size) of IC circuits coming from 5 production lines (A, B, C, D, E). We apply two different non-destructive QA procedures to each sample, producing to sets of binary outcom

[R] readLines fails to read entire file

2008-06-09 Thread Dennis Fisher
Colleagues I have just encountered an interesting problem with readLines in R 2.7.0 in Windows Vista. I am trying to read a line that is created in the following manner: 1. Intel Fortran (ifort) 10.1 creates two text files. 2. The OS concatenates these files with: copy

[R] help on data selection

2008-06-09 Thread Lisa
Hi, I am having a question. With multiple observations for each ID, I would like to keep only two or 3 observations for each ID. Does R have any command to do this? thank you very much! A simple example is below, How can I only keep the first 2 observations for each j? j x 1 1 0.79

[R] Bug/Error in formatC? (Was: Why doesn 't formatC( x, digits=2, format= " g")...)

2008-06-09 Thread Peter Dunn
Hi all After posting what follows, Duncan Murdoch suggested perhaps a bug in formatC, or an error on documentation. Any comments? In particular, bug, error or not, any ideas about how I can consistently get two significant figures to print? P. -- Original Message -- Hi a

Re: [R] Plot timer in a for loop

2008-06-09 Thread jim holtman
Write it out to a PDF file and you can view at your leasure. On WIndows you have the option of paging back and forth between the plots. On Mon, Jun 9, 2008 at 5:02 PM, Ken Spriggs <[EMAIL PROTECTED]> wrote: > > Hello, > > This code works fine but is so fast I can't see anything but the last plot

Re: [R] nonlinear fitting on many voxels

2008-06-09 Thread Ayman Oweida
Below is a sample code using random generated numbers that represents what I'm trying to do. I ran it a few times until I got the same error.  I hope this can help in defining where I'm going wrong.  library(Bolstad) library(nlme) Ref<-runif(10) # data for reference region R1Tn<-runif(10) # d

Re: [R] readLines fails to read entire file

2008-06-09 Thread jim holtman
Try the following: f <- file("your file", "rb") # read in binary mode input <- readLines(f) close(f) On Mon, Jun 9, 2008 at 7:02 PM, Dennis Fisher <[EMAIL PROTECTED]> wrote: > Colleagues > > I have just encountered an interesting problem with readLines in R > 2.7.0 in Windows Vista. I am tryin

Re: [R] help on data selection

2008-06-09 Thread jim holtman
This should do it for you: > x <- read.table(textConnection(" j x + 1 1 0.795373270 + 2 1 0.326845207 + 3 1 0.049116967 + 4 1 0.673830996 + 5 2 0.411789618 + 6 2 0.628034020 + 7 2 0.413997203 + 8 2 0.704016624 + 9 3 0.135268136 + 10 3 0.597653294 + 11 3 0.682791760

Re: [R] help with function filter

2008-06-09 Thread jim holtman
I think you can get the median with: filter(MATDINAMIC$VELOCIDADFIN[1:1000],c(0, 1, 0)) On Mon, Jun 9, 2008 at 5:08 PM, wilquin Minaya <[EMAIL PROTECTED]> wrote: > > Hi everybody > > I need to create a program using the function filter with this vector. > MATDINAMIC$VELOCIDADFIN[1:1000] >

[R] substitute() reading data instead of name

2008-06-09 Thread Carl Witthoft
I seem to have run across a bug in which substitute() inside a function definition gets 'confused.' The code is listed below. The same behavior occurs under OSX 10.3.9, PPC, w/ R2.2 and Rgui 1.14 and under OSX 10.4.11 Intel w/ 2.70 and the latest Rgui. What I see is that 'xlab' properly has the

Re: [R] converting a data set to a format for time series analysis

2008-06-09 Thread jim holtman
Here is one way of doing it: > x <- read.table(textConnection("subject hospitaldate_enrollment hospital_beds + 1 hospitalA 1/3/2002300 + 2 hospitalA 1/6/2002300 + 3 hospitalB 2/4/2002150 + 4 hospitalC 3/2/2002

Re: [R] converting a data set to a format for time series analysis

2008-06-09 Thread jim holtman
This should do it: > x <- read.table(textConnection("subject hospitaldate_enrollment hospital_beds + 1 hospitalA 1/3/2002300 + 2 hospitalA 1/6/2002300 + 3 hospitalB 2/4/2002150 + 4 hospitalC 3/2/2002200"),

Re: [R] nonlinear fitting on many voxels

2008-06-09 Thread Charles C. Berry
On Mon, 9 Jun 2008, Ayman Oweida wrote: Below is a sample code using random generated numbers that represents what I'm trying to do. I ran it a few times until I got the same error.  I hope this can help in defining where I'm going wrong.  The first item under 'Technical Details' in the

Re: [R] substitute() reading data instead of name

2008-06-09 Thread Steven McKinney
Hi Carl, This is happening because of 'lazy evaluation'. Arguments to a function are not evaluated until they are needed. Thus the xlab and ylab deparsing is not happening until you pass them off to the plot() function. By this time you have altered y inside your function. If you comment out

Re: [R] Comparing two groups of proportions

2008-06-09 Thread Greg Snow
here is one approach: res <- cbind( c(10, 5, 1, 12, 3, 8, 7, 2, 10, 1), c(90,15,79,38,7,92,13,78,40,9) ) line <- gl(5,1,length=10, labels=LETTERS[1:5]) qa <- gl(2,5) fit <- glm( res ~ line*qa, family=binomial ) summary(fit) anova(fit, test='Chisq') The interaction terms measure the differe

Re: [R] Comparing two groups of proportions

2008-06-09 Thread Rolf Turner
Your approach tacitly assumes --- as did the poster's question --- that the probability of passing an item by one method is *independent* of whether it is passed by the other method. Which makes the methods effectively independent of the nature of the item being assessed! Not much actual qualit

Re: [R] Comparing two groups of proportions

2008-06-09 Thread Greg Snow
You're right, I did not read close enough and thought that there were 2 seperate groups from each production line, not the same group and based the analysis on that. With the same items being tested with both methods the information on the individual items should be included (either as a fixed

Re: [R] Comparing two groups of proportions

2008-06-09 Thread Ivan Adzhubey
Hi Rolf, On Monday 09 June 2008 11:16:57 pm Rolf Turner wrote: > Your approach tacitly assumes --- as did the poster's question --- that > the probability of passing an item by one method is *independent* of > whether it is passed by the other method. Which makes the methods > effectively indepen

Re: [R] Systemfit (was RE: How to force two regression coefficients to be equal but opposite in sign?)

2008-06-09 Thread Arne Henningsen
Hi Keith! On Monday 09 June 2008 16:27, Woolner, Keith wrote: > [...] > After I sent my initial message, I came across the Systemfit package, > which allows specification of constraints on parameters. In theory, > this should solve my problem perfectly. However, I was not able to get > it to wor

Re: [R] substitute() reading data instead of name

2008-06-09 Thread Peter Dalgaard
Steven McKinney wrote: You can either put code such as these first two lines to grab the names of x and y before you alter x and y in your function badplot <- function(x, y, ylab, xlab, ...) { if (missing(ylab)) ylab <- deparse(substitute(y)) if (missing(xlab)) xlab <- deparse(substitute(x)