Re: [R] Partial Derivatives in R

2009-05-12 Thread spencerg
Hi, Paul: Your example is so complicated that I don't want to take the time to check it. You apply deriv to an exponential divided by a sum of exponentials, and I'm not convinced that your manual Correct way is actually correct. It looks like you've followed the examples in the

Re: [R] Add data count to plot?

2009-05-12 Thread Tal Galili
Hi Mike. In the plotting you do, there are usually parameters in the function you use to help you add text to the plot. for example: par(mfrow = c(2, 2)) plot(x, sub = text in the bottom, main = text in top, ylab = text to the side of the axis, xlab = text to the bottom of the axis) plot(y) # this

[R] (no subject)

2009-05-12 Thread Kon Knafelman
Hi, I have a question about derivatives of functions. if i have the following function, f - function(x) x^3-2*x^2+3*x-5 i need a simple function for the derivative of this with respect to 'x', so that i can then sub in values to the the derivative function, and use Newtons method of finding

[R] decimal troubles ?

2009-05-12 Thread Patrick Giraudoux
Dear all, I have some trouble with the number of decimals in R (currently R 2.9.0). For instance: options()$digits [1] 3 let me hope that I will get three digits where useful when a number is printed. BUT: 44.25+31.1+50 [1] 125 No way to get the right result 125.35 Can anybody tell me

[R] lattice histogram for multiple variables : adjusting x axis

2009-05-12 Thread GOUACHE David
Hello all, I have a large data frame and I want to look at the distribution of each variable very quickly by plotting an individual histogram for each variable. I'd like to do so using lattice. Here is a small example using the iris data set:

Re: [R] decimal troubles ?

2009-05-12 Thread Dieter Menne
Patrick Giraudoux wrote: I have some trouble with the number of decimals in R (currently R 2.9.0). For instance: options()$digits [1] 3 let me hope that I will get three digits where useful when a number is printed. BUT: 44.25+31.1+50 [1] 125 No way to get the right

Re: [R] decimal troubles ?

2009-05-12 Thread Peter Alspach
Tena koe Patrick If you want more than three digits, change the options: options(digits=7) 44.25+31.1+50 [1] 125.35 HTH Peter Alspach -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Patrick Giraudoux Sent: Tuesday, 12

Re: [R] How to display data content on a only row?

2009-05-12 Thread Dieter Menne
Thom_249 wrote: I have data like this: [1] 16.800 6.533 5.067 3.933 2.200 1.667 [7] 1.200 1.067 0.733 0.667 And I want that all these data, printed on a 4 rows instead of 8, and it's be great without the [x] First look would be

Re: [R] (no subject)

2009-05-12 Thread Dieter Menne
Kon Knafelman wrote: if i have the following function, f - function(x) x^3-2*x^2+3*x-5 i need a simple function for the derivative of this with respect to 'x', so that i can then sub in values to the the derivative function, and use Newtons method of finding a root for this.

[R] how the break is calculated by R?

2009-05-12 Thread XinMeng
Hi all: As to hist,the help file says: R's default with equi-spaced breaks (also the default) is to plot the counts in the cells defined by breaks. I wanna know how the break is calculated by R? In other words: break = (max - min)/(number of group) but how the number of group is calculated

[R] Bayes newby

2009-05-12 Thread Daniele Amberti
* * * I have to setup a simple classification method (mix of factor and numeric variables) that can iteratively: -  Use expert opinion prior on item X1 -  Classify X1 based on estimated model (training set) and expert opinion (previous requirement) -   

Re: [R] times family unavailable in postscript device (Ubuntu Linux)

2009-05-12 Thread Paul Murrell
Hi This happens because of the way PostScript files are generated, with all metadata in the head of the file, including font information. So you need to predeclare any fonts that you are going to use in a PostScript file. In this case, something like ... postscript(fonts=Times) ... or if

Re: [R] Plotting colors on a world map

2009-05-12 Thread dxc13
So, this would allow me to assign a color to each of the 2592 rectangular grid cells on a map of the world? I guess I am having trouble finding a suitable method of doing this. Also, to be able to distinguish country boundaries from the grid lines (which are both black color), could the grid

[R] How to display data content on a only row?

2009-05-12 Thread Thom_249
Hi I'm sorry for my so basic question, but it's so basic that I can't find anwser anywhere... I have data like this: [1] 16.800 6.533 5.067 3.933 2.200 1.667 [7] 1.200 1.067 0.733 0.667 [1] 35.6113946 6.9576953 4.5271667 2.3744674

[R] extracting residuals from glm object

2009-05-12 Thread utkarshsinghal
Hi All, Can anybody explain why the following three ways of extracting residuals from a glm object are giving me different outputs: idv = runif(1000,0,1) dv = rbinom(1000,1,0.5) d = data.frame(idv,dv) fit = glm(dv~idv, data=d, family=binomial) head(residuals(fit)) 1 2

[R] newtons method

2009-05-12 Thread Kon Knafelman
Hi, Does anyone know how to code newton's method for finding the roots of polynomial functions? im not sure whether i need to do this manually, or just code something with a loop to stop when it gets to the desired result thanks guys!

Re: [R] decimal troubles ?

2009-05-12 Thread Dieter Menne
Dieter Menne wrote: It says digits, not decimals: (44.25+31.1+50)/100 [1] 1.25 Dieter (44.25+31.1+50)*10 [1] 1254 Strictly speaking, this should print as 1250 (no flames, please, I can live with it) Dieter -- View this message in context:

Re: [R] decimal troubles ?

2009-05-12 Thread Richard . Cotton
I have some trouble with the number of decimals in R (currently R 2.9.0). For instance: options()$digits [1] 3 let me hope that I will get three digits where useful when a number is printed. BUT: 44.25+31.1+50 [1] 125 No way to get the right result 125.35 Can anybody tell

Re: [R] Problems to run SVM regression with e1071

2009-05-12 Thread marlene marchena
Hi, Is the variable st character or a factor? What does str(train$st) show? str(train$st) Factor w/ 208 levels 0,000,0,0058643,..: 132 134 41 29 42 151 195 195 196 207 ... Thank you very much Max with your help I found my error, now it works. Marlene.

Re: [R] (no subject)

2009-05-12 Thread Richard . Cotton
if i have the following function, f - function(x) x^3-2*x^2+3*x-5 i need a simple function for the derivative of this with respect to 'x', so that i can then sub in values to the the derivative function, and use Newtons method of finding a root for this. You could take a look at

Re: [R] lattice histogram for multiple variables : adjusting x axis

2009-05-12 Thread Richard . Cotton
I have a large data frame and I want to look at the distribution of each variable very quickly by plotting an individual histogram for each variable. I'd like to do so using lattice. Here is a small example using the iris data set:

Re: [R] decimal troubles ?

2009-05-12 Thread Patrick Giraudoux
Shame on me... I confused digits and decimals Thanks anyway to make me come to the English basics... Patrick Peter Alspach a écrit : Tena koe Patrick If you want more than three digits, change the options: options(digits=7) 44.25+31.1+50 [1] 125.35 HTH Peter Alspach

Re: [R] how the break is calculated by R?

2009-05-12 Thread Richard . Cotton
As to hist,the help file says: R's default with equi-spaced breaks (also the default) is to plot the counts in the cells defined by breaks. I wanna know how the break is calculated by R? In other words: break = (max - min)/(number of group) but how the number of group is calculated by

Re: [R] newtons method

2009-05-12 Thread Uwe Ligges
Kon Knafelman wrote: Hi, Does anyone know how to code newton's method for finding the roots of polynomial functions? im not sure whether i need to do this manually, or just code something with a loop to stop when it gets to the desired result See ?optim for optimization methods. Uwe

[R] ROCR: auc and logarithm plot

2009-05-12 Thread Tim
Hi, I am quite new to R and I have two questions regarding ROCR. 1. I have tried to understand how to extract area-under-curve value by looking at the ROCR document and googling. Still I am not sure if I am doing the right thing. Here is my code, is auc1 the auc value? pred1 -

[R] Kumaraswamy distribution

2009-05-12 Thread Debbie Zhang
Dear R users, Does anyone know how to write function for Kumaraswamy distribution in R? Since I cannot write dkumar, pkumar, etc. in R. Please help. Thanks a lot, Debbie _ [[elided Hotmail spam]] [[alternative

Re: [R] inconsistent results for axis.POSIXct

2009-05-12 Thread Uwe Ligges
I can reproduce it. Can you please send a bug report to R-bugs so that this won't get lost. Thank you, Uwe Ligges Dan Kelley wrote: Some time ago, I posted a note about what I considered to be a bug in axis.POSIXt() for R 2.8.x, relating to whether timezones in the data are obeyed on the

[R] how often we use the libraries/packages in R

2009-05-12 Thread Marta Rufino
Dear list members, I am trying to make a clean up on my computer (windows problems, off course), and I wanted to remove some libraries that I have installed in R, which have been hardly used. Is there any way to see how often each library is used by us? I have many that I am not sure...

Re: [R] Read many .csv files into an R session automatically, without specifying filenames

2009-05-12 Thread Wacek Kusnierczyk
Romain Francois wrote: Hi, Something like this perhaps: files - dir( pattern = \\.csv$ ) for( x in files){ assign( sub( \\.csv$, , x ) , read.csv(x), envir = .GlobalEnv ) } or maybe csvs = Map(read.csv, dir(pattern='\\.csv$')) possibly with a correction of list item names

Re: [R] ROCR: auc and logarithm plot

2009-05-12 Thread Tobias Sing
1. I have tried to understand how to extract area-under-curve value by looking at the ROCR document and googling. Still I am not sure if I am doing the right thing. Here is my code, is auc1 the auc value? pred1 - prediction(resp1,label1) perf1 - performance(pred1,tpr,fpr) plot( perf1,

Re: [R] working with groups of labels?

2009-05-12 Thread Jim Lemon
Phillip Porter wrote: At 9:25 PM +1000 5/11/09, Jim Lemon wrote: Hi Phillip, I'm not exactly sure how you are positioning the labels. Is it possible to give us an example with some data that will produce a plot to show what you want? It shouldn't be too hard to do. Jim Data is something

Re: [R] how often we use the libraries/packages in R

2009-05-12 Thread Uwe Ligges
Marta Rufino wrote: Dear list members, I am trying to make a clean up on my computer (windows problems, off course), and I wanted to remove some libraries that I have installed in R, which have been hardly used. Is there any way to see how often each library is used by us? No, unless you

Re: [R] Plotting colors on a world map

2009-05-12 Thread Jim Lemon
dxc13 wrote: Hi useR's I have created a simple map of the world using the following code: m - map(xlim=c(-180,180), ylim=c(-90,90)) map.axes() I then create a grid of dimension 36x72 using the code: map.grid(m, nx=72, ny=36, labels=FALSE, col=black) This gives 2592 grid cells. In a separate

[R] What's the best way to tell a function about relevant fields in data frames

2009-05-12 Thread Titus von der Malsburg
Hi list, I have a function that detects saccadic eye movements in a time series of eye positions sampled at a rate of 250Hz. This function needs three vectors: x-coordinate, y-coordinate, trial-id. This information is usually contained in a data frame that also has some other fields. The names

Re: [R] What's the best way to tell a function about relevant fields in data frames

2009-05-12 Thread Zeljko Vrba
On Tue, May 12, 2009 at 12:18:59PM +0200, Titus von der Malsburg wrote: Is there a canonical way to tell a function which fields in a data frame are relevant? What other alternatives are possible? What are the pros and cons of the alternatives? Why not simply rearrange your data frames to

Re: [R] What's the best way to tell a function about relevant fields in data frames

2009-05-12 Thread Gabor Grothendieck
You could define a generic detect(obj, ...) that dispatches (using S3): detect.formula(fo, data) detect.data.frame(data) detect.default(x, y, trial) where the first two call the third thereby modeling it on lm, a common approach, and giving the user choice in interface. On Tue, May 12, 2009 at

Re: [R] What's the best way to tell a function about relevant fields in data frames

2009-05-12 Thread Titus von der Malsburg
Hi Zeljko, thanks for your suggestion! On Tue, May 12, 2009 at 12:26:48PM +0200, Zeljko Vrba wrote: Why not simply rearrange your data frames to have standardized column names (see names() function), and write functions that operate on the standardized format? Actually that's what I'm

Re: [R] What's the best way to tell a function about relevant fields in data frames

2009-05-12 Thread Duncan Murdoch
On 12/05/2009 6:18 AM, Titus von der Malsburg wrote: Hi list, I have a function that detects saccadic eye movements in a time series of eye positions sampled at a rate of 250Hz. This function needs three vectors: x-coordinate, y-coordinate, trial-id. This information is usually contained in a

[R] xyplot: no ticks for a factor scale?

2009-05-12 Thread Marcin Kozak
Hi, I would like to have no ticks on a scale that represents a factor. The tick.number argument from scales does not work in such a situation, as the help page as well as this simple (fairly stupid) code show: require(lattice) fact-gl(4,1,labels=LETTERS[1:4]) y-c(1,4,3,2)

Re: [R] Kumaraswamy distribution

2009-05-12 Thread G. Jay Kerns
Dear Debbie, On Tue, May 12, 2009 at 5:37 AM, Debbie Zhang debbie0...@hotmail.com wrote: Dear R users, Does anyone know how to write function for Kumaraswamy distribution in R? Since I cannot write dkumar, pkumar, etc. in R. Please help. Thanks a lot, Debbie Check the CRAN Task

Re: [R] Kumaraswamy distribution

2009-05-12 Thread Mike Lawrence
dkumar = function(x,a,b) a*b*(x^(a-1))*((1-x^a)^(b-1)) pkumar = function(x,a,b) 1-(1-x^a)^b (I've based this entirely on the wikipedia entry on the Kumaraswamy distribution [http://en.wikipedia.org/wiki/Kumaraswamy_distribution], so best to check both my replication of the formula there and the

[R] From two colors to 01 sequences

2009-05-12 Thread Paul Smith
Dear All, Perhaps, what I am asking is impossible, but I am asking it anyway. I have got several pdf files with rows of colored rectangles: red rectangles should be read as 0; green rectangles as 1. No other color exists. Is there some way to have R reading the colored rectangles to a matrix or

Re: [R] Partial Derivatives in R

2009-05-12 Thread Gabor Grothendieck
You could also use rSymPy to symbolically differentiate it. For example, based on the semi-automatic differentiation example on the rSymPy home page: http://code.google.com/p/rsympy/#Semi-Automatic_Differentiation just replace the indented lines there with the indented lines here (I've also

Re: [R] xyplot: no ticks for a factor scale?

2009-05-12 Thread Richard . Cotton
I would like to have no ticks on a scale that represents a factor. The tick.number argument from scales does not work in such a situation, as the help page as well as this simple (fairly stupid) code show: require(lattice) fact-gl(4,1,labels=LETTERS[1:4]) y-c(1,4,3,2)

Re: [R] From two colors to 01 sequences

2009-05-12 Thread Zeljko Vrba
On Tue, May 12, 2009 at 12:20:56PM +0100, Paul Smith wrote: I have got several pdf files with rows of colored rectangles: red rectangles should be read as 0; green rectangles as 1. No other color exists. Is there some way to have R reading the colored rectangles to a matrix or data frame

Re: [R] ROCR: auc and logarithm plot

2009-05-12 Thread Tim
Thanks Tobias! A new question: if I want to draw an average ROC from cross-validation, how to make the bar color same as the line color? Here is my code: plot( perf2,avg=threshold,lty=2,col=2, spread.estimate=stddev,barcol=2) Even I specify barcol=2, the color of bars are still black, the

[R] Power function for ratio of lognormal means: two equally valid results? [SEC=Unclassified]

2009-05-12 Thread Steve Candy
Hi All This is a general stats problem that I am dealing with using R, so any help is greater appreciated. I have two lognormal distributions with means M1 and M2. If we have: H0: log(M1/M2)=0 H1: log(M1/M2) !=0 equivalent to log(M1/M2)=log(1+P) where P0 or P0. If we calculate the power for

Re: [R] extracting residuals from glm object

2009-05-12 Thread Marc Schwartz
On May 12, 2009, at 3:50 AM, utkarshsinghal wrote: Hi All, Can anybody explain why the following three ways of extracting residuals from a glm object are giving me different outputs: idv = runif(1000,0,1) dv = rbinom(1000,1,0.5) d = data.frame(idv,dv) fit = glm(dv~idv, data=d,

Re: [R] ROCR: auc and logarithm plot

2009-05-12 Thread Tobias Sing
To color the error bars in ROCR the same way as the performance curve, you need to add one more argument (plotCI.col='red') to your plot call: plot( perf2,avg=threshold,lty=2,col=2, spread.estimate=stddev, plotCI.col=2) The use of 'plotCI.col' is an example for the general mechanism of ROCR to

Re: [R] From two colors to 01 sequences

2009-05-12 Thread baptiste auguie
Depending on the nature of your pdf file, it may be possible to use the grImport package. I've never used it before, but a quick test seems promising, # create a test picture colorStrip - function (colors, draw = T) { x - seq(0, 1 - 1/ncol(colors), length = ncol(colors)) y -

[R] SAS PROC SORT nodupkey

2009-05-12 Thread amor Gandhi
Hi,   I have the following data and I would like to delete douple names, it is almost similar to SAS PROC SORT nodupkey! Is there any function in R does this?   x1 - rnorm(11,5,1) x2 - runif(11,0,1) nam -paste(A, c(1:4,4,5:9,9), sep=.) mydata - data.frame(x1,x2) crownames(mydata) - nam   Many

Re: [R] How to display data content on a only row?

2009-05-12 Thread Dieter Menne
Thom_249 wrote: I got them from a Matrix on with I use the applyfunction tu compute the mean columns by columns print(apply(matSD,2,mean)) matSD = matrix(round(rnorm(20),2),nrow=4) cat(matSD) print(matSD) dput(matSD) # How to send this matrix to r-help newMat = apply(matSD,2,mean)

[R] Response surface plot

2009-05-12 Thread Tim Carnus
Dear List, I am trying to plot a similar graph to attached from minitab manual in R. I have a response Y and three components which systematically vary in their proportions. I have found in R methods/packages to plot ternary plots (eg. plotrix) but nothing which can extend it to response

Re: [R] From two colors to 01 sequences

2009-05-12 Thread Paul Smith
Thanks, Baptiste and Zeljko. I am attaching here an example of the picture of the rectangles. Paul On Tue, May 12, 2009 at 1:23 PM, baptiste auguie ba...@exeter.ac.uk wrote: Depending on the nature of your pdf file, it may be possible to use the grImport package. I've never used it before,

[R] Response surface plot

2009-05-12 Thread Tim Carnus
Dear List, I am trying to plot a similar graph to attached from minitab manual in R. I have a response Y and three components which systematically vary in their proportions. I have found in R methods/packages to plot ternary plots (eg. plotrix) but nothing which can extend it to

Re: [R] survival curves for time dependent covariates (was consultation)

2009-05-12 Thread Terry Therneau
*I´m writing to ask you how can I do Survivals Curves using Time-dependent *covariates? Which packages I need to Install?* This is a very difficult problem statistically. That is, there are not many good ideas for what SHOULD be done. Hence, there are no packages. Almost everything you find

[R] plotCI line types for line and for bar

2009-05-12 Thread lehe
Hi, I was wondering how to specify the line type for line instead of for bar. Here is my code: plotCI(x=mcra1avg, uiw=stdev1, type=l,col=2,lty=2) This way, I will have the bar line as dashed lty=2 and red col=2, and the line connecting the centers of the bars is also red col=2 but solid lty=1.

Re: [R] SAS PROC SORT nodupkey

2009-05-12 Thread Chuck Cleland
On 5/12/2009 8:29 AM, amor Gandhi wrote: Hi, I have the following data and I would like to delete douple names, it is almost similar to SAS PROC SORT nodupkey! Is there any function in R does this? x1 - rnorm(11,5,1) x2 - runif(11,0,1) nam -paste(A, c(1:4,4,5:9,9), sep=.) mydata -

Re: [R] newtons method

2009-05-12 Thread John C Nash
Finding polynomial roots is not a problem where one wants a quick and dirty code. There are a lot of pitfalls, especially if there are roots that are multiples, and there has been a lot of work on this problem. See http://en.wikipedia.org/wiki/Category:Root-finding_algorithms . And Uwe may

Re: [R] Warning trying to plot -log(log(survival)) (John Sorkin)

2009-05-12 Thread Terry Therneau
John, Nothing about the data set you posted should give issues in any version of the package. The points =0 usually arises when the survival curve drops to zero, and so log(-log(0)) is being trimmed off the graph by the plot command. This is what should happen. As Thomas pointed out to

[R] RES: SAS PROC SORT nodupkey

2009-05-12 Thread Leandro Marino
Amor, You have the possibility to use the duplicated() function. A[!duplicated(A[,var]),] Atenciosamente, Leandro Lins Marino Centro de Avaliação Fundação CESGRANRIO Rua Santa Alexandrina, 1011 - 2º andar Rio de Janeiro, RJ - CEP: 20261-903 R (21) 2103-9600 R.:236 ( (21) 8777-7907 (

Re: [R] Power function for ratio of lognormal means: two equally

2009-05-12 Thread Ted Harding
On 12-May-09 12:00:50, Steve Candy wrote: Hi All This is a general stats problem that I am dealing with using R, so any help is greater appreciated. I have two lognormal distributions with means M1 and M2. If we have: H0: log(M1/M2)=0 H1: log(M1/M2) !=0 equivalent to

Re: [R] newtons method

2009-05-12 Thread Uwe Ligges
John C Nash wrote: Finding polynomial roots is not a problem where one wants a quick and dirty code. There are a lot of pitfalls, especially if there are roots that are multiples, and there has been a lot of work on this problem. See

[R] R^2 extraction and autocorrelation/heterokedasticity on TSLS regression

2009-05-12 Thread Axel Leroix
Hi,   I'm actually I’m performing a TSLS linear multiple regression on annually data which go from 1971 to 1997. After performing the TSLS regression, I tried to extract the R squared value using “output$r.squared” function and to perform autocorrelation (Durbin Watson and

[R] import HTML tables

2009-05-12 Thread Dimitri Szerman
Hello, I was wondering if there is a function in R that imports tables directly from a HTML document. I know there are functions (say, getURL() from {RCurl} ) that download the entire page source, but here I refer to something like google document's function importHTML() (if you don't know this

[R] neural network not using all observations

2009-05-12 Thread jude.ryan
I am exploring neural networks (adding non-linearities) to see if I can get more predictive power than a linear regression model I built. I am using the function nnet and following the example of Venables and Ripley, in Modern Applied Statistics with S, on pages 246 to 249. I have standardized

[R] R Group on Professional Networking Site

2009-05-12 Thread Ajit de Silva
Greetings: There is a LinkedIn R Group. There are job postings, news, as well as other discussions. http://www.linkedin.com/groups?about=gid=77616trk=anet_ug_grppro Regards, Ajit -- _ Ajit Gemunu de Silva Oakland CA 94619 skype: ajit_de_silva

Re: [R] Response surface plot

2009-05-12 Thread Duncan Murdoch
On 5/12/2009 8:43 AM, Tim Carnus wrote: Dear List, I am trying to plot a similar graph to attached from minitab manual in R. I have a response Y and three components which systematically vary in their proportions. I have found in R methods/packages to plot ternary plots (eg.

[R] R Group on Professional Networking Site

2009-05-12 Thread agdesilva
Greetings: There is a LinkedIn R Group. There are job postings, news, as well as other discussions. http://www.linkedin.com/groups?about=gid=77616trk=anet_ug_grppro Regards, Ajit http://www.linkedin.com/groups?about=gid=77616trk=anet_ug_grppro

[R] Trouble with parametric bootstrap

2009-05-12 Thread Anders Bjorn
Hi, I'm having trouble understanding how to construct a random number generator for a parametric bootstrap. My aim is to bootstrap a Likelihood Ratio statistic (under the null) for a linear model. The function at this point is given by boot.test.n01 - function(data, indeces, maxit=20) { y1 -

[R] AFT-model with time-dependent covariates

2009-05-12 Thread Philipp Rappold
Dear R-community, Dear Prof. Therneau, I would like to fit an AFT-model with time-dependent covariates and right-censored data. Searching the mailing list for information on the subject, I found some old posts which said it didn't work back then. My questions: (1) Has this kind of fitting

Re: [R] newtons method

2009-05-12 Thread Ravi Varadhan
Uwe, John's comment about the difficulties with finding polynomial roots is even more forceful for a system of polynomials. There are likely numerous roots, some possibly real, and some possibly multiple. Homotopy methods are currrently the state-of-art for finding all the roots, but beware

[R] variability

2009-05-12 Thread elisia
I am analyzing the voice telephone traffic of some operators. In this type of phenomenon is useful to consider the anomalies in the duration in minutes of conversation but it is very important to take account of another variable: average time of conversation, the relationship between the duration

[R] Fw: Hold out procedures in R software

2009-05-12 Thread Oludare Ariyo
I am a PhD Student at the University of Agriculture,Abeokuta Nigeria.Also a Statistician at National Horticultural Research institites ibadan Nigeria. I currently working on Discriniant analysis and i need a help on hoe to solve Lanche Bruch's hold out Procedure using R .

[R] Two-way Anova

2009-05-12 Thread Alan O'Loughlin
Hello, I'm trying to do a comparsion on a large scale say 10L bottle of liquid and a small scale bottle of liquid 0.5L, I have 5 different samples from each and they are measured over the space of 8 days as % viability and the % viability decreases over time. However not all 10 samples got

[R] rbind help

2009-05-12 Thread MikSmith
Hi I have a dataset of orientation and elevation in a dataframe which I am plotting in circular. Orientation is on the range 0-360, however I need to reduce this to 0-180 as the values over 180 are not necessarily correct. I can do striae$orientation[striae$orientation180]-180) to extract

Re: [R] How to display data content on a only row?

2009-05-12 Thread Thom_249
Totally awsom! Thank you very much Thom -- View this message in context: http://www.nabble.com/How-to-display-data-content-on-a-only-row--tp23497437p23502952.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org

Re: [R] Partial Derivatives in R

2009-05-12 Thread Paul Heinrich Dietrich
Thanks for showing me how to use genD correctly and that it matches deriv here. Like you say, there must be a problem with the manual way of doing it, and I will look at it closely. Thanks again. spencerg wrote: Hi, Paul: Your example is so complicated that I don't want to take

[R] Graphic aspect ratio

2009-05-12 Thread MikSmith
Hi I've been playing with a 3x2 graphics device using the default size as it appears on screen. This has given me tall thin plots which I can resize by dragging the window and increasing the window width. However I was wondering if I can force R to produce square plots or set the actual aspect

[R] questions on rpart (tree changes when rearrange the order of covariates?!)

2009-05-12 Thread Yuanyuan
Greetings, I am using rpart for classification with class method. The test data is the Indian diabetes data from package mlbench. I fitted a classification tree firstly using the original data, and then exchanged the order of Body mass and Plasma glucose which are the strongest/important

[R] how to take away the same varible when I use merge

2009-05-12 Thread Xin Shi
Dear: I am trying to merge two tables by a common variable. However, there are a few same variables which are in both of two tables. How can I take them away when I merge the two tables? Thanks! Xin __ R-help@r-project.org mailing

Re: [R] How to display data content on a only row?

2009-05-12 Thread Thom_249
Hello Dieter I got them from a Matrix on with I use the applyfunction tu compute the mean columns by columns print(apply(matSD,2,mean)) So it's a kind of vector. I'll check with the cat function Thank you, have a nice day Thomas -- View this message in context:

[R] triangle.class pch per factor

2009-05-12 Thread HighSchool2005
Hello, I am using triangle.class in ade4 package and a factor. I would like to use this graphic parameter (pch) to set a different kind of point for each group in my factor (lakes). I have tried pch=1:4, I guess it does what it is supposed to do but not what I want. I can't use colors. Thank

[R] Using loops to run functions over a list of variables

2009-05-12 Thread rapton
Hello, I have a data set with many variables, and often I want to run a given function, like summary() or cor() or lmer() etc. on many combinations of one or more than one of these variables. For every combination of variables I want to analyze I have been writing out the code by hand, but

Re: [R] rbind help

2009-05-12 Thread James W. MacDonald
Hi Mike, MikSmith wrote: Hi I have a dataset of orientation and elevation in a dataframe which I am plotting in circular. Orientation is on the range 0-360, however I need to reduce this to 0-180 as the values over 180 are not necessarily correct. I can do

[R] pair matching

2009-05-12 Thread Thomas S. Dye
Given two numeric vectors of possibly unequal length, I'd like to pair each element of the shorter vector with an element of the longer vector such that the sum of squared differences between the pairs is minimized. Can someone point me to an R function or an algorithm for accomplishing

[R] Multiple plot margins

2009-05-12 Thread Andre Nathan
Hello I'm plotting 6 graphs using mfrow = c(2, 3). In these plots, only graphs in the first column have titles for the y axis, and only the ones in the last row have titles for the x axis. I'd like all plots to be of the same size, and I'm trying to keep them as near each other as possible, but

Re: [R] Using loops to run functions over a list of variables

2009-05-12 Thread Jun Shen
I don't think get(factor[i]) will work. The problem is get only sees a character string data$focus instead of doing extracting focus from data. In your case isn't lapply (or sapply) good enough? sapply (data, summary) try ?lapply for details Jun On Tue, May 12, 2009 at 10:55 AM, rapton

Re: [R] Using loops to run functions over a list of variables

2009-05-12 Thread Jun Shen
Forgot one thing, make sure your data is a list or data frame. On Tue, May 12, 2009 at 12:19 PM, Jun Shen jun.shen...@gmail.com wrote: I don't think get(factor[i]) will work. The problem is get only sees a character string data$focus instead of doing extracting focus from data. In your case

[R] FW: neural network not using all observations

2009-05-12 Thread jude.ryan
As a follow-up to my email below: The input data frame to nnet() has dimensions: dim(coreaff.trn.nn) [1] 50888 And the predictions from the neural network (35 records are dropped - see email below for more details) has dimensions: pred - predict(coreaff.nn1) dim(pred) [1]

Re: [R] Looking for a quick way to combine rows in a matrix

2009-05-12 Thread Johannes Hüsing
jim holtman schrieb: Try this: key - rownames(a) key[key == AT] - TA do.call(rbind, by(a, key, colSums)) something like paste(sort(strsplit(key, split=)[[1]]), ) might be more general. __ R-help@r-project.org mailing list

Re: [R] Two-way Anova

2009-05-12 Thread Mike Lawrence
Using traditional ANOVA, you'd have to drop either cases or time points with missing data. Using linear mixed effects analysis, you'd be able to use all the data. LME also has the benefit of *not* assuming sphericity, which is good for data like yours (many measures across few cases) where the

Re: [R] pair matching

2009-05-12 Thread Liaw, Andy
If the matching need not be one-to-one, then you can just compute the Euclidean distances between the two vectors, then in each row (or column, which ever corresponds to the shorter vector) and find the smallest. This should be fairly easy to do. Andy From: Thomas S. Dye Given two numeric

Re: [R] Fwd: From two colors to 01 sequences

2009-05-12 Thread Paul Smith
On Tue, May 12, 2009 at 2:35 PM, Zeljko Vrba zv...@ifi.uio.no wrote: Aha, so you DON'T have only red and green rectangles in the picture, there is also white in between, and some pale delimiter lines.  Nevertheless, both things ease the job slightly, and the approach I described should work.  

Re: [R] Using loops to run functions over a list of variables

2009-05-12 Thread Matt Killingsworth
Jun, sapply() does the trick! Thank you Jun! I really appreciate your help. -Matt On Tue, May 12, 2009 at 1:20 PM, Jun Shen jun.shen...@gmail.com wrote: Forgot one thing, make sure your data is a list or data frame. On Tue, May 12, 2009 at 12:19 PM, Jun Shen jun.shen...@gmail.com wrote:

[R] selecting points on 3D scatterplots

2009-05-12 Thread Abby Drake
Hello Everyone, I am new to R and need some help. I have a matrix of x,y,z coordinates that I would like to interactively plot in 3D and then using the cursor select points on the plot and have the coordinates sent to a matrix. I am using the rgl package to plot the data at the moment because it

Re: [R] Sweave: Howto write real TeX formula in plot

2009-05-12 Thread Jonas Stein
Thank you, Baptiste and Charlie. I found some examples wich look great on: http://www.texample.net/tikz/examples/ Perhaps try the pgfSweave package on r-forge? http://r-forge.r-project.org/projects/pgfsweave/ [..] accomplished using the java utility eps2pgf and requires the PGF/TiKZ

Re: [R] selecting points on 3D scatterplots

2009-05-12 Thread Duncan Murdoch
On 5/12/2009 3:08 PM, Abby Drake wrote: Hello Everyone, I am new to R and need some help. I have a matrix of x,y,z coordinates that I would like to interactively plot in 3D and then using the cursor select points on the plot and have the coordinates sent to a matrix. I am using the rgl package

[R] How do I extract the scoring equations for neural networks and support vector machines?

2009-05-12 Thread jude.ryan
Sorry for these multiple postings. I solved the problem using na.omit() to drop records with missing values for the time being. I will worry about imputation, etc. later. I calculated the sum of squared errors for 3 models, linear regression, neural networks, and support vector machines. This

[R] Help needed to compile R with shared library.

2009-05-12 Thread Tena Sakai
Hi, I cannot compile R with shared library. I am using Redhad Linux on Dell hardware. Here''s what I am doing: I set ?PICFLAGS in config.site file: CPICFLAGS=-fPIC FPICFLAGS=-fPIC and issue: ./configure --enable-R-shlib --prefix=$HOME/newR make configure finishes with no complaints, the

  1   2   >