Re: [R] Point patterns and igraph

2009-09-07 Thread Gábor Csárdi
Juanita, On Tue, Sep 8, 2009 at 8:02 AM, juanita choo wrote: > Hi, > > I have a data set consisting of the x and y coordinate locations of 1600 > points. I would like to generate a graph using the functions in igraph. > However the graph making functions in igraph requires the data to be in the >

Re: [R] Equivalence of Mann-Whitney test and Kruskal-Wallis test with k=2

2009-09-07 Thread Meyners, Michael, LAUSANNE, AppliedMathematics
See the respective help files. The continuity correction only affects the normal approximation in wilcox.test. With this small samples sizes, the default evaluation is exact, so it doesn't change anything. In contrast, kruskal.test is incapable to compute exact values but always uses the chi-square

[R] Truncating (not rounding) scientific value in R

2009-09-07 Thread Gundala Viswanath
How can I truncate the scientific value keeping two digits decimal. For example from: 6.95428812397439e-35 into 6.95e-35 -E.W. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://w

[R] Point patterns and igraph

2009-09-07 Thread juanita choo
Hi, I have a data set consisting of the x and y coordinate locations of 1600 points. I would like to generate a graph using the functions in igraph. However the graph making functions in igraph requires the data to be in the form of an adjacency matrix. I'd like some advice on how to convert my po

[R] 3d scatter with trend line and errors

2009-09-07 Thread oleg lugovoy
Hello, Can anyone suggest a way to draw a plot similar to the example from Matlab ( http://www.mathworks.com/products/demos/fullsize.html?src=/products/demos/shipping/stats/orthoregdemo_03.png 3d plot with trend and errors in Matlab )? Thanks, oleg -- View this message in context: http://www.

Re: [R] Function to Normalize Numerical Vector in R

2009-09-07 Thread Daniel Malter
If you are looking for a function to standardize a variable so that it has mean zero and unit variance: std=function(x){if(length(which(is.na(x)))==0) (x-mean(x))/sd(x) else (x-mean(x,na.rm=T))/sd(x,na.rm=T) } x=rnorm(100,3,5) mean(x) sd(x) x2=std(x) mean(x2) sd(x2) HTH, Daniel

Re: [R] Equivalence of Mann-Whitney test and Kruskal-Wallis test with k=2

2009-09-07 Thread David Scott
Thomas Farrar wrote: Hi all, The Kruskal-Wallis test is a generalization of the two-sample Mann-Whitney test to *k* samples. That being the case, the Kruskal-Wallis test with *k*=2 should give an identical p-value to the Mann-Whitney test, should it not? x1<-c(1:5) x2<-c(6,8,9,11) a<-wilcox.te

[R] Character manipulation using "strsplit" & vectorization

2009-09-07 Thread Steven Kang
Dear R users, Suppose I have a data set with inconsistent names for a field. I desire to make these to consistent names. i.e "University of New Jersey", "New Jersey Uni", "New Jersey University" (3 different inconsistent names) to "The University of New Jersey" (consistent name) Below are arb

Re: [R] Omnibus test for main effects in the faceofaninteraction containing the main effects.

2009-09-07 Thread Daniel Malter
John, as I wrote in the post sciptum, an anova on ML (but not REML) fitted models seems permissible (Faraway 2006, "Extending the linear model with R", p. 158). I am certainly not an expert on this and there are better "sources" of information on why and when (e.g., Deepayan Sarkar, Julian Faraway,

Re: [R] Function to Normalize Numerical Vector in R

2009-09-07 Thread David Winsemius
On Sep 7, 2009, at 11:24 PM, Gundala Viswanath wrote: Is there any? ?scale David Winsemius, MD Heritage Laboratories West Hartford, CT __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting gui

Re: [R] Help with use of rep function in R

2009-09-07 Thread David Winsemius
On Sep 7, 2009, at 10:20 PM, Subodh Acharya wrote: Dear List,I am trying to use rep function in the following conditions A = c( 5, 6, 7, 11, 9, 12, 10, 15) B = c(12,15, 21, 31, 25, 27,32, *34*,13,12, 34, 33, 24, 29, 26, *28*,22,14,27,22,21,12,32, 16) I need to repeat each element of A, as many

[R] Function to Normalize Numerical Vector in R

2009-09-07 Thread Gundala Viswanath
Is there any? - G.V. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

[R] Help with use of rep function in R

2009-09-07 Thread Subodh Acharya
Dear List,I am trying to use rep function in the following conditions A = c( 5, 6, 7, 11, 9, 12, 10, 15) B = c(12,15, 21, 31, 25, 27,32, *34*,13,12, 34, 33, 24, 29, 26, *28*,22,14,27,22,21,12,32, 16) I need to repeat each element of A, as many times as each element of B, for the entire length of B

Re: [R] Very inaccurate circles

2009-09-07 Thread Gabor Grothendieck
Try this: library(plotrix) plot(c(-5,0,0,5), c(0,5,-5,0), asp = 1) draw.circle(0, 0, 5) On Mon, Sep 7, 2009 at 7:58 PM, Juan Alonso wrote: > Hello, > > Please take a look at the attached plot and let me know if this is > normal. The circle has radio  I am using R 2.9.2 inside OS X Leopard. > > T

Re: [R] Help with use of rep function in R

2009-09-07 Thread Rolf Turner
On 8/09/2009, at 2:20 PM, Subodh Acharya wrote: Dear List,I am trying to use rep function in the following conditions A = c( 5, 6, 7, 11, 9, 12, 10, 15) B = c(12,15, 21, 31, 25, 27,32, *34*,13,12, 34, 33, 24, 29, 26, *28*,22,14,27,22,21,12,32, 16) I need to repeat each element of A, as many ti

Re: [R] using an array of strings with strsplit, issue when including a space in split criteria

2009-09-07 Thread Gabor Grothendieck
I am using the exact same version of R as you also on Vista but can't reproduce your result. For me it splits properly. Try starting R like this (modify path if needed) from the Windows cmd line: \Program Files\R\R-2.9.2\bin\Rgui --vanilla and then try it. On Mon, Sep 7, 2009 at 11:40 AM, Tony

[R] Help with use of rep function in R

2009-09-07 Thread Subodh Acharya
Dear List,I am trying to use rep function in the following conditions A = c( 5, 6, 7, 11, 9, 12, 10, 15) B = c(12,15, 21, 31, 25, 27,32, *34*,13,12, 34, 33, 24, 29, 26, *28*,22,14,27,22,21,12,32, 16) I need to repeat each element of A, as many times as each element of B, for the entire length of B

Re: [R] Omnibus test for main effects in the face ofaninteraction containing the main effects.

2009-09-07 Thread Ben Bolker
John Sorkin wrote: > > Daniel, > When Group is entered as a factor, and the factor has two levels, the > ANOVA table gives a p value for each level of the factor. What I am > looking for is the omnibus p value for the factor, i.e. the test that > the factor (with all its levels) improves the pr

Re: [R] Omnibus test for main effects in the face ofaninteraction containing the main effects.

2009-09-07 Thread John Sorkin
Daniel, When Group is entered as a factor, and the factor has two levels, the ANOVA table gives a p value for each level of the factor. What I am looking for is the omnibus p value for the factor, i.e. the test that the factor (with all its levels) improves the prediction of the outcome. You are c

Re: [R] OT - Banker's Algorithum

2009-09-07 Thread Steve Lianoglou
Hi, On Mon, Sep 7, 2009 at 5:41 AM, Stephen Liu wrote: > Hi folks, > > > Can R-Project be used to perform Banker's Algorithum? Yes. > http://en.wikipedia.org/wiki/Banker%27s_algorithm You can pretty easily directly transalte the pseudocde listed in the section below to R: http://en.wikipedia.o

Re: [R] Omnibus test for main effects in the face of aninteraction containing the main effects.

2009-09-07 Thread Daniel Malter
John, your question is confusing. After reading it twice, I still cannot figure out what exactly you want to compare. Your model "a" is the unrestricted model, and model "b" is a restricted version of model "a" (i.e., b is a hiearchically reduced version of a, or put differently, all coefficients

Re: [R] using an array of strings with strsplit, issue when including a space in split criteria

2009-09-07 Thread Juliet Hannah
I get a different result: txt <- c("sales to 23 August 2008 published 29 August","sales to 6 September 2008 published 11 September") strsplit(txt, 'published ', fixed=TRUE) [[1]] [1] "sales to 23 August 2008 " "29 August" [[2]] [1] "sales to 6 September 2008 " "11 September" > sessionInfo() R ve

Re: [R] Very inaccurate circles

2009-09-07 Thread Rolf Turner
On 8/09/2009, at 11:58 AM, Juan Alonso wrote: Hello, Please take a look at the attached plot and let me know if this is normal. The circle has radio I am using R 2.9.2 inside OS X Leopard. The plot was generated with: png('bizarre_circle.png') plot(c(-5,0,0,5), c(0,5,-5,0)) symbols(0,0, cir

[R] Very inaccurate circles

2009-09-07 Thread Juan Alonso
Hello, Please take a look at the attached plot and let me know if this is normal. The circle has radio I am using R 2.9.2 inside OS X Leopard. The plot was generated with: png('bizarre_circle.png') plot(c(-5,0,0,5), c(0,5,-5,0)) symbols(0,0, circles=c(sqrt(25)), inches=FALSE, add=TRUE) dev.off(

Re: [R] Using anova(f1, f2) to compare lmer models yields seemingly erroneous Chisq = 0, p = 1

2009-09-07 Thread rapton
Thank you all for your insight! I am glad to hear, at least, that I am doing something incorrectly (since the results do not make sense), and I am very grateful for your attempts to remedy my very limited (and admittedly self-taught) understanding of multilevel models and R. As I mentioned in th

Re: [R] Size of plots in pdf files#can it be smaller?

2009-09-07 Thread Henrik Bengtsson
Hi, I've got a trial version of a thinScatter() function that (down-)samples 2d-scatter plots while preserving the empirical density distribution. You can grab it by: source("http://www.braju.com/R/hbLite.R";); hbLite("scatterPlots"); Example from example(thinScatter): library("scatterPlots");

[R] Equivalence of Mann-Whitney test and Kruskal-Wallis test with k=2

2009-09-07 Thread Thomas Farrar
Hi all, The Kruskal-Wallis test is a generalization of the two-sample Mann-Whitney test to *k* samples. That being the case, the Kruskal-Wallis test with *k*=2 should give an identical p-value to the Mann-Whitney test, should it not? x1<-c(1:5) x2<-c(6,8,9,11) a<-wilcox.test(x1,x2,paired=FALSE)

Re: [R] Size of plots in pdf files#can it be smaller?

2009-09-07 Thread Henrik Bengtsson
No (destructive) JPGs - they are evil (draw a line as see for yourself) and should be banned from publications (only useful for pictures/photos). Use PNGs for you plots if you don't like vector graphics. /H On Mon, Sep 7, 2009 at 5:00 PM, jim holtman wrote: > The reason for the size of the file

Re: [R] Size of plots in pdf files#can it be smaller?

2009-09-07 Thread jim holtman
The reason for the size of the file is that when generating a PDF, commands are generated to plot "each" point. I generated a PDF file with 10,000 and there were 10,000 of lines similar to the following: 159.93 349.01 1.00 1.00 re f 343.19 283.07 1.00 1.00 re f 427.86 323.58 1.00 1.00 re f 431.68

Re: [R] xyplot {lattice} are different types possible for each panel?

2009-09-07 Thread Bryan Hanson
Thanks Baptiste, your suggestion works wonderfully. Bryan For anyone following along, the following line needs to replace the similar one in my original example: names <- rep(c("Set 1", "Set 2", "Set 3", "Set 4"), 25) Or the data lengths will be wrong. On 9/7/09 4:19 PM, "baptiste auguie" wro

Re: [R] Confused - better empirical results with error in data

2009-09-07 Thread Noah Silverman
Interesting point. Our data is NOT continuous. Sure, some of the test examples are older than others, but there is no relationship between them. (More Markov like in behavior.) When creating a specific record, we actually account for this in our SQL queries which tend to be along the lines of

Re: [R] spplot modifications

2009-09-07 Thread David Winsemius
On Sep 7, 2009, at 5:29 PM, emorway wrote: http://www.nabble.com/file/p25336596/Conductivity1.jpeg I need a little help making modifications to the image included with this post. First, rather than using a linear color legend to display the output I would like to use a log-scale legend.

Re: [R] Sort an array

2009-09-07 Thread Mark Knecht
?order Possibly something like A = A[order(A$Field1, A$Field2),] On Mon, Sep 7, 2009 at 3:22 AM, OLIVIER REGNIER-COUDERT (0509785) wrote: >  Hi, > > Would anybody know how to sort an array in order? > > I basically store the results from an analysis in an array and would like to > organise it a

Re: [R] Confused - better empirical results with error in data

2009-09-07 Thread Mark Knecht
On Mon, Sep 7, 2009 at 1:22 PM, Noah Silverman wrote: > > The data is listed in our CSV file from newest to oldest.  We are supposed > to calculated a valued that is an "average" of some items.  We loop through > some queries to our database and increment two variables - $total_found and > $total_

[R] spplot modifications

2009-09-07 Thread emorway
http://www.nabble.com/file/p25336596/Conductivity1.jpeg I need a little help making modifications to the image included with this post. First, rather than using a linear color legend to display the output I would like to use a log-scale legend. Thus, the legend on the right would go from 1 to

Re: [R] lean text label below barplot table

2009-09-07 Thread David Winsemius
On Sep 7, 2009, at 5:03 PM, Xiaogang Yang wrote: Hi, everyone: I am plotting an graph with bar plot, but the label after every bar is too long, I wanna if I can draw the label lean to an angle thanks It depends on the particular function and "bar plot" is insufficiently specified to be .

Re: [R] finding the minimum value

2009-09-07 Thread Viknesh
Sorry there was a typo in the code. This should work: > tmp <- rep(0, times=1000) > for (i in 1:1000) tmp[i] <- get(paste('B', i, sep=''")) > mean(tmp) Viknesh wrote: > > Hi, > > If I correctly understand what you want to do, then this might work: > >> tmp <- rep(0, times=1000) >> for (i in

Re: [R] finding the minimum value

2009-09-07 Thread Viknesh
Hi, If I correctly understand what you want to do, then this might work: > tmp <- rep(0, times=1000) > for (i in 1:1000) tmp[i] <- get(paste('B', i, sep='')) > mean(tmp) HTH, Vik maram salem wrote: > > Hi all, > I'm using a certain  procedure to calculate the value of some > variable(Bayes r

Re: [R] How Does One Use the Value of Density Function?

2009-09-07 Thread Kingsford Jones
On Mon, Sep 7, 2009 at 12:42 AM, Gundala Viswanath wrote: > How do people usually use the result of density function (e.g. dnorm)? > Especially when its value can be greater than 1. > > What do they do with such density >1? > >> dnorm(2.02,2,.24) > [1] 1.656498 There are countless uses. E.g., wh

[R] lean text label below barplot table

2009-09-07 Thread Xiaogang Yang
Hi, everyone: I am plotting an graph with bar plot, but the label after every bar is too long, I wanna if I can draw the label lean to an angle thanks -- Xiaogang Yang Sensorweb Research Laboratory http://sensorweb.vancouver.wsu.edu/ Washington State University Vancouver [[alternative HT

Re: [R] Size of plots in pdf files#can it be smaller?

2009-09-07 Thread Philipp Pagel
> I have to produce arrangements of 25 simple plots of the type > plot(x,y,pch=".") where there are typically on the order of 2 > points. > So, overall, I have about 50 points. When I use the pdf device, > I get file sizes (on a Windows machine) of about 10 MB. > When I then zip the files,

Re: [R] how do I draw this surface -- hand drawn in the attachemtn

2009-09-07 Thread Kingsford Jones
for example... x <- y <- seq(.1, 2, .1) ftn <- function(x, y) x - .25*x^2 z <- outer(x, y, ftn) persp(x, y, z, theta = 330, phi = 30) hth, Kingsford On Sun, Sep 6, 2009 at 8:28 AM, Steve Lianoglou wrote: > Hi, > > On Sat, Sep 5, 2009 at 5:16 AM, gallon li wrote: >> Basially I have the observa

Re: [R] Confused - better empirical results with error in data

2009-09-07 Thread Noah Silverman
You both make good points. Ideally, it would be nice to know WHY it works. Without digging into too much verbiage, the system is designed to predict the outcome of certain events. The "broken" model predicts outcomes correctly much more frequently than one with the broken data withheld. So,

[R] using an array of strings with strsplit, issue when including a space in split criteria

2009-09-07 Thread Tony Breyal
Dear all, I'm having a problem understanding why a split does not occur with in the 2nd use of the function strsplit below: # text strings > txt <- c("sales to 23 August 2008 published 29 August", + "sales to 6 September 2008 published 11 September") # first use > strsplit(txt, 'published', fixe

[R] How to reduce memory demands in a function?

2009-09-07 Thread Richard Gunton
I've written a function that regularly throws the "cannot allocate vector of size X Kb" error, since it contains a loop that creates large numbers of big distance matrices. I'd be very grateful for any simple advice on how to reduce the memory demands of my function. Besides increasing memory.

Re: [R] List of tags in roxygen and use for S4 classes?

2009-09-07 Thread Peter Danenberg
> > I would also wish for a better (online) documentation, as I think the > > general idea of roxygen is great. > > I agree completely. Good call; the vignette is terse and outdated. Manuel and I are in the process of preparing a paper based on our DSC talks; that should fill in some of the detai

[R] Sort an array

2009-09-07 Thread OLIVIER REGNIER-COUDERT (0509785)
Hi, Would anybody know how to sort an array in order? I basically store the results from an analysis in an array and would like to organise it at the end of my loop with the lowest result at the index 1 and the highest result at the last index. Thanks. [[alternative HTML version dele

[R] How can I change characteristics of a cca biplot in R

2009-09-07 Thread Rousi Heta
Hi, I´m doing cca for a community data set in R and I have made a biplot for my data. Otherwise everything seems to be allright but the biplot is so messy I can´t read it well enough or publish it. I would like to get the row numbers out of the plot: I want the species position and the enviro

[R] [R-pkgs] amer: generalized additive mixed models with lme4

2009-09-07 Thread Fabian Scheipl
Dear R-users, I'd like to announce the release of the amer-package that adds the capability to fit generalized additive mixed models to lme4. It includes a vignette with real data examples and a brief summary of the theory behind the implementation. Best, Fabian [[alternative HTML versio

[R] Usage of OCaml/R binding.

2009-09-07 Thread Guillaume Yziquel
Hello. I've been pulling together a Debian package out of Maxence Guesdon's OCaml bindings for R. Will be available from my website as soon as I get my router to obey me. Here's Maxence's bindings: http://pauillac.inria.fr/~guesdon/ocaml-r.en.html The purpose of this software is to a

Re: [R] avoid NA in list

2009-09-07 Thread Grzes
Henrique and Peter, thank you very much for your advices :) -- View this message in context: http://www.nabble.com/avoid-NA-in-list-tp25321020p25330422.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

[R] Size of plots in pdf files#can it be smaller?

2009-09-07 Thread Christian Ritter
Hi all, I have to produce arrangements of 25 simple plots of the type plot(x,y,pch=".") where there are typically on the order of 2 points. So, overall, I have about 50 points. When I use the pdf device, I get file sizes (on a Windows machine) of about 10 MB. When I then zip the files,

Re: [R] Using anova(f1, f2) to compare lmer models yields seemingly erroneous Chisq = 0, p = 1

2009-09-07 Thread Kingsford Jones
On Mon, Sep 7, 2009 at 10:34 AM, Alain Zuur wrote: > > > > rapton wrote: >> >> Hello, >> >> I am using R to analyze a large multilevel data set, using >> lmer() to model my data, and using anova() to compare the fit of various >> models.  When I run two models, the output of each model is generated

Re: [R] Confused - better empirical results with error in data

2009-09-07 Thread Noah Silverman
You both make good points. Ideally, it would be nice to know WHY it works. Without digging into too much verbiage, the system is designed to predict the outcome of certain events. The "broken" model predicts outcomes correctly much more frequently than one with the broken data withheld. So,

Re: [R] xyplot {lattice} are different types possible for each panel?

2009-09-07 Thread baptiste auguie
Hi, Something like this perhaps, p <- xyplot(y ~ x | names, layout = c(1, 3), panel = function(...,type="p") { if (panel.number() == 1) { panel.xyplot(...,type = "h") } else { panel.xyplot(...,type = type) } }) plot(p) HTH, baptiste 200

Re: [R] R-crash when loading workspace - Windows

2009-09-07 Thread Mark Knecht
On Mon, Sep 7, 2009 at 1:08 PM, Duncan Murdoch wrote: > On 07/09/2009 10:34 AM, sebed1110-div...@yahoo.fr wrote: >> >> Dear all, >> >> One day when I tried to load an existing workspace (when opening R or by >> load()), R crashed without any error notification. >> The day before I had worked  and s

Re: [R] R-crash when loading workspace - Windows

2009-09-07 Thread Duncan Murdoch
On 07/09/2009 10:34 AM, sebed1110-div...@yahoo.fr wrote: Dear all, One day when I tried to load an existing workspace (when opening R or by load()), R crashed without any error notification. The day before I had worked and saved my workspace without any trouble. At first I though it was a memo

Re: [R] Confused - better empirical results with error in data

2009-09-07 Thread Mark Knecht
On Mon, Sep 7, 2009 at 12:33 PM, Noah Silverman wrote: > So, this is really a philosophical question.  Do we: >    1) Shrug and say, "who cares", the SVM figured it out and likes that bad > data item for some inexplicable reason >    2) Tear into the math and try to figure out WHY the SVM is predi

[R] Omnibus test for main effects in the face of an interaction containing the main effects.

2009-09-07 Thread John Sorkin
R 2.9.1 Windows XP UPDATE, Even my first suggestion anova(fita,fitb) is probably not appropriate as the fixed effects are different in the two model, so I don't even know how to perform the ombnibus test for the interaction! I am fitting a random effects ANOVA with two factors Group which has

[R] xyplot {lattice} are different types possible for each panel?

2009-09-07 Thread Bryan Hanson
Hello R Folks... Using the example below, I¹d like two of the panels to be plotted with type = ³p² but the third to be done with type = ³h². I can¹t use type = c(³p², ³p², ³h²) because this syntax applies all given types to every panel. I don¹t think I can use groups and distribute.type because

[R] Omnibus test for main effects in the face of an interaction containing the main effects.

2009-09-07 Thread John Sorkin
R 2.9.1 Windows XP I am fitting a random effects ANOVA with two factors Group which has two levels and Time which has three levels: fita<-lme(Post~Time+factor(Group)+factor(Group)*Time, random=~1|SS,data=blah$alldata) I want to get the omnibus significance tests for each factor and the intera

Re: [R] Confused - better empirical results with error in data

2009-09-07 Thread S Ellison
Predicting whilst confused is unlikely to produce sound predictions... my vote is for finding out why before believing anything. >>> Noah Silverman 09/07/09 8:33 PM >>> Hi, I have a strange one for the group. We have a system that predicts probabilities using a fairly standard svm (e1017). We

[R] Confused - better empirical results with error in data

2009-09-07 Thread Noah Silverman
Hi, I have a strange one for the group. We have a system that predicts probabilities using a fairly standard svm (e1017). We are looking at probabilities of a binary outcome. The input data is generated by a perl script that calculates a bunch of things, fetches data from a database, etc.

Re: [R] linear mixed model question

2009-09-07 Thread Daniel Malter
The workers=as.factor(workers) codeline in my post dropped below my name. It should be in the code before the command line for the linear model. Daniel Malter wrote: > > Wen, to follow up on Thierry, your workers are nested in machines (since > each worker only works one machine). Consider fit

Re: [R] model simulation

2009-09-07 Thread David Winsemius
On Sep 7, 2009, at 1:55 PM, Rafael Moral wrote: Dear useRs, Is there a package or a function able to simulate models with sets of differential equations? Where we could input our model and give R some value to start with and it would generate the graphs? Your request seems a bit on the

Re: [R] model simulation

2009-09-07 Thread Ben Bolker
Rafael Moral yahoo.com.br> writes: > > Dear useRs, > > Is there a package or a function able to simulate models with sets of differential equations? > Where we could input our model and give R some value to start with and it would generate the graphs? > > Regards, > Rafael. > install.packag

Re: [R] Writing R Scripts and passing command line arguments

2009-09-07 Thread cls59
Abhishek Pratap wrote: > > > 1. What's the best way to pass command line arguments to R scripts ? > > As Gabor mentioned, the commandArgs function and the getopt package provide some excellent starting points for this. Abhishek Pratap wrote: > > > 2. How to execute R scripts from comman

Re: [R] calling combinations of variable names

2009-09-07 Thread baptiste auguie
Hi, It's not enough to create a string with your instructions, it also needs to be evaluated as such. If you really wanted to evaluate your string, you'd need something like, a <- b <- cc <- 1 # dummy example eval(parse(text = "cbind(a, b, cc)")) #library(fortunes) #fortune("parse") but fortune

Re: [R] Adding to the middle of a vector

2009-09-07 Thread Dimitris Rizopoulos
have a look at ?append(), e.g., x <- 101:110 append(x, 200, after = 4) I hope it helps. Best, Dimitris Dennis Fisher wrote: Colleagues, Assume that I have a vector with N elements Vector<- 101:110). I would like to interpose an element into the vector at a position other than the

[R] model simulation

2009-09-07 Thread Rafael Moral
Dear useRs, Is there a package or a function able to simulate models with sets of differential equations? Where we could input our model and give R some value to start with and it would generate the graphs? Regards, Rafael. __

[R] Adding to the middle of a vector

2009-09-07 Thread Dennis Fisher
Colleagues, Assume that I have a vector with N elements Vector <- 101:110). I would like to interpose an element into the vector at a position other than the start or end: c(101:104, 200, 105:110). I could do the following: NewVector <- c(Vector[1:4], Ne

Re: [R] Writing R Scripts and passing command line arguments

2009-09-07 Thread Gabor Grothendieck
See ?commandArgs, the getopt package and ?Rscript On Mon, Sep 7, 2009 at 1:47 PM, Abhishek Pratap wrote: > Hi Guys > I am Abhishek, primarily a bioinformatician.  I have recently started using > a lot of R thanks to some excellent packages available. > > Lately I have felt the need to batch proces

[R] Writing R Scripts and passing command line arguments

2009-09-07 Thread Abhishek Pratap
Hi Guys I am Abhishek, primarily a bioinformatician. I have recently started using a lot of R thanks to some excellent packages available. Lately I have felt the need to batch process few of the R scripts I have been working with and strangely enough I am not able to find a good resource on how t

Re: [R] linear mixed model question

2009-09-07 Thread Daniel Malter
Wen, to follow up on Thierry, your workers are nested in machines (since each worker only works one machine). Consider fitting a nested model. Though, with few observations, you might run into the same problem. Further, if you have observation triplets, and you expect systematic differences betwee

[R] calling combinations of variable names

2009-09-07 Thread Helter Two
R-2.9.1, Windows7 Dear list, I have a question to you that seems very simple to me, but I just can't figure it out. I have a dataframe called "ratings" which contains the following variables: evalR1, evalR2, evalR3, evalR4, scoreR1, scoreR2, scoreR3, scoreR4, opinionR1, opinionR2, opinionR3, opin

Re: [R] Averaging rows if a condition is true.

2009-09-07 Thread Steve Lianoglou
Hi, On Mon, Sep 7, 2009 at 11:46 AM, A Ezhil wrote: > Dear All, > > I have matrix (5 X 60) of subjects and their responses to a set of > questions. All responses are classified into categories (500). I would like > to average all subject's responses for each category. I wrote a code using a

Re: [R] Creating mixed line and point graphs with xyplot

2009-09-07 Thread John Kane
OOPS Skitts' law ( assuming I'm spelling it correctly. --- On Sun, 9/6/09, David Winsemius wrote: > From: David Winsemius > Subject: Re: [R] Creating mixed line and point graphs with xyplot > To: "John Kane" > Cc: "Paul Sweeting" , "jim holtman" > , r-help@r-project.org > Received: Sunday, S

Re: [R] Using anova(f1, f2) to compare lmer models yields seemingly erroneous Chisq = 0, p = 1

2009-09-07 Thread Alain Zuur
rapton wrote: > > Hello, > > I am using R to analyze a large multilevel data set, using > lmer() to model my data, and using anova() to compare the fit of various > models. When I run two models, the output of each model is generated > correctly as far as I can tell (e.g. summary(f1) and summ

Re: [R] Using anova(f1, f2) to compare lmer models yields seemingly erroneous Chisq = 0, p = 1

2009-09-07 Thread Alain Zuur
rapton wrote: > > Hello, > > I am using R to analyze a large multilevel data set, using > lmer() to model my data, and using anova() to compare the fit of various > models. When I run two models, the output of each model is generated > correctly as far as I can tell (e.g. summary(f1) and summ

Re: [R] finding the minimum value

2009-09-07 Thread Charles C. Berry
On Mon, 7 Sep 2009, maram salem wrote: Hi all, I'm using a certain? procedure to calculate the value of some variable(Bayes risk),B. So I got the values B1, B2, , B1000, each under certain input values and using a long procedure. Now, I want to put the values I got in a nummerical vect

[R] finding the minimum value

2009-09-07 Thread maram salem
Hi all, I'm using a certain  procedure to calculate the value of some variable(Bayes risk),B. So I got the values B1, B2, , B1000, each under certain input values and using a long procedure. Now, I want to put the values I got in a nummerical vector and find their minimum value. I think

Re: [R] Averaging rows if a condition is true.

2009-09-07 Thread Mohamed Lajnef
Hi, Try to use aggregate function RSiteSearch ("aggregate") #for help Regards ML A Ezhil a écrit : Dear All, I have matrix (5 X 60) of subjects and their responses to a set of questions. All responses are classified into categories (500). I would like to average all subject's respons

[R] Tinn-R setup

2009-09-07 Thread rkevinburton
I recently installed R 2.9.2 on a new Windows platform. Everything seemed to installed OK. I then downloaded the latest Tinn-R (2.3.2.3 I think) and as I have always done I selected R -> Configure -> Permanent. I was greeted with a dialog box asking me for a mirror site. I don't remember this pr

[R] Averaging rows if a condition is true.

2009-09-07 Thread A Ezhil
Dear All, I have matrix (5 X 60) of subjects and their responses to a set of questions. All responses are classified into categories (500). I would like to average all subject's responses for each category. I wrote a code using a for loop but is not working. Could please tell me what's wron

[R] Tinn-R setup

2009-09-07 Thread rkevinburton
I recently installed R 2.9.2 on a new Windows platform. Everything seemed to installed OK. I then downloaded the latest Tinn-R (2.3.2.3 I think) and as I have always done I selected R -> Configure -> Permanent. I was greeted with a dialog box asking me for a mirror site. I don't remember this pr

Re: [R] linear mixed model question

2009-09-07 Thread Jason Morgan
Hello Wen: On 2009.09.06 10:49:03, Wen Huang wrote: > Hello, > > I wanted to fit a linear mixed model to a data that is similar in > terms of design to the 'Machines' data in 'nlme' package except that > each worker (with triplicates) only operates one machine. I created a > subset of obser

Re: [R] Rmetrics: Problem with "align"

2009-09-07 Thread Gero Schwenk
Hi all! I've found the solution - the ordering of the series is important. It's expected that the most recent entries are located at the bottom of the data matrix. Here's the sorting command: x <- sort(x, decreasing = FALSE) Kind regards: Gero Gero Schwenk schrieb: Hi there! I'm stuck wi

Re: [R] Color index in image function

2009-09-07 Thread FMH
Thank you for the tips. I have manage to run your script, but  was still never get the way to include the color index beside the image which could explain the intensity of the color from the lower index(green) to the higher index(blue). This color index might be represented by  an increasing of

[R] R-crash when loading workspace - Windows

2009-09-07 Thread sebed1110-divers
Dear all, One day when I tried to load an existing workspace (when opening R or by load()), R crashed without any error notification. The day before I had worked and saved my workspace without any trouble. At first I though it was a memory problem (workspace reaching 180Mo) or related to a part

[R] Multinomial and Ordinal Logistic Regression - Probability calculation

2009-09-07 Thread olivier.abz
I would add that I followed explanations from the following URL (UCLA): http://www.ats.ucla.edu/stat/r/dae/mlogit.htm I still don't know how the probabilities are generated from the coefficients and intercepts... Anybody ? Thanks. OLIVIER REGNIER-COUDERT (0509785) wrote: > > Dear all, > >

Re: [R] Andrews plot

2009-09-07 Thread Petr PIKAL
Thank you. hadley wickham napsal dne 07.09.2009 15:50:03: > On Mon, Sep 7, 2009 at 8:36 AM, Petr PIKAL wrote: > > Dear all > > > > Colleague of mine ask me if R is capable of Andrews plot like > > andrewsplot(x) in Matlab. > > > > Quick search did not reveal anything but before I start to writ

Re: [R] Andrews plot

2009-09-07 Thread hadley wickham
On Mon, Sep 7, 2009 at 8:36 AM, Petr PIKAL wrote: > Dear all > > Colleague of mine ask me if R is capable of Andrews plot like > andrewsplot(x) in Matlab. > > Quick search did not reveal anything but before I start to write any > routine I would like to ask this ingenious audience if there is any >

Re: [R] Andrews plot

2009-09-07 Thread Romain Francois
On 09/07/2009 03:36 PM, Petr PIKAL wrote: Dear all Colleague of mine ask me if R is capable of Andrews plot like andrewsplot(x) in Matlab. Quick search did not reveal anything but before I start to write any routine I would like to ask this ingenious audience if there is any implementation of

[R] Andrews plot

2009-09-07 Thread Petr PIKAL
Dear all Colleague of mine ask me if R is capable of Andrews plot like andrewsplot(x) in Matlab. Quick search did not reveal anything but before I start to write any routine I would like to ask this ingenious audience if there is any implementation of Andrews plots somewhere. I know about p

[R] help for cluster

2009-09-07 Thread amri Al-khanbushi
I'm a new in R. I have a dissimitarity matrix, and I want to make a cluster using R for instance, this is the diss martix > me <-matrix(scan("new.txt"),ncol=4,byrow=T) 0 17 20 1 08 18 780 12 20 18120 > m <- as.dist(me) // distan

Re: [R] [Hmisc] Latex to pdf

2009-09-07 Thread Ista Zahn
Hi Jeroen, > From: Jeroen Ooms > To: r-help@r-project.org > Date: Sun, 6 Sep 2009 04:49:08 -0700 (PDT) > Subject: [R] [Hmisc] Latex to pdf > > I would like to print some tables and figures to a PDF device on a CentOS 5 > vps. However, I cannot seem to get the latex function from Hmisc working. I >

Re: [R] Problems with Boxplot

2009-09-07 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 05.09.2009 04:59:41: > > Hi Petr, > > Thanks for these comments. > > I'm sorry that my post was not clear. I was referring to the questions in > my original post/code/file uploads, but I had forgotten to include an > updated file (now attached > ht

Re: [R] How many attributes are there of a variable?

2009-09-07 Thread Heinz Tuechler
Peng, based on a suggestion, Frank made years ago (18.7.2006), I use one attribute that contains all further attributes, I want to assign to variables. It's necessary to create your own class and subsetting method, so that this attribute does not get lost. Together with some functions I use lab

[R] Fwd: trouble installing gtools package in local directory

2009-09-07 Thread Saad Saeed
Hello, I posted my question to r-sig-fedora a few days ago, but noticed that list is not very active. I hope sending my question here is okay, so here goes. I've recently transitioned to using R in Linux. My OS/installation versions are: $ Red Hat Enterprise Linux AS release 4 (Nahant Update 6) $

[R] Matrix regression

2009-09-07 Thread Corrado
Dear friends, I would like to solve the following regression problem: y=c1 x1 + c2 x2 + + cn xn where the y, xi are all matrices and the ci are constants that need to be determined. The y, xi are distance matrices (symmetric). ci should be forced to positive or null (i.e. non negative).

  1   2   >