[R] Multiple xyplots

2007-09-05 Thread Tom Wright
wondering how to create multiple plotting areas. I have come accross references to a package grid (which doesn't seem to be in my CRAN mirror probability.ca) and lattice but I'm not sure if I'm on the correct lines. Any advice gratefully received. Thanks Tom -- --Tom Wright

Re: [R] X11 device

2006-05-31 Thread tom wright
Marius, Not quite what your asking but try ?bitmap. This can create png images without requiring X On Wed, 2006-31-05 at 20:55 +0200, Marius Hofert wrote: Hi, I am working with R on a Mac Powerbook G4. As described a couple of days ago, I would like to create an animation consisting of -

[R] understanding DWT

2006-05-25 Thread tom wright
Can someone please help me understand the examples given in the dwt function of the waveslim library library(waveslim) ?dwt I'm having a problem understanding these lines. I assume they are required because of how the algorythm deals with the signal bounderies. Am I correct in thinking that for

Re: [R] Newbie to R: would like to solve a problem

2006-05-12 Thread tom wright
I often use R to create graphs for my web applications which are normally developed in PHP. I use the PHP command exec to shell out to the R script, passing any parameters on the command line. The params are then available in R using the commandArgs function. How to get the data back is another

[R] problems with optimize (again)

2006-05-10 Thread tom wright
Can someone please explain what the $minimum result of the optimize function actually is? I'm trying to optimize the function: fitIT-function(ampFac,ts_wave1,ts_template){ template-stretchWaveTime(ts_template,ampFac) fit-calcFit(ts_wave1,template) return(fit) } with

[R] matrix indexing

2006-03-15 Thread tom wright
Can someone please give me a pointer here. I have two matrices matA A B C 1 5 2 4 2 2 4 3 3 1 2 4 matB A B C 1 TRUEFALSE TRUE 2 FALSE TRUETRUE 3 FALSE FALSE FALSE how

Re: [R] matrix indexing

2006-03-15 Thread tom wright
Thanks everyone. Obvious when you think about it, and you check that both the matrices your trying it with are actually matrices... instead of one being a list. On Wed, 2006-15-03 at 06:03 -0500, tom wright wrote: Can someone please give me a pointer here. I have two matrices matA

[R] help with optimize statement

2006-02-24 Thread tom wright
Can some help me spot what I'm doing wrong here. I have two equations, one a michalis-menton eqn and one a straight line. I need to work out where they cross. I created the function: solveEqn-function(x,vals){ Vmax-vals[1] Ks-vals[2] m-vals[3] c-vals[4] diff-0 mmVal-exp(Vmax+x/(Ks+x))

[R] exponent confusion

2006-02-22 Thread tom wright
please excuse me if this ones a basic error y-c(-0.7,-0.6,-0.5) -0.7^1.22 [1] -0.6471718 y^1.22 [1] NaN NaN NaN am I missing something important in my basic math? __ R-help@stat.math.ethz.ch mailing list

Re: [R] New user: Custom probability distribution

2006-02-09 Thread tom wright
rbinom(50,5,c(0.48,0.24,0.16,0.12)) On Thu, 2006-09-02 at 20:02 +0100, Jan Danielsson wrote: Hello, Given a probability function: p(x) = 12 / (25(x+1)) , x=0, 1, 2, 3 we generate the following values: C1 C2 0 0.48 1 0.24 2 0.16 3 0.12 Now, I'm supposed to

[R] all.equal() and which()

2006-02-03 Thread tom wright
Please excuse the lack of a complete dataset here, if its needed I'll be happy to provide it. Can anyone show me how to rewrite this? Browse[1] time(data)[24210:24220] [1] 24.209 24.210 24.211 24.212 24.213 24.214 24.215 24.216 24.217 [10] 24.218 24.219 Browse[1] which(time(data)==24.211)

Re: [R] For each element in vector do...

2006-01-17 Thread tom wright
a-c(0,1,2,3,0,4,5) b-vector(length=length(a)) b[a0]-a[a0]+1 b[a=0]-a[a=0] b [1] 0 2 3 4 0 5 6 On Tue, 2006-17-01 at 15:30 +0100, Andrej Kastrin wrote: Dear R useRs, I have a vector with positive and negative numbers: A=c(0,1,2,3,0,4,5) Now if i-th element in vector A is 0, then

[R] data aquistion cards

2006-01-10 Thread tom wright
Another year another project. Does anyone have any experience / pointers in obtaining data from an analog / digital converter hardware such as a National Instruments data aquisition card using R? I really need to obtain and process this data in a real time enviroment and I'm hoping that R already

[R] data collection with R

2006-01-10 Thread tom wright
Another year another project. Does anyone have any experience / pointers in obtaining data from an analog / digital converter hardware such as a National Instruments data aquisition card using R? I really need to obtain and process this data in a real time enviroment and I'm hoping that R already

[R] use of tapply?

2005-12-29 Thread tom wright
I'm still learning how to program with R and I was hoping someone could take the time to show me how I can rewrite this code? Many thanks Tom data.intersects-data.frame( x=c(0.230,0.411,0.477,0.241,0.552,0.230), y=c(0.119,0.515,0.261,0.431,0.304,0.389), angle=vector(length=6),

Re: [R] HTML search Firefox

2005-12-09 Thread tom wright
I have a similar problem here: /tmp/RtmpgRyAdm/.R/doc/manual/R-exts.html the folder structure exists just no files in it. There are subfolders with files and symlinks in so I doubt its a permissions problem. R.Version() $platform [1] x86_64-pc-linux-gnu $arch [1] x86_64 $os [1] linux-gnu

Re: [R] reg peak detection

2005-12-09 Thread tom wright
Having missed last months thread I reinvented the wheel. I thought I'd post my code here for fun and feedback. getDerivation-function(v_dataset){ #setup a vector to hold derivations v_deriv-vector(length=length(v_dataset)-1) for(iLoc in 2:length(v_dataset)){

[R] scoping issues?

2005-12-08 Thread tom wright
Can anyone please help me understand whats happening here? Thanks Tom getAmpRatio-function(v_amps){ #calculates the amplitude ratios between the 3 largest amps and the rest bigamp-0 map-rep(TRUE,length(v_amps)) for(iLoc in 1:3){ bigamp-bigamp+max(v_amps)

Re: [R] scoping issues?

2005-12-08 Thread tom wright
Thanks for the answers, yup the missing c() was what was throwing me. And thanks Barry for the slighly more elegant code, I'm a bit post christmas party here and not thinking as straight as I should be. On Thu, 2005-08-12 at 06:47 -0500, tom wright wrote: Can anyone please help me understand

Re: [R] plot and factors

2005-12-06 Thread tom wright
Your first question seems relatively simple: data.fall-subset(data,semester=='fall') data.spring-subset(data,semester=='spring') data.summer-subset(data,semester=='summer') plot(x=year,y=value1,data=data.fall) lines(x=year,y=value1,data=data.spring) lines(x=year,y=value1,data=data.summer) As

Re: [R] cant get colAUC to plot

2005-12-01 Thread tom wright
curve for one set simply by duplicating the data. On Thu, 2005-01-12 at 08:35 +0100, Uwe Ligges wrote: tom wright wrote: Can someone please explain why this wont plot. The cats example given for the colAUC function will plot. Please report bugs in packages to the package maintainer rather

[R] OT: Statistics question

2005-11-30 Thread tom wright
I apologise for asking this question here but I am hoping that someone can either give me direct guidance and/or point me to a better group for this type of disucssion. I have what I feel should be a fairly simple problem but which my limited stats knowledge can't answer. I have two overlapping

[R] cant get colAUC to plot

2005-11-30 Thread tom wright
Can someone please explain why this wont plot. The cats example given for the colAUC function will plot. Many thanks again tom # library(caTools) a-rnorm(100) b-rbinom(100,1,0.7) colAUC(a,b,plotROC=TRUE) colAUC(a,b,plotROC=TRUE) Error in strwidth(legend, units = user,

Re: [R] TryCatch() with read.csv(http://...)

2005-11-23 Thread tom wright
How are you trying to break the loop? The next statement should move to the next in the sequence (from the Introduction To R manual) On Wed, 2005-23-11 at 11:57 -0500, David L. Van Brunt, Ph.D. wrote: Hi, folks! I'm trying to pull in data using read.csv(my URL goes here), and it really works

Re: [R] help on list

2005-11-23 Thread tom wright
the dwt function returns an object with 'slots' dwt$d1 dwt$d2 ... which contain the partial wave coefficients and dwt$s1 which contains the leftover factors Please excuse my terminology here, I know what I'm talking about.. On Wed, 2005-23-11 at 16:11 +0100, both jean-pierre wrote: Hi, New

Re: [R] graphing help

2005-11-22 Thread tom wright
a-c(1:10) plot(a,ylim=c(10,1)) On Tue, 2005-22-11 at 15:03 -0500, Anthony Pitts wrote: Hello all, Does anyone know how to make R graph the x-axis in descending order? I am all set in creating a vertical bar chart using either the plot or the xychart (in lattice), but I need the x-axis in

Re: [R] PNG-import into R

2005-11-21 Thread tom wright
Hi, I dont think you can import PNG images into R directly (although I may be wrong). I use ImageMagick (available for most operating systems) and the system() function to do my image conversions. convertImage-function(dirname,srcname,targetname){

Re: [R] Warning message help

2005-11-21 Thread tom wright
Shouldnt that be effort[Gear==300]-(DIST_TOW*7412) I think we're going to need to see some sample datasets to tell you any more. On Mon, 2005-21-11 at 10:44 -0500, Guenther, Cameron wrote: I am trying to great a new column of effort data from an existing vector of gears used. It is a simple

Re: [R] Image display in R

2005-11-18 Thread tom wright
This peice of very useful getcell() function was posted for me on this list by Duncan Murdoch (Thanks again Duncan). It allows the identification of a particular plot in a matrix of plots. All you need to do then is use this information to identify the original plot which you can then re-plot.

[R] RODBC and Very long field lengths

2005-11-16 Thread tom wright
I'm having a small problem using RODBC. I'm trying to retrieve a string from a very long memo field (512*20*9=9360 characters = 74880 bytes) in an MSAccess database. It appears that RODBC set a maximum buffer size for a single column of 65535 bytes. ## cut from RODBC.c ##

[R] strsplit

2005-11-15 Thread tom wright
I'm stuck on what I feel should be a minor problem. I have a dataseries obtained from a MS Access database that consists of a series of numbers seperated by carridge returns (\r) Currently this data is in R as mode numeric??? I want to separate this into a vector of the componant numbers. Perhaps

Re: [R] strsplit

2005-11-15 Thread tom wright
On Tue, 2005-15-11 at 18:03 +0100, Peter Dalgaard wrote: tom wright [EMAIL PROTECTED] writes: I'm stuck on what I feel should be a minor problem. I have a dataseries obtained from a MS Access database that consists of a series of numbers seperated by carridge returns (\r) Currently

Re: [R] changing the value of a variable from inside a function

2005-11-15 Thread tom wright
Michael, I feel sure people are going to come up with other better suggestions here but does - work for you? test - matrix(NA,nrow=4,ncol=3) test[1,] - c(1,2,3) blah - function(i){ test[i,] - c(0,1,2) + i return(test) } On Tue, 2005-15-11 at 12:22 -0500, Michael Wolosin wrote: test -

Re: [R] strsplit

2005-11-15 Thread tom wright
: tom wright [EMAIL PROTECTED] writes: I'm stuck on what I feel should be a minor problem. I have a dataseries obtained from a MS Access database that consists of a series of numbers seperated by carridge returns (\r) Currently this data is in R as mode numeric??? I want to separate

[R] Subtracting timeseries objects

2005-11-15 Thread tom wright
Sorry to keep posting but I want to do this right and I'm hoping for some pointers I now have two time series objects which I need to subtract. Unfortunatly the two series dont have the same sample rates. When I try to subtract them avgSub-avg1-avg2 The time series object is clever enough to

[R] curve fitting question

2005-11-11 Thread tom wright
I'd appreciate some direction here. I have a model for a system with two independant variables (i1,i2) and one dependant variable (d). I have experimental data recorded at multiple levels of the dependant variable (x). I need to work out the values for the independant variables that best fit the

[R] problem in waveslim library?

2005-11-04 Thread tom wright
This code consistenly segfaults for me. Can someone please take a look and tell me if the problem is due to something I am doing or is there a problems with the dwt (idwt) functions in the waveslim library. Thanks tom library(waveslim)

Re: [R] RODBC error

2005-11-02 Thread tom wright
On Wed, 2005-02-11 at 07:55 +1000, Evan Sergeant wrote: Hi, I hope that someone can help me with the following problem with RODBC connection to a MySQL database I am running R version 2.2.0 on windows XP, and have the MySQL database registered in Windows ODBC. I have set up a web

[R] tree widget question

2005-10-27 Thread tom wright
I'm trying to create an app using TclTk and R Can someone please explain how I bind a click event to the tree widget (http://bioinf.wehi.edu.au/~wettenhall/RTclTkExamples/TreeWidget.html) Ideally I'd like to bind to particular elements in the tree but tkbind doesnt seem to work. thanks tom

[R] locator

2005-10-21 Thread tom wright
I'm trying to use the locator function on a drawing area with multiple graphs par(mfrow=c(1,2)) Is it possible to identify which graph has been clicked? thanks tom __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] locator

2005-10-21 Thread tom wright
Perfect, thankyou On Fri, 2005-21-10 at 15:46 -0400, Duncan Murdoch wrote: On 10/21/2005 11:23 AM, tom wright wrote: I'm trying to use the locator function on a drawing area with multiple graphs par(mfrow=c(1,2)) Is it possible to identify which graph has been clicked? locator

Re: [R] Filter design in R?

2005-10-20 Thread tom wright
On Wed, 2005-19-10 at 17:49 -0400, Israel Christie wrote: Dr. Williams, I ran across your inquiry on one of the R-help mailing lists regarding digital filter design and implementation. I found no response to your email in the archives and was wondering if you were able to find anything.

Re: [R] Getting eps into Word documents.

2005-10-03 Thread tom wright
On Mon, 2005-03-10 at 16:31 -0300, Rolf Turner wrote: A student in one of my courses has asked me about getting R graphics output (under Linux) into a Word document. I.e. she wants to do her R thing under Linux, but then do her word processing using Word. Scanning around the r-help archives

[R] dynamic lists (data frames?)

2005-09-27 Thread tom wright
Can someone please show me what I need to get something like this to work for(a in c(1:5)){ data$a-c(a:10) } so that i end up with a structure data$1-[1,2,3,4,5,6,7,8,9,10] data$2-[2,3,4,5,67,8,9,10] data$3-[3,4,5,67,8,9,10] data$4-[4,5,67,8,9,10] data$5-[5,67,8,9,10] thanks loads Tom

Re: [R] dynamic lists (data frames?)

2005-09-27 Thread tom wright
is there a more generic method for adding another column of data? On Tue, 2005-27-09 at 10:39 -0400, tom wright wrote: Can someone please show me what I need to get something like this to work for(a in c(1:5)){ data$a-c(a:10) } so that i end up with a structure data$1

Re: [R] dynamic lists (data frames?)

2005-09-27 Thread tom wright
='') l_cooef[[str_idx]]-list() l_cooef[[str_idx]]-v_dataset[c((length(v_dataset)/2)+1:(length(v_dataset)/2))] v_dataset-v_dataset[c(1:length(v_dataset)/2)] i_count-i_count+1 } l_cooef } On Tue, 2005-27-09 at 10:39 -0400, tom wright wrote: Can someone please show

Re: [R] waveform filtering

2005-09-20 Thread tom wright
On Mon, 2005-19-09 at 10:36 -0400, tom wright wrote: I'm not an engineer so I hope I'm using the correct terminology here. I have a recorded waveform that I want to apply low and high pass filters too, are tehre already R functions existing to do this or am I going to have to program my own

[R] waveform filtering

2005-09-19 Thread tom wright
I'm not an engineer so I hope I'm using the correct terminology here. I have a recorded waveform that I want to apply low and high pass filters too, are tehre already R functions existing to do this or am I going to have to program my own? thanks for any pointers tom

[R] newbie question

2005-09-15 Thread tom wright
Can someone tell me how I create a vector of numbers where the step isn't 1? i.e. x-(0.0,0.5,1.0,1.5) Thanks tom __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide!

Re: [R] interpolation function

2005-08-05 Thread tom wright
On Fri, 2005-05-08 at 12:12 +, 吴 昊 wrote: Hi, I have a sparse matrix.I want to fill values into the entries whose value is 0.The new generated values should come from the interpolation of the values have existed.Does R provide such interpolation functions which operate on Matrix, for

[R] use of NA's

2005-08-05 Thread tom wright
Can someone please explain why this works: d-c(0,2,3,2,0,3,4,0,0,0,0,0) d.mat-matrix(data=d,nrow=4,ncol=3,byrow=TRUE) for(i in 1:length(d.mat[1,])){ + d.mat[,i][d.mat[,i]==0]-mean(d.mat[,i][d.mat[,i]0]) + } Whereas: d-c(0,2,3,2,0,3,4,0,0,0,0,0)

[R] problem with an IF statement?

2005-07-28 Thread tom wright
Can somebody please take a look at this and tell me whats going wrong? It seems to be parsing wronly around the 'if' statement and gives me a directory listing. Thanks in advance Tom N.B. datan is an invented dataset xvals-c(1,0.4,0.2)