Re: [R] split strings

2009-05-27 Thread Allan Engelhardt
Immaterial, yes, but it is always good to test :) and your solution *is* faster and it is even faster if you can assume byte strings: strings = sprintf('f:/foo/bar//%s.tif', replicate(1000, paste(sample(letters, 10), collapse=''))) library(rbenchmark) benchmark(columns=c('test',

Re: [R] Discovery on packages

2009-05-27 Thread Martin Maechler
PS == Phil Spector spec...@stat.berkeley.edu on Tue, 26 May 2009 09:25:26 -0700 (PDT) writes: PS Janna - PS Another thing that's sometimes useful with a new package PS is to run the example function, like PS example(TTR) PS This will run the examples from the

Re: [R] Linear Regression with Constraints

2009-05-27 Thread Emmanuel Charpentier
Le mardi 26 mai 2009 à 14:11 -0400, Stu @ AGS a écrit : Hi! I am a bit new to R. I am looking for the right function to use for a multiple regression problem of the form: y = c1 + x1 + (c2 * x2) - (c3 * x3) Where c1, c2, and c3 are the desired regression coefficients that are subject to

Re: [R] Linear Regression with Constraints

2009-05-27 Thread Bill.Venables
You can accommodate the constraints by, e.g., putting c2 = pnorm(theta2) c3 = pnorm(theta3) x1 has a known coefficient (unity) so it becomes an offset. Essentially your problem can be written y1 = y-x1 = c1 + pnorm(theta2)*x2 - pnorm(theta3)*x3 + error This is then a (pretty simple)

Re: [R] Harmonic Analysis

2009-05-27 Thread Dieter Menne
mauede at alice.it writes: I am looking for a package to perform harmonic analysis with the goal of estimating the period of the dominant high frequency component in some mono-channel signals. You should widen your scope by looking a time series instead of harmonic analysis. There is a

Re: [R] using lsoda() and nls() together

2009-05-27 Thread Dieter Menne
bbouling wrote: Thanks to Dieter Menne and Spencer Graves I started to get my way through lsoda() Now I need to use it in with nls() to assess parameters I have a go with a basic example dy/dt = K1*conc I try to assess the value of K1 from a simulated data set with a K1 close to

Re: [R] Using package exams and xtable

2009-05-27 Thread Dieter Menne
M Berg wrote: str(rx) num [1:16] 21 9 8 18 4 12 17 2 9 7 ... I want to print out the entire vector as part of the problem. When I use \Sexpr(rx) only the first value (in this case 21) is printed out. rx = 1:10 rxs = paste(rx,collapse=, ) So \Sexpr{paste(rx,collapse=, )} should

Re: [R] split strings

2009-05-27 Thread Wacek Kusnierczyk
Allan Engelhardt wrote: Immaterial, yes, but it is always good to test :) and your solution *is* faster and it is even faster if you can assume byte strings: :) indeed; though if the speed is immaterial (and in this case it supposedly was), it's probably not worth risking fixed=TRUE removing

[R] Neural Network resource

2009-05-27 Thread Indrajit Sengupta
Hi All, I am trying to learn Neural Networks. I found that R has packages which can help build Neural Nets - the popular one being AMORE package. Is there any book / resource available which guides us in this subject using the AMORE package? Any help will be much appreciated. Thanks,

[R] C4.5 implementation in R

2009-05-27 Thread Lazy Tiger
Greetings, Does anyone know if the C4.5 algorithm is already implemented in R? If yes, please let me know the package. Thanks. -- View this message in context: http://www.nabble.com/C4.5-implementation-in-R-tp23736785p23736785.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] Using package exams and xtable

2009-05-27 Thread David Hajage
Hello, \Sexpr only displays one value. Why don't you print your vector into a verbatim environment ? echo=F,results=verbatim print(rx) @ But if you want to generate a table with xtable, one solution : echo=F,results=tex print(xtable(as.data.frame(t(rx))), include.rownames = F,

Re: [R] C4.5 implementation in R

2009-05-27 Thread Tony Breyal
I think Rweka implements the C4.5 (revision 8) algorithm, but it calls it J4.8 (because it's written in Java instead of C, and also the revision number, and is uses an open source licence, i think). You might want to look at this paper by Schauerhuber, Zeileis Hornik called 'Benchmarking

Re: [R] interactive file choosing in Linux?

2009-05-27 Thread Juergen Rose
Am Dienstag, den 26.05.2009, 21:05 +0200 schrieb Romain Francois: Hi, You might like tk_choose.files from package tcltk. This comes with R but your system needs to be capable enough: capabilities( )[tcktk] require( tcltk ) tk_choose.files I suppose it should be capabilities(

[R] Constrained fits: y~a+b*x-c*x^2, with a,b,c =0

2009-05-27 Thread Alex van der Spek
I wonder whether R has methods for constrained fitting of linear models. I am trying fm-lm(y~x+I(x^2), data=dat) which most of the time gives indeed the coefficients of an inverted parabola. I know in advance that it has to be an inverted parabola with the maximum constrained to positive (or

Re: [R] Still can't find missing data

2009-05-27 Thread Dieter Menne
Farley, Robert FarleyR at metro.net writes: What is wrong? I've looked into the na commands and the ?xtabs entry, but I haven't found anything that works. I never understood the logic that exclude=NULL needs na.action in addition. test - c(1,2,3,1,2,3,NA,NA,1,2,3)

[R] Intra-observer reliability

2009-05-27 Thread Shreyasee
Hi, I searched a lot on the internet but was unable to find the function for calculating the kappa statistics for intra-observer reliabilty. Can anybody help me in the this regards. Thanks, Shreyasee [[alternative HTML version deleted]] __

[R] r-plot

2009-05-27 Thread durden10
Dear R-community I have a grueling problem which appears to be impossible to solve: I want to make a simple plot, here is my code: http://gist.github.com/118550 Unfortunately, the annotation of both the x- and y-axis are not correct, as you can see in the following picture:

[R] Multivariate Transformations

2009-05-27 Thread Hollix
Hello folks, many multivariate anayses (e.g., structural equation modeling) require multivariate normal distributions. Real data, however, most often significantly depart from the multinormal distribution. Some researchers (e.g., Yuan et al., 2000) have proposed a multivariate transformation of

Re: [R] Neural Network resource

2009-05-27 Thread Tony Breyal
There's a link on the CRAN page for the AMORE package which apears to have some cool information: http://wiki.r-project.org/rwiki/doku.php?id=packages:cran:amore Seems like an interesting package, I hadn't actually heard of it before your post. HTH, Tony On 27 May, 09:13, Indrajit Sengupta

Re: [R] Constrained fits: y~a+b*x-c*x^2, with a,b,c =0

2009-05-27 Thread Berwin A Turlach
G'day Alex, On Wed, 27 May 2009 11:51:39 +0200 Alex van der Spek am...@xs4all.nl wrote: I wonder whether R has methods for constrained fitting of linear models. I am trying fm-lm(y~x+I(x^2), data=dat) which most of the time gives indeed the coefficients of an inverted parabola. I know in

[R] Multiple ANOVA tests

2009-05-27 Thread Imri
Hi all - I'm trying to do multiple one-way ANOVA tests of different factors on the same variable. As a result I have a list with all the ANOVA tables, for exemple: $X11_20502 Analysis of Variance Table Response: MPH Df Sum Sq Mean Sq F valuePr(F) x 3 369.9

[R] How to write a loop?

2009-05-27 Thread Maithili Shiva
Dear R helpers,   Following is a R script I am using to run the Fast Fourier Transform. The csv files has 10 columns with titles m1, m2, m3 .m10.     When I use the following commands, I am getting the required results. The probelm is if there are 100 columns, it is not wise to define 100

[R] How to exclude a column by name?

2009-05-27 Thread Zeljko Vrba
Given an arbitrary data frame, it is easy to exclude a column given its index: df[,-2]. How to do the same thing given the column name? A naive attempt df[,-name] did not work :) __ R-help@r-project.org mailing list

Re: [R] How to write a loop?

2009-05-27 Thread Linlin Yan
Why did you use different variable names rather than index of list/data.frame? On Wed, May 27, 2009 at 6:34 PM, Maithili Shiva maithili_sh...@yahoo.com wrote: Dear R helpers, Following is a R script I am using to run the Fast Fourier Transform. The csv files has 10 columns with titles m1,

Re: [R] How to exclude a column by name?

2009-05-27 Thread Linlin Yan
Hope this helps: df - data.frame(matrix(1:10,2)) df X1 X2 X3 X4 X5 1 1 3 5 7 9 2 2 4 6 8 10 df[,-2] X1 X3 X4 X5 1 1 5 7 9 2 2 6 8 10 df[,-which(names(df)==X2)] X1 X3 X4 X5 1 1 5 7 9 2 2 6 8 10 On Wed, May 27, 2009 at 6:37 PM, Zeljko Vrba zv...@ifi.uio.no wrote:

Re: [R] How to exclude a column by name?

2009-05-27 Thread Paul Hiemstra
Zeljko Vrba wrote: Given an arbitrary data frame, it is easy to exclude a column given its index: df[,-2]. How to do the same thing given the column name? A naive attempt df[,-name] did not work :) __ R-help@r-project.org mailing list

Re: [R] How to exclude a column by name?

2009-05-27 Thread Zeljko Vrba
On Wed, May 27, 2009 at 12:52:41PM +0200, Paul Hiemstra wrote: This piece of code does the trick. Most important is the which() command: df = data.frame(a = runif(10), b = runif(10)) df[,-which(names(df) == a)] Thanks to you and Linlin. It did not occur to me to use which(); I thought

Re: [R] How to exclude a column by name?

2009-05-27 Thread Peter Dalgaard
Paul Hiemstra wrote: Zeljko Vrba wrote: Given an arbitrary data frame, it is easy to exclude a column given its index: df[,-2]. How to do the same thing given the column name? A naive attempt df[,-name] did not work :) __ R-help@r-project.org

Re: [R] Multiple ANOVA tests

2009-05-27 Thread Mike Lawrence
#create some data y=rnorm(20) x=factor(rep(c('A','B'),each=10)) #run the anova my_aov = aov(y~x) #summarize the anova my_aov_summary = summary(my_aov) #show the anova summary print(my_aov_summary) #lets see what's in the summary object str(my_aov_summary) #looks like it's a list with 1

Re: [R] r-plot

2009-05-27 Thread Gavin Simpson
On Wed, 2009-05-27 at 02:52 -0700, durden10 wrote: Dear R-community I have a grueling problem which appears to be impossible to solve: I want to make a simple plot, here is my code: http://gist.github.com/118550 Unfortunately, the annotation of both the x- and y-axis are not correct, as you

Re: [R] Intra-observer reliability

2009-05-27 Thread Gavin Simpson
On Wed, 2009-05-27 at 18:08 +0800, Shreyasee wrote: Hi, I searched a lot on the internet but was unable to find the function for calculating the kappa statistics for intra-observer reliabilty. Can anybody help me in the this regards. See classAgreement() in package e1071 for example. There

Re: [R] Intra-observer reliability

2009-05-27 Thread Jim Lemon
Shreyasee wrote: Hi, I searched a lot on the internet but was unable to find the function for calculating the kappa statistics for intra-observer reliabilty. Can anybody help me in the this regards. Hi Shreyasee, Thanks for reminding me that I had promised to rewrite Tore Wentzel-Larsen's

Re: [R] Intra-observer reliability

2009-05-27 Thread Shreyasee
Thanks a lot On Wed, May 27, 2009 at 7:47 PM, Gavin Simpson gavin.simp...@ucl.ac.ukwrote: On Wed, 2009-05-27 at 18:08 +0800, Shreyasee wrote: Hi, I searched a lot on the internet but was unable to find the function for calculating the kappa statistics for intra-observer reliabilty.

[R] file.move?

2009-05-27 Thread Stefan Uhmann
Dear list, I want to move some files that should keep their time stamps, which is not the case if I use file.copy in combination with file.remove. file.move would be nice, is there a package providing such a function? Regards, Stefan __

Re: [R] Intra-observer reliability

2009-05-27 Thread Shreyasee
Thanks a lot On Wed, May 27, 2009 at 7:55 PM, Jim Lemon j...@bitwrit.com.au wrote: Shreyasee wrote: Hi, I searched a lot on the internet but was unable to find the function for calculating the kappa statistics for intra-observer reliabilty. Can anybody help me in the this regards. Hi

Re: [R] Constrained fits: y~a+b*x-c*x^2, with a,b,c =0

2009-05-27 Thread Liaw, Andy
There's also the nnls (non-negative least squares) package on CRAN that might be useful, although I'm puzzled by the negative sign in front of c in Alex post... Cheers, Andy From: Berwin A Turlach G'day Alex, On Wed, 27 May 2009 11:51:39 +0200 Alex van der Spek am...@xs4all.nl wrote:

Re: [R] How to exclude a column by name?

2009-05-27 Thread Henrique Dallazuanna
You can try this: DF[,columnName] - NULL On Wed, May 27, 2009 at 7:37 AM, Zeljko Vrba zv...@ifi.uio.no wrote: Given an arbitrary data frame, it is easy to exclude a column given its index: df[,-2]. How to do the same thing given the column name? A naive attempt df[,-name] did not work :)

Re: [R] r-plot

2009-05-27 Thread Richard . Cotton
I want to make a simple plot, here is my code: http://gist.github.com/118550 Unfortunately, the annotation of both the x- and y-axis are not correct, as you can see in the following picture: http://www.nabble.com/file/p23739356/plot.png I am not an expert of R, so maybe someone can point

Re: [R] Harmonic Analysis

2009-05-27 Thread Uwe Ligges
Dieter Menne wrote: mauede at alice.it writes: I am looking for a package to perform harmonic analysis with the goal of estimating the period of the dominant high frequency component in some mono-channel signals. You should widen your scope by looking a time series instead of harmonic

[R] Problem with adding labels in ggplot2

2009-05-27 Thread Zeljko Vrba
I apologize for not pasting a complete example, but the data-set is too large, so I hope someone can help me just by description of symptoms. I define a generic plot object name (note the missing y=.. in aes()) to plot different y-values against the same set of x-values. p.b4.generic.wg -

[R] Full likelihood from survreg

2009-05-27 Thread Ullrika Sahlin
R users, I am making model selection with an accelerated failure time model using the command survreg within the library survival. As I want to compare models with different probability distributions I need to have the full likelihood. How can I find out what survreg generates: the

Re: [R] Multiple ANOVA tests

2009-05-27 Thread Imri
Thanks for the answer!!! I Know how to extract the Pr(F) value from single ANOVA table, but I have a list of many ANOVA tables recived by : a-function(x)(aov(MPH~x)) q-apply(assoc[,18:20],2,a) # just for example, I have more than 3 factors(x) print(q) $X11_20502 Df Sum Sq Mean Sq

Re: [R] Problem with adding labels in ggplot2

2009-05-27 Thread Zeljko Vrba
On Wed, May 27, 2009 at 01:40:52PM +0200, Zeljko Vrba wrote: I apologize for not pasting a complete example, but the data-set is too large, so I hope someone can help me just by description of symptoms. -snip- I have solved the problem by introducing an artificial variable in the original

Re: [R] split strings

2009-05-27 Thread Monica Pisica
Hi, Luckily for me - until now i did not have too many times to do these type of parsing - but who knows??? Up to now i was pretty happy with strsplit .Anyway - thanks again for all the help, i really appreciate it. Monica From:

Re: [R] moving from Windows to Linux - need help

2009-05-27 Thread Millo Giovanni
Dear Robert, a different option, just to give you one more choice: you should be able to keep the standard Xandros and install R if you don't feel like changing the operating system. You just have to add the standard Debian repositories. I found it easier to have R, Emacs and LaTeX working on the

Re: [R] Multivariate Transformations

2009-05-27 Thread stephen sefick
It depends on what you are after. I am by no means a wunderkind when it comes to transformation, but in the package vegan type ?wisconsin and that should give you a start, but if you know what transformations you would like to preform then apply should do what you need with whatever

Re: [R] C4.5 implementation in R

2009-05-27 Thread Lazy Tiger
Thanks Tony. I will look into it. Tony Breyal wrote: I think Rweka implements the C4.5 (revision 8) algorithm, but it calls it J4.8 (because it's written in Java instead of C, and also the revision number, and is uses an open source licence, i think). You might want to look at this

[R] Sort matrix by column 1 ascending then by column 2 decending

2009-05-27 Thread Paul Geeleher
I've got a matrix with 2 columns and n rows. I need to sort it first by the values in column 1 ascending. Then for values which are the same in column 1, sort by column 2 decending. For example: 2 .5 1 .3 1 .5 3 .2 Goes to: 1 .5 1 .3 2 .5 3 .2 This is easy to do in spreadsheet programs but I

[R] Warning message as a result of logistic regression performed

2009-05-27 Thread Winter, Katherine
I am sorry if this question sounds basic but I am having trouble understanding a warning message I have been receiving in R after attempting logistic regression. I have been using the logistic regression function in R to analyse a simulated data set. The dependent variable failure has an

Re: [R] r-plot

2009-05-27 Thread Jim Lemon
durden10 wrote: Dear R-community I have a grueling problem which appears to be impossible to solve: I want to make a simple plot, here is my code: http://gist.github.com/118550 Unfortunately, the annotation of both the x- and y-axis are not correct, as you can see in the following picture:

Re: [R] Multiple ANOVA tests

2009-05-27 Thread Mike Lawrence
you could use ldply from the plyr package: p = ldply(q,function(x){x$P}) Without you data I can't confirm that works, but something like that should do it On Wed, May 27, 2009 at 9:23 AM, Imri bisr...@agri.huji.ac.il wrote: Thanks for the answer!!! I Know how to extract the Pr(F) value from

Re: [R] Harmonic Analysis

2009-05-27 Thread stephen sefick
why will a fourier transform not work? 2009/5/27 Uwe Ligges lig...@statistik.tu-dortmund.de: Dieter Menne wrote:  mauede at alice.it writes: I am looking for a package to perform harmonic analysis with the goal of estimating the period of the dominant high frequency component in some

Re: [R] Sort matrix by column 1 ascending then by column 2 decending

2009-05-27 Thread Henrique Dallazuanna
Try this: cbind(sort(x[,1]), unlist(tapply(x[,2], x[,1], sort, decreasing = T))) On Wed, May 27, 2009 at 9:39 AM, Paul Geeleher paulgeele...@gmail.comwrote: I've got a matrix with 2 columns and n rows. I need to sort it first by the values in column 1 ascending. Then for values which are the

[R] Hierarchical glm with binomial family

2009-05-27 Thread Johan Stenberg
Dear members of the R help list, I want to do a hierarchical glm with binomial family but am unsure about how to write the syntax which involves nesting. I want to test whether the risk of being attacked by Herbivores for Meadowsweet plants is significantly dependent on the Distance to

Re: [R] optim() question

2009-05-27 Thread John C Nash
Some thought about this overnight led to conclusion that a capability to follow from one method to another could be quite useful. Moreover, it should be pretty easy to fit it into our current trial version of optimx() as we call the function. More at UseR. JN Ravi Varadhan wrote: Stephen,

Re: [R] Harmonic Analysis

2009-05-27 Thread Gerard M. Keogh
My thoughts exactly. ?FFT should do the job. And define the dominant term - a_n**2 + b_n**2 - the Parseval Relation. stephen sefick

Re: [R] How to write a loop?

2009-05-27 Thread Andrew Dolman
Try lapply(ONS, fft) and take a look here http://cran.r-project.org/doc/manuals/R-intro.html for the basics of data structures in R and how to apply functions to them. Andy. andydol...@gmail.com 2009/5/27 Linlin Yan yanlinli...@gmail.com Why did you use different variable names rather

Re: [R] file.move?

2009-05-27 Thread Prof Brian Ripley
Are you looking for file.rename? Moving files is not really a portable concept, and nor is 'time stamps' (files usually have three or more times associated with them, and moving does not keep them all in OSes that implement it). On Wed, 27 May 2009, Stefan Uhmann wrote: Dear list, I want

Re: [R] Sort matrix by column 1 ascending then by column 2 decending

2009-05-27 Thread Paul Geeleher
Nice. Works perfectly. On Wed, May 27, 2009 at 2:03 PM, Henrique Dallazuanna www...@gmail.com wrote: Try this: cbind(sort(x[,1]), unlist(tapply(x[,2], x[,1], sort, decreasing = T))) On Wed, May 27, 2009 at 9:39 AM, Paul Geeleher paulgeele...@gmail.com wrote: I've got a matrix with 2

[R] Defining functions - an interesting problem

2009-05-27 Thread utkarshsinghal
I define the following function: (Please don't wonder about the use of this function, this is just a simplified version of my actual function. And please don't spend your time in finding an alternate way of doing the same as the following does not exactly represent my function. I am only

Re: [R] Hierarchical glm with binomial family

2009-05-27 Thread Ben Bolker
Johan Stenberg-2 wrote: Dear members of the R help list, I want to do a hierarchical glm with binomial family but am unsure about how to write the syntax which involves nesting. I want to test whether the risk of being attacked by Herbivores for Meadowsweet plants is significantly

Re: [R] Warning message as a result of logistic regression performed

2009-05-27 Thread Gavin Simpson
Try reading this thread: http://thread.gmane.org/gmane.comp.lang.r.general/134368/focus=134475 especially the posts by I Kosmidis which show you how to diagnose problems in logit model fits like this. There is a statement about this warning in ?glm as well and a pointer to a reference which

Re: [R] Multivariate Transformations

2009-05-27 Thread Gavin Simpson
On Wed, 2009-05-27 at 08:39 -0400, stephen sefick wrote: It depends on what you are after. I am by no means a wunderkind when it comes to transformation, but in the package vegan type ?wisconsin and that should give you a start, but if you know what transformations you would like to preform

Re: [R] How to exclude a column by name?

2009-05-27 Thread Stavros Macrakis
On Wed, May 27, 2009 at 6:37 AM, Zeljko Vrba zv...@ifi.uio.no wrote: Given an arbitrary data frame, it is easy to exclude a column given its index: df[,-2]. How to do the same thing given the column name? A naive attempt df[,-name] did not work :) Various ways: Boolean index vector:

Re: [R] Neural Network resource

2009-05-27 Thread Indrajit Sengupta
You are right there is a pdf file which describes the function. But let tell you where I am coming from. Just to test if a neural network will work better than a ordinary least square regression, I created a dataset with one dependent variable and 6 other independent variables. Now I had

Re: [R] Defining functions - an interesting problem

2009-05-27 Thread Thomas Lumley
On Wed, 27 May 2009, utkarshsinghal wrote: I define the following function: (Please don't wonder about the use of this function, this is just a simplified version of my actual function. And please don't spend your time in finding an alternate way of doing the same as the following does not

Re: [R] Defining functions - an interesting problem

2009-05-27 Thread Gavin Simpson
On Wed, 2009-05-27 at 19:41 +0530, utkarshsinghal wrote: I define the following function: (Please don't wonder about the use of this function, this is just a simplified version of my actual function. And please don't spend your time in finding an alternate way of doing the same as the

Re: [R] Defining functions - an interesting problem

2009-05-27 Thread utkarshsinghal
Yeah, seems so obvious now. What a blunder, poor me. Perfect explanation. Thanks Thomas Lumley wrote: On Wed, 27 May 2009, utkarshsinghal wrote: I define the following function: (Please don't wonder about the use of this function, this is just a simplified version of my actual function. And

[R] R in Ubunto

2009-05-27 Thread R Heberto Ghezzo, Dr
Hello , I do not know anything abount Ubunto, but I found a Portable Ubunto for Windows and since so many people prefer Linux to Windows I decided to give it a try. It runs very nicely, so I tried to load R, following Instructions in CRAN I added the line deb

[R] vegan metaMDS question

2009-05-27 Thread stephen sefick
The design decision in metaMDS says that it uses: Minchin, P.R. (1987) An evaluation of relative robustness of techniques for ecological ordinations. Vegetatio 71, 145-156. This is the paper that I found by the same name. Is this the correct reference? Minchin, Peter R.1987. An Evaluation of

Re: [R] Neural Network resource

2009-05-27 Thread Max Kuhn
I fed this data into a Neural network (3 hidden layers with 6 neurons in each layer) and trained the network. When I passed the input dataset and tried to get the predictions, all the predicted values were identical! This confused me a bit and was wondering whether my understanding of the

Re: [R] R in Ubunto

2009-05-27 Thread stephen sefick
I don't remember what the version of R in deb repositories is, but 2.6.2 is probably about right. One of the things the Debian project is focused on is the stability of the operating system, so they do not update packages as readily as some other distributions. I had this with Debian 5.0 and

Re: [R] How to exclude a column by name?

2009-05-27 Thread Dieter Menne
Peter Dalgaard P.Dalgaard at biostat.ku.dk writes: Or, BTW, you can use within() aq - within(airquality, rm(Day)) Please add this as an example to the docs of within. Dieter __ R-help@r-project.org mailing list

Re: [R] Defining functions - an interesting problem

2009-05-27 Thread Stavros Macrakis
The 'ties.method' argument to 'rank' is the *third* positional argument to 'rank', so either you need to put it in the third position or you need to use a named argument. The fact that the variable you're using to represent ties.method is called ties.method is irrelevant. That is, this:

Re: [R] R in Ubunto

2009-05-27 Thread Jeff Newmiller
R Heberto Ghezzo, Dr wrote: Hello , I do not know anything abount Ubunto, but I found a Portable Ubunto for Windows and since so many people prefer Linux to Windows I decided to give it a try. It runs very nicely, so I tried to load R, following Instructions in CRAN I added the line deb

[R] Object-oriented programming in R

2009-05-27 Thread Luc Villandre
Dear R-users, I have very recently started learning about object-oriented programming in R. I am far from being an expert in programming, although I do have an elementary C++ background. Please take a look at these lines of code. some.data = data.frame(V1 = 1:5, V2 = 6:10) ; p.plot =

[R] Changing point color/character in qqmath

2009-05-27 Thread Kevin W
Having solved this problem, I am posting this so that the next time I search for how to do this I will find an answer... Using qqmath(..., groups=num) creates a separate qq distribution for each group (within a panel). Using the 'col' or 'pch' argument does not (usually) work because

Re: [R] Hierarchical glm with binomial family

2009-05-27 Thread Douglas Bates
On Wed, May 27, 2009 at 9:17 AM, Ben Bolker bol...@ufl.edu wrote: Johan Stenberg-2 wrote: Dear members of the R help list, I want to do a hierarchical glm with binomial family but am unsure about how to write the syntax which involves nesting. I want to test whether the risk of being

Re: [R] Sort matrix by column 1 ascending then by column 2 decending

2009-05-27 Thread Linlin Yan
It's a very interesting problem. I just wrote a function for it: order.matrix - function(m, columnsDecreasing = c('1'=FALSE), rows = 1:nrow(m)) { if (length(columnsDecreasing) 0) { col - as.integer(names(columnsDecreasing[1])); values - sort(unique(m[rows, col]),

[R] Deviance explined in GAMM, library mgcv

2009-05-27 Thread Berta Ibáñez
Dear R-users, To obtain the percentage of deviance explained when fitting a gam model using the mgcv library is straightforward: summary(object.gam) $dev.expl or alternatively, using the deviance (deviance(object.gam)) of the null and the fitted models, and then using 1 minus

[R] How to set a filter during reading tables

2009-05-27 Thread guox
We are reading big tables, such as, Chemicals - read.table('ftp://ftp.bls.gov/pub/time.series/wp/wp.data.7.Chemicals',header = TRUE, sep = '\t', as.is =T) I was wondering if it is possible to set a filter during loading so that we just load what we want not the whole table each time. Thanks,

[R] Labeling barplot bars by multiple factors

2009-05-27 Thread Thomas Levine
I want to plot quantitative data as a function of three two-level factors. How do I group the bars on a barplot by level through labeling and spacing? Here http://www.thomaslevine.org/sample_multiple-factor_barplot.png's what I'm thinking of. Also, I'm pretty sure that I want a barplot, but there

Re: [R] How to exclude a column by name?

2009-05-27 Thread Wacek Kusnierczyk
Dieter Menne wrote: Peter Dalgaard P.Dalgaard at biostat.ku.dk writes: Or, BTW, you can use within() aq - within(airquality, rm(Day)) Please add this as an example to the docs of within. possibly with the slightly more generic unwanted - 'Day' aq -

Re: [R] vegan metaMDS question

2009-05-27 Thread Gavin Simpson
On Wed, 2009-05-27 at 11:31 -0400, stephen sefick wrote: The design decision in metaMDS says that it uses: Minchin, P.R. (1987) An evaluation of relative robustness of techniques for ecological ordinations. Vegetatio 71, 145-156. This is the paper that I found by the same name. Is this

Re: [R] Sort matrix by column 1 ascending then by column 2 decending

2009-05-27 Thread Kevin W
See also this tip on the R wiki: http://wiki.r-project.org/rwiki/doku.php?id=tips:data-frames:sort Also available as the orderBy function in the doBy package. Kevin Wright On Wed, May 27, 2009 at 11:19 AM, Linlin Yan yanlinli...@gmail.com wrote: It's a very interesting problem. I just wrote

Re: [R] R in Ubunto

2009-05-27 Thread Jarek Jasiewicz
R Heberto Ghezzo, Dr pisze: Hello , I do not know anything abount Ubunto, but I found a Portable Ubunto for Windows and since so many people prefer Linux to Windows I decided to give it a try. It runs very nicely, so I tried to load R, following Instructions in CRAN I added the line deb

Re: [R] Sort matrix by column 1 ascending then by column 2 decending

2009-05-27 Thread Duncan Murdoch
On 5/27/2009 8:39 AM, Paul Geeleher wrote: I've got a matrix with 2 columns and n rows. I need to sort it first by the values in column 1 ascending. Then for values which are the same in column 1, sort by column 2 decending. For example: You've seen a few ways. Here are some more: 1. Use

Re: [R] Labeling barplot bars by multiple factors

2009-05-27 Thread Mike Lawrence
You can get something close with ggplot2: library(ggplot2) my_data = expand.grid( A = factor(c('A1','A2')) , B = factor(c('B1','B2')) , C = factor(c('C1','C2')) ) my_data$DV = rnorm(8,mean=10,sd=1) p = ggplot() p = p + layer( geom = 'bar' , stat =

[R] alternative to built-in data editor

2009-05-27 Thread Jose Quesada
Hi all, I often have to peek at large data. While head and tail are convenient, at times I'd like some more comprehensive. I guess I debug better in a more visual way? I was wondering if there's a way to override the default data editor. I could of course dump to a txt file, and look at it with

[R] no internal function int.unzip in R 2.9.0 for Windows

2009-05-27 Thread Carson, John
library(R2HTML) Loading required package: R2HTML Error in .Internal(int.unzip(zipname, NULL, dest)) : no internal function int.unzip Error : .onLoad failed in 'loadNamespace' for 'R2HTML' Error: package 'R2HTML' could not be loaded Version: R 2.9.0 for Windows Internet Email

[R] Error: package/namespace load failed

2009-05-27 Thread Rebecca Sela
I am writing my first R package, and I have been getting the following series of errors when I run R CMD check: * checking S3 generic/method consistency ... WARNING Error: package/namespace load failed for 'REEMtree' Call sequence: 2: stop(gettextf(package/namespace load failed for '%s',

[R] contour lines on persp plot

2009-05-27 Thread Jack Siegrist
Hello folks, I am a beginner R user. I have been able to make a 3D surface plot using 'persp'. The surface is made by a grid of lines emanating perpendicularly from each of the x and y axes at regular intervals. I can get rid of that grid by setting 'border=NA'. Can anyone suggest some ways to

Re: [R] Neural Network resource

2009-05-27 Thread Indrajit Sengupta
Here is the code that i had used: # ## Read in the raw data fitness - c(44,89.47,44.609,11.37,62,178,182, 40,75.07,45.313,10.07,62,185,185, 44,85.84,54.297,8.65,45,156,168, 42,68.15,59.571,8.17,40,166,172, 38,89.02,49.874,9.22,55,178,180,

Re: [R] alternative to built-in data editor

2009-05-27 Thread Peter Dalgaard
Jose Quesada wrote: Hi all, I often have to peek at large data. While head and tail are convenient, at times I'd like some more comprehensive. I guess I debug better in a more visual way? I was wondering if there's a way to override the default data editor. I could of course dump to a txt file,

[R] R-beta: Re:Stats Seminar 18/02/98

2009-05-27 Thread Roland Chariatte
Bonjour, Je recherche une ancienne amie qui porte le nom de Marylin Gabriel originaire des Seychelles et que j'ai perdu de vue il y à environ 20 ans. Si cette adresse e-mail est la tienne, tu te souviendra très bien de moi, j'aimerais beaucoup te revoir car j'ai de superbes souvenirs de toi.

[R] r-plot 2nd attempt

2009-05-27 Thread durden10
First of all, thanks a lot for your quick helpful comments! I have come down to this: Win- c(-0.005276404, 0.081894394, -0.073461539, 0.184371967, 0.133189670, -0.006239016, -0.063616699, 0.196754234, 0.402148743, 0.104408425, 0.036910154, 0.195227863, 0.212743723,

Re: [R] Neural Network resource

2009-05-27 Thread Tony Breyal
I haven't used the AMORE package before, but it sounds like you haven't set linear output units or something. Here's an example using the nnet package of what you're doing i think: ### R START### # set random seed to a cool number set.seed(42) # set up data x1-rnorm(100); x2-rnorm(100);

[R] RWeka weka.core.SerializationHelper.write

2009-05-27 Thread Christian
Hi, is it possible to use the writer method from the weka.core.SerializationHelper class in R? What could be wrong in my trial. many thanks Christian .jmethods(weka/core/SerializationHelper) [2] public static void weka.core.SerializationHelper.write(java.lang.String,java.lang.Object)

[R] RWeka weka.core.SerializationHelper.write

2009-05-27 Thread Christian
Hi, is it possible to use the writer method from the weka.core.SerializationHelper class in R? When yes, what could be wrong in my trial. many thanks Christian .jmethods(weka/core/SerializationHelper) [2] public static void

Re: [R] Loop avoidance and logical subscripts

2009-05-27 Thread retama
Thank you! The script is now adapted to Biostrings and it is really fast! For example, it does: alph_sequence - alphabetFrequency(data$sequence, baseOnly=TRUE) data$GCsequence - rowSums(alph_sequence[,c(G, C)]) / rowSums(alph_sequence) in the G+C computation. It also works amazingly fast

  1   2   >