Re: [R] advice/opinion on - vs = in teaching R

2010-01-15 Thread Barry Rowlingson
On Fri, Jan 15, 2010 at 3:45 AM, Erin Hodgess erinm.hodg...@gmail.comwrote: Hi R People: I'm teaching a statistical computing class using R starting next week (yay!) and I have an opinion type question, please. I'm old school and use - in an assignment. You call that 'old school'?? I

[R] Replacing NAs with 0 for variables with the same ending

2010-01-15 Thread Uli Kleinwechter
Dear all, I'm looking for a way to replace NA's with 0 for a number of variables which share the same ending and which constitute a subset of a data frame. Say, for example, there is data - data.frame(ax=c(1,2,3,NA,0) , bx=c(3,5,NA,5,1) , ay=c(5,NA,2,NA,0) , by=c(4,2,NA,2,1)) data ax bx ay

Re: [R] advice/opinion on - vs = in teaching R

2010-01-15 Thread Barry Rowlingson
On Fri, Jan 15, 2010 at 6:57 AM, Ted Harding ted.hard...@manchester.ac.ukwrote: There is at least one context where the distinction must be preserved. Example: pnorm(1.5) # [1] 0.9331928 pnorm(x=1.5) # Error in pnorm(x = 1.5) : unused argument(s) (x = 1.5) pnorm(x-1.5) # [1]

Re: [R] advice/opinion on - vs = in teaching R

2010-01-15 Thread Ted Harding
On 15-Jan-10 08:14:04, Barry Rowlingson wrote: On Fri, Jan 15, 2010 at 6:57 AM, Ted Harding ted.hard...@manchester.ac.ukwrote: There is at least one context where the distinction must be preserved. Example: pnorm(1.5) # [1] 0.9331928 pnorm(x=1.5) # Error in pnorm(x = 1.5) : unused

Re: [R] advice/opinion on - vs = in teaching R

2010-01-15 Thread Deepayan Sarkar
On Fri, Jan 15, 2010 at 2:38 PM, Ted Harding ted.hard...@manchester.ac.uk wrote: On 15-Jan-10 08:14:04, Barry Rowlingson wrote: On Fri, Jan 15, 2010 at 6:57 AM, Ted Harding ted.hard...@manchester.ac.ukwrote: There is at least one context where the distinction must be preserved. Example:  

Re: [R] Sampling from a Postgres database

2010-01-15 Thread Bart Joosen
One way could be to first select only the unique ID's, sample this and then select only the relevant records: strQuery = SELECT ID from tblFoo; IDs - sqlQuery(channel, strQuery) sample.IDs - sample(IDs,10) strQuery = paste(SELECT ID from tblFoo WHRE ID IN(, sample.IDs, );) IDs -

Re: [R] Replacing NAs with 0 for variables with the same ending

2010-01-15 Thread Jim Lemon
On 01/15/2010 07:10 PM, Uli Kleinwechter wrote: Dear all, I'm looking for a way to replace NA's with 0 for a number of variables which share the same ending and which constitute a subset of a data frame. Say, for example, there is data- data.frame(ax=c(1,2,3,NA,0) , bx=c(3,5,NA,5,1) ,

Re: [R] advice/opinion on - vs = in teaching R

2010-01-15 Thread Ted Harding
On 15-Jan-10 09:29:16, Deepayan Sarkar wrote: On Fri, Jan 15, 2010 at 2:38 PM, Ted Harding ted.hard...@manchester.ac.uk wrote: On 15-Jan-10 08:14:04, Barry Rowlingson wrote: On Fri, Jan 15, 2010 at 6:57 AM, Ted Harding ted.hard...@manchester.ac.ukwrote: There is at least one context where

[R] Remove part of string in colname and calculate mean for columns groups

2010-01-15 Thread Joel Fürstenberg-Hägg
Hi all, I have two question. First, I wonder how to remove a part of the column names in a matrix? I would like to remove the _ACCX or _NAX part below. Is there a method where the _ as well as all characters after i can be removed? dim(exprdata) [1] 88 512

Re: [R] advice/opinion on - vs = in teaching R

2010-01-15 Thread Berwin A Turlach
G'day all, On Fri, 15 Jan 2010 09:08:44 - (GMT) (Ted Harding) ted.hard...@manchester.ac.uk wrote: On 15-Jan-10 08:14:04, Barry Rowlingson wrote: [...] I would regard modifying a variable within the parameters of a function call as pretty tasteless. What does: foo(x-2,x) or

[R] Best method

2010-01-15 Thread Vladimir Pekar
Hi, I would like to ask for advice about best statistics method for my problem. I was done questionnaire about headache. My data are: Y - frequency of symptoms occur - times per month in range 0..30 (where 30 is daily and zero for never) and independent variables: X1 - sex - category {M,F} X2 -

[R] Can I save R graphs as a R objects

2010-01-15 Thread vikrant
Can I save R graphs as a R objects ? IF yes then if I click this R object can I edit my chart as in Excel. Please suggest your views -- View this message in context: http://n4.nabble.com/Can-I-save-R-graphs-as-a-R-objects-tp1014621p1014621.html Sent from the R help mailing list archive at

[R] Connecting R with MS SQL server 2005

2010-01-15 Thread vikrant
Is it possible to connect R with Ms SQL Server 2005 ? If Yes how to connect it and can you please provide some tutorial for it? -- View this message in context: http://n4.nabble.com/Connecting-R-with-MS-SQL-server-2005-tp1014643p1014643.html Sent from the R help mailing list archive at

[R] Barplots in R

2010-01-15 Thread vikrant
Suppose I need to draw a Grouped bar plot with 100 values on the X axis. Now my question is If I need to highlight suppose first three values by some color say 'red' and also I need to highlight last 5 datavalues by some color say 'blue' and the rest of the data in between I need not display. Is

[R] Latent Profile Analysis Package?

2010-01-15 Thread Jon Toledo
I´ve several packages for latent class analysis, but I was wondering if there is a package for continuos variables, which allows latent prfile analysis. Thanks for your help in advance, J Toledo

[R] the sample() function

2010-01-15 Thread Federico Bonofiglio
hello R-Wizards! again i'm invoking your presence!! since all the fuss about the paradoxes on a computer algorithm generating caos or un-determinancy, i recently grew quite curious about the mechanism underlying the procedure of NUMBER RADOMIZATION. could anyone of you, masters, attach me

Re: [R] HTML translation problem in R-2.10.1

2010-01-15 Thread Jim Lemon
Hi everyone, The problem was the result of my historical misbehavior of embedding links within certain font enhancements. This used to work, but no longer. Any of you package maintainers who find that your links are suddenly becoming literal text on the HTML help pages are likely to have the

Re: [R] Connecting R with MS SQL server 2005

2010-01-15 Thread vikrant
If anybody can provide me a link it will be very much helpful -- View this message in context: http://n4.nabble.com/Connecting-R-with-MS-SQL-server-2005-tp1014643p1014669.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] Replacing NAs with 0 for variables with the same ending

2010-01-15 Thread Johannes Signer
Hi, this works aswell: for(i in 1:ncol(data)) data[is.na(data[,i]),i] - 0 i am sure there is way doing it with a member of the apply family, maybe someone else has an idea. Johannes On Fri, Jan 15, 2010 at 9:51 PM, Jim Lemon j...@bitwrit.com.au wrote: On 01/15/2010 07:10 PM, Uli

Re: [R] memDecompress and zlib compressed base64 encoded string

2010-01-15 Thread Johannes Graumann
Prof Brian Ripley wrote: I have zlib compressed strings (example is attached) What is that file? Not gzip compression: gannet% file compressed.txt compressed.txt: ASCII text, with very long lines since gzip uses a magic header that 'file' knows about. And even if the header was

[R] estimating rho of Poisson distributed data

2010-01-15 Thread Titus von der Malsburg
Mean and variance of Poisson distributed data are specified by \rho. How can I estimate \rho for a set of measurements in R? Many thanks! Titus __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

Re: [R] advice/opinion on - vs = in teaching R

2010-01-15 Thread Peter Dalgaard
Barry Rowlingson wrote: On Fri, Jan 15, 2010 at 3:45 AM, Erin Hodgess erinm.hodg...@gmail.comwrote: Hi R People: I'm teaching a statistical computing class using R starting next week (yay!) and I have an opinion type question, please. I'm old school and use - in an assignment. You

Re: [R] Latent Profile Analysis Package?

2010-01-15 Thread Ingmar Visser
Jon, There are packages that fit mixtures of multivariate normals (mclust) and in flexmix one can also model multiple measures (with local independence assumption). hth, Ingmar On Fri, Jan 15, 2010 at 11:08 AM, Jon Toledo tintin...@hotmail.com wrote: I扉e several packages for latent class

Re: [R] Can I save R graphs as a R objects

2010-01-15 Thread Paul Hiemstra
vikrant wrote: Can I save R graphs as a R objects ? IF yes then if I click this R object can I edit my chart as in Excel. Please suggest your views When you use the graphics functions from the lattice package (e.g. xyplot) you can save them to a file (see ?save) because it creates an

Re: [R] Barplots in R

2010-01-15 Thread K. Elo
Hi! Let's suppose the values for the x axis are stored in 'values'. barplot(values, col=c(rep(Red,3),rep(1,length(values)-8),rep(Blue,5))) HTH, Kimmo vikrant kirjoitti: Suppose I need to draw a Grouped bar plot with 100 values on the X axis. Now my question is If I need to highlight suppose

Re: [R] Connecting R with MS SQL server 2005

2010-01-15 Thread Dieter Menne
vikrant wrote: Is it possible to connect R with Ms SQL Server 2005 ? If Yes how to connect it and can you please provide some tutorial for it? It's easiest using RODBC. Using Control Panel/Administrator/Data Sources (Free translation from German, might be slightly off), create a source

Re: [R] Can I save R graphs as a R objects

2010-01-15 Thread Henrique Dallazuanna
You can use the recordPlot function from base package also On Fri, Jan 15, 2010 at 7:26 AM, vikrant vikrant.shi...@tcs.com wrote: Can I save R graphs as a R objects ? IF yes then if I click this R object can I edit my chart as in Excel. Please suggest your views -- View this message in

Re: [R] Connecting R with MS SQL server 2005

2010-01-15 Thread Uwe Ligges
On 15.01.2010 11:23, vikrant wrote: If anybody can provide me a link it will be very much helpful See package RODBC. Uwe Ligges __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] Can I save R graphs as a R objects

2010-01-15 Thread Rainer M Krug
On Fri, Jan 15, 2010 at 11:26 AM, vikrant vikrant.shi...@tcs.com wrote: Can I save R graphs as a R objects ? I have seen that feature in the rkward GUI (which is by the way the BEST GUI I have seen for a long time!), but I haven't played with that feature a lot, so I can not comment on your

Re: [R] select: bad file descriptor in the multicore package

2010-01-15 Thread Uwe Ligges
On 13.01.2010 05:43, Hao Cen wrote: Hi, I wonder anyone knows what causes the error message select: bad file descriptor in the multicore package. This error sometimes occurs and sometimes doesn't. I couldn't find any documentation on this error about this package. As the R-help footer

Re: [R] Remove part of string in colname and calculate mean for columns groups

2010-01-15 Thread Dieter Menne
Joel Fürstenberg-Hägg wrote: I have two question. First, I wonder how to remove a part of the column names in a matrix? I would like to remove the _ACCX or _NAX part below. Is there a method where the _ as well as all characters after i can be removed? Secondly, I would like to

[R] processing all files with certain extension in a directory

2010-01-15 Thread Albert Vilella
Hi all, I'm trying to process all files with a certain extension *.ext in a directory like this: R --slave --args /my/dir dir_plot.r where I then I want to do something like: myarg - commandArgs() inputdir - myarg[length(myarg)] print(inputdir) for file with extension *.ext in inputdir do

Re: [R] processing all files with certain extension in a directory

2010-01-15 Thread Remko Duursma
Albert, try something like this: extfiles - list.files(pattern=.ext) for(f in extfiles){ process.data(f) #etc } greetings, Remko - Remko Duursma Post-Doctoral Fellow Centre for Plants and the Environment University of Western Sydney

Re: [R] processing all files with certain extension in a directory

2010-01-15 Thread Benilton Carvalho
theFiles - list.files(inputdir, full=T, pattern=\\.[eE][xX][tT]$) for (file in theFiles){ ... } On Fri, Jan 15, 2010 at 11:43 AM, Albert Vilella avile...@gmail.com wrote: Hi all, I'm trying to process all files with a certain extension *.ext in a directory like this: R --slave --args

[R] How to delete matrix rows based on NA frequency?

2010-01-15 Thread Joel Fürstenberg-Hägg
Hi all, I would like to remove rows from a matrix, based on the frequency of missing values. If there are more than 10 % missing values, the row should be deleted. I use the following to calculate the frequencies, thereby getting a new matrix with the frequencies:

Re: [R] How to delete matrix rows based on NA frequency?

2010-01-15 Thread Remko Duursma
Joel, try this: # sample matrix m - matrix(sample(c(1:10, NA),150,replace=T),byrow=T,ncol=15) # nr of missing values per row nacounts - apply(m, 1, function(x)length(x[is.na(x)])) # new matrix newm - m[nacounts/ncol(m) 0.1,] greetings, Remko

Re: [R] How to delete matrix rows based on NA frequency?

2010-01-15 Thread Henrique Dallazuanna
Try this: m[prop.table(rowSums(is.na(m))) 0.1,] 2010/1/15 Joel Fürstenberg-Hägg joel_furstenberg_h...@hotmail.com: Hi all, I would like to remove rows from a matrix, based on the frequency of missing values. If there are more than 10 % missing values, the row should be deleted. I

Re: [R] advice/opinion on - vs = in teaching R

2010-01-15 Thread Duncan Murdoch
Barry Rowlingson wrote: On Fri, Jan 15, 2010 at 6:57 AM, Ted Harding ted.hard...@manchester.ac.ukwrote: There is at least one context where the distinction must be preserved. Example: pnorm(1.5) # [1] 0.9331928 pnorm(x=1.5) # Error in pnorm(x = 1.5) : unused argument(s) (x = 1.5)

Re: [R] Best method

2010-01-15 Thread ONKELINX, Thierry
Dear Vladimir, You can use a logistic regression. First define Y0 as 30 - Y. Then Y is the number of days with headache and Y0 the number of days without. Then the model looks like: glm(cbind(Y, Y0) ~ X1 + X2 + X3, family = binomial) HTH, Thierry

[R] transposing a list of vectors

2010-01-15 Thread Michael Friendly
I have a list of vectors, all forced to be the same length: testlist - list( shape=c(0, 0, 2), cell.fill=c(red,blue,green), back.fill=rep(white,3), scale.max=rep(100,3) ) str(testlist) List of 4 $ shape: num [1:3] 0 0 2 $ cell.fill: chr [1:3] red blue green $ back.fill: chr

Re: [R] Replacing NAs with 0 for variables with the same ending

2010-01-15 Thread Uli Kleinwechter
Jim Lemon schrieb: On 01/15/2010 07:10 PM, Uli Kleinwechter wrote: Dear all, I'm looking for a way to replace NA's with 0 for a number of variables which share the same ending and which constitute a subset of a data frame. Say, for example, there is data- data.frame(ax=c(1,2,3,NA,0) ,

Re: [R] transposing a list of vectors

2010-01-15 Thread jim holtman
Does this do it: testlist - list( + shape=c(0, 0, 2), + cell.fill=c(red,blue,green), + back.fill=rep(white,3), + scale.max=rep(100,3) + ) wanted - lapply(seq(length(testlist[[1]])), function(x){ + # iterate for each element of the list + result - lapply(names(testlist),

[R] call R with un expression (String)?

2010-01-15 Thread Jiiindo
Hello all, I want to call R from java. And I have a expression in Java as a String, example : (variable 1 + variable 2)* variable 3 and i want R calculate this expression. How can I do? ex: Java -int x1,x2; -float x3; -String s=( x1.toString()+x2.toString() ) * x3.toString(); R: calculate

Re: [R] Can I save R graphs as a R objects

2010-01-15 Thread Liviu Andronic
On 1/15/10, vikrant vikrant.shi...@tcs.com wrote: can I edit my chart as in Excel. Sort of, using playwith. You can always try to place the the plot call inside playwith(). For example, require(playwith) playwith(plot(1:10)) Liviu __

Re: [R] transposing a list of vectors

2010-01-15 Thread jim holtman
fingers too fast; didn't need the enclosing 'list': testlist - list( + shape=c(0, 0, 2), + cell.fill=c(red,blue,green), + back.fill=rep(white,3), + scale.max=rep(100,3) + ) wanted - lapply(seq(length(testlist[[1]])), function(x){ + # iterate for each element of the list +

Re: [R] transposing a list of vectors

2010-01-15 Thread Henrique Dallazuanna
Try this: #'1) But apply converts all to 'character' apply(as.data.frame(testlist), 1, as.list) #2) lapply(split(x - as.data.frame(testlist), 1:nrow(x)), as.list) On Fri, Jan 15, 2010 at 11:09 AM, Michael Friendly frien...@yorku.ca wrote: I have a list of vectors, all forced to be the same

Re: [R] Replacing NAs with 0 for variables with the same ending

2010-01-15 Thread Henrique Dallazuanna
In grep use: grep(x$, names(data)). '$' matchs 'x' in the end of string On Fri, Jan 15, 2010 at 11:14 AM, Uli Kleinwechter u.kleinwech...@uni-hohenheim.de wrote: Jim Lemon schrieb: On 01/15/2010 07:10 PM, Uli Kleinwechter wrote: Dear all, I'm looking for a way to replace NA's with 0 for a

Re: [R] transposing a list of vectors

2010-01-15 Thread Gabor Grothendieck
This gives the result you asked for: DF - as.data.frame(testlist) lapply(split(DF, 1:nrow(DF)), unclass) although it might be good enough to just do this depending on what you need: DF - as.data.frame(testlist) split(DF, 1:nrow(DF) On Fri, Jan 15, 2010 at 8:09 AM, Michael Friendly

Re: [R] Replacing NAs with 0 for variables with the same ending

2010-01-15 Thread Olivier CROUZET
Uli Kleinwechter a écrit : data[,grep(x,names(data))][is.na(data[,grep(x,names(data))])]-0 thanks a lot. I'm just afraid that grep matches any occurence of x in the variable name. So variables which would contain x at any position, not necessarily only at the last one would be selected,

Re: [R] Replacing NAs with 0 for variables with the same ending

2010-01-15 Thread Uli Kleinwechter
That's it, thanks a lot to all of you! Uli Henrique Dallazuanna schrieb: In grep use: grep(x$, names(data)). '$' matchs 'x' in the end of string On Fri, Jan 15, 2010 at 11:14 AM, Uli Kleinwechter u.kleinwech...@uni-hohenheim.de wrote: Jim Lemon schrieb: On 01/15/2010 07:10 PM,

Re: [R] FW: Problems connecting with MySQL using odbcDriverConnect (RODBC package) on Linux

2010-01-15 Thread Orvalho Augusto
Ok. Caveman On Thu, Jan 14, 2010 at 5:19 PM, Marcus, Jeffrey jeffrey.mar...@nuance.com wrote: Orvalho:  Thanks for pointing our RMySQL. The reason is that we have similar data stored in both SQL server and MySQL databases and I want to reuse code as much as possible.  Jeff

Re: [R] the sample() function

2010-01-15 Thread Uwe Ligges
You can access the sources yourself. How to find the right file is described in Ligges, U. (2006): R Help Desk: Accessing the Sources. R News 6 (4), 43-45. http://cran.r-project.org/doc/Rnews/Rnews_2006-4.pdf Best wishes, Uwe Ligges On 15.01.2010 10:54, Federico Bonofiglio wrote: hello

Re: [R] How to color a splom?

2010-01-15 Thread Uwe Ligges
On 14.01.2010 11:11, Marius Hofert wrote: Dear R-Users, I would like to color the data in a splom according to their position in the matrix, i.e. I would like to have all data shown in the upper left corner to be blue, all entries below that to be black, and the data to the right to be all

Re: [R] transposing a list of vectors

2010-01-15 Thread Michael Friendly
Thanks, Henrique I *do* need to preserve the type of each list element (num or chr). Thus, a first step might be as.data.frame(testlist, stringsAsFactors=FALSE) shape cell.fill back.fill scale.max 1 0 red white 100 2 0 blue white 100 3 2 green

[R] How to calculate the row wise means for grouped columns in matrix?

2010-01-15 Thread Joel Fürstenberg-Hägg
Hi all, I want to calculate the row wise mean of groups of columns in a matrix M. All columns belonging to the same group have the same column name. My idea is to create a new vector V containing these column names, but after first removing the duplicates. Then I would calculate the means

Re: [R] estimating rho of Poisson distributed data

2010-01-15 Thread David Winsemius
On Jan 15, 2010, at 5:59 AM, Titus von der Malsburg wrote: Mean and variance of Poisson distributed data are specified by \rho. How can I estimate \rho for a set of measurements in R? rho - mean(x) David Winsemius, MD Heritage Laboratories West Hartford, CT

Re: [R] estimating rho of Poisson distributed data

2010-01-15 Thread Titus von der Malsburg
On Fri, Jan 15, 2010 at 09:19:23AM -0500, David Winsemius wrote: On Jan 15, 2010, at 5:59 AM, Titus von der Malsburg wrote: Mean and variance of Poisson distributed data are specified by \rho. How can I estimate \rho for a set of measurements in R? rho - mean(x) Yeah, thanks :-) I was

Re: [R] advice/opinion on - vs = in teaching R

2010-01-15 Thread John Kane
I've only been using R for about 2.5 years but and I'm not all that good but I vote for - . I think the deciding factor is in RSiteSearch() and the various manuals. Almost everything I see uses - . Why introduce = when it is not used normally? It will just confuse the students who are

[R] optimization problem

2010-01-15 Thread klausch
Dear R-experts, this is not a direct R-problem but I hope you can help me anyway. I would like to minimize || PG-I || over P, where P is a p x p permutation matrix (obtained by permuting the rows and/or columns of the identity matrix), G is a given p x p matrix with full rank and I the

[R] What is the newline escape sequence when using the Hershey fontfamily?

2010-01-15 Thread Douglas Walcerz
Hello! The question is simple: What is the escape sequence for a new line when using Hershey fonts? I obviously tried '\n' but it didn't work (see the sample below). I looked at 'demo(Hershey)' but all it only shows escape sequences for printable characters. The sample I've been using to

Re: [R] Advantages of using SQLite for data import in comparison to csv files

2010-01-15 Thread Juliet Jacobson
Thanks for your answer. I've thought of the possibility of an index when using a SQLite database, but as you mentioned, I don't really benefit from it in regard of rather small data sets. What I am considering as a problem when using csv files is the occurrence of data redundancy: When I wan't

[R] gWidgets: loading problem

2010-01-15 Thread Walther, Alexander
Dear list, i try to set up a GUI with gWidgets. For this project, RGtk2 is required. By loading the package, i encounter the following error prompt: ---C Symbolname S_gtk_icon_factory_new not in DLL for package RGtk2--- Any suggestions how to fix this? And: is there a good resource for

[R] Lattice: How to color the data points in splom() according to the panel they are plotted?

2010-01-15 Thread Marius Hofert
Dear ExpeRts, I have the scatter plot matrix as given below. I would like the different sub-plots in the scatter plot matrix to be colored differently. How do I get all points shown in the upper-left plot (on position (1,1) in the scatter plot matrix) to be plotted in blue, and the points

Re: [R] To add text in a matrix

2010-01-15 Thread Larry Hotchkiss
One way to add the text is to use a list with named elements for the row and column names: (M - matrix(1:9, ncol=3, byrow=TRUE, + dimnames=list( =LETTERS[1:3], + THIS IS AN EXAMPLE\nOF a 3x3 MATRIX=LETTERS[1:3])) ) THIS IS AN EXAMPLE OF a 3x3 MATRIX A B C A

Re: [R] How to calculate the row wise means for grouped columns in matrix?

2010-01-15 Thread Benilton Carvalho
adapted from the help files of rowsum x - matrix(runif(100), ncol=5) group - sample(1:8, 20, TRUE) xsum - rowsum(x, group) sweep(xsum, 1, table(group), /) or aggregate(x, list(group), mean)[-1] b 2010/1/15 Joel Fürstenberg-Hägg joel_furstenberg_h...@hotmail.com: Hi all, I want to

Re: [R] estimating rho of Poisson distributed data

2010-01-15 Thread Peter Ehlers
Titus von der Malsburg wrote: On Fri, Jan 15, 2010 at 09:19:23AM -0500, David Winsemius wrote: On Jan 15, 2010, at 5:59 AM, Titus von der Malsburg wrote: Mean and variance of Poisson distributed data are specified by \rho. How can I estimate \rho for a set of measurements in R? rho -

[R] Comparing percentages

2010-01-15 Thread Bryan S.
Hi all, This question is more stats related than R related, but as I will be doing these analyses in R, there may be some programming questions to follow. I figured it best to start here. To keep things relatively simple, assume that I recently fielded a survey over three weeks. I have three

Re: [R] estimating rho of Poisson distributed data

2010-01-15 Thread Titus von der Malsburg
On Fri, Jan 15, 2010 at 08:33:52AM -0700, Peter Ehlers wrote: Why would anyone complain? You're free to call it 'applesauce' if that suits you. Good idea, I will do this from now on! ;-) What do you mean by 'general way to fit a distribution'? Maximum likelihood might be one way. Somebody

Re: [R] estimating rho of Poisson distributed data

2010-01-15 Thread David Winsemius
On Jan 15, 2010, at 9:46 AM, Titus von der Malsburg wrote: On Fri, Jan 15, 2010 at 09:19:23AM -0500, David Winsemius wrote: On Jan 15, 2010, at 5:59 AM, Titus von der Malsburg wrote: Mean and variance of Poisson distributed data are specified by \rho. How can I estimate \rho for a set of

Re: [R] advice/opinion on quot; lt; -quot; vs quot; =quot; in teaching R

2010-01-15 Thread Ben Bolker
John Kane jrkrideau at yahoo.ca writes: I've only been using R for about 2.5 years but and I'm not all that good but I vote for - . I think the deciding factor is in RSiteSearch() and the various manuals. Almost everything I see uses - . Why introduce = when it is not used normally?

Re: [R] advice/opinion on - vs = in teaching R

2010-01-15 Thread Thomas Lumley
On Fri, 15 Jan 2010, Barry Rowlingson wrote: On Fri, Jan 15, 2010 at 6:57 AM, Ted Harding ted.hard...@manchester.ac.ukwrote: There is at least one context where the distinction must be preserved. Example: pnorm(1.5) # [1] 0.9331928 pnorm(x=1.5) # Error in pnorm(x = 1.5) : unused

Re: [R] advice/opinion on - vs = in teaching R

2010-01-15 Thread Thomas Lumley
On Thu, 14 Jan 2010, Erin Hodgess wrote: Hi R People: I'm teaching a statistical computing class using R starting next week (yay!) and I have an opinion type question, please. I'm old school and use - in an assignment. However, I'm starting to see the = in the literature. Which should I use

Re: [R] estimating rho of Poisson distributed data

2010-01-15 Thread John Sorkin
If you use fit1-glm(y~x,offset=offset,family=poisson(link=log)) you will get values for the Null deviance and residual deviance along with degrees of freedom for these parameters. One of these deviances divided by its degrees of freedom might be what you are looking for. but I am not sure.

Re: [R] gWidgets: loading problem

2010-01-15 Thread j verzani
Walther, Alexander awalthermail at googlemail.com writes: Dear list, i try to set up a GUI with gWidgets. For this project, RGtk2 is required. By loading the package, i encounter the following error prompt: ---C Symbolname S_gtk_icon_factory_new not in DLL for package RGtk2- -- This

Re: [R] Sampling from a Postgres database

2010-01-15 Thread Joe Conway
On 01/15/2010 01:49 AM, Bart Joosen wrote: One way could be to first select only the unique ID's, sample this and then select only the relevant records: strQuery = SELECT ID from tblFoo; IDs - sqlQuery(channel, strQuery) sample.IDs - sample(IDs,10) strQuery = paste(SELECT ID from tblFoo

[R] panel.bpplot

2010-01-15 Thread netrunner
Hi everybody, I am a newbie in R. I would like to use the panel.bpplot function on my data set but I have some problems. Can this function work on matrix? My data set have some NaN and when I run panel.bpplot function it returns error due to the presence of NaN. How Can I solve this? Thank you

Re: [R] optimization problem

2010-01-15 Thread Erwin Kalvelagen
klausch at gmx.de writes: Dear R-experts, this is not a direct R-problem but I hope you can help me anyway. I would like to minimize || PG-I || over P, where P is a p x p permutation matrix (obtained by permuting the rows and/or columns of the identity matrix), G is a given p x p

[R] Can an object reference itself?

2010-01-15 Thread Janko Thyson
Dear List, I am not really familiar with any other language than R, but I’ve heard that in other languages there is something called “self referencing”. Here’s what I’m trying to get an answer for: Suppose there is a function that takes as its input a value of a slot of an S4 object. The

Re: [R] panel.bpplot

2010-01-15 Thread Frank E Harrell Jr
netrunner wrote: Hi everybody, I am a newbie in R. I would like to use the panel.bpplot function on my data set but I have some problems. Can this function work on matrix? My data set have some NaN and when I run panel.bpplot function it returns error due to the presence of NaN. How Can I solve

Re: [R] panel.bpplot

2010-01-15 Thread Dieter Menne
netrunner wrote: I am a newbie in R. I would like to use the panel.bpplot function on my data set but I have some problems. Can this function work on matrix? My data set have some NaN and when I run panel.bpplot function it returns error due to the presence of NaN. How Can I solve this?

Re: [R] Can an object reference itself?

2010-01-15 Thread hadley wickham
On Fri, Jan 15, 2010 at 5:30 PM, Janko Thyson janko.thy...@ku-eichstaett.de wrote: Dear List, I am not really familiar with any other language than R, but I’ve heard that in other languages there is something called “self referencing”. Here’s what I’m trying to get an answer for: Suppose

Re: [R] Advantages of using SQLite for data import in comparison to csv files

2010-01-15 Thread Matthew Dowle
Just to comment on this bit : For one thing, you cannot index a csv file or a data.frame. If you have to repeatedly select subsets of your large data set, creating an index on the relevant column in the sqlite table is an absolute life saver. This is one reason the data.table package was

[R] cbind or ?

2010-01-15 Thread L.A.
Hey Guys, It sure seems I get stuck on things that should be easy. Heres my question: PARCELS-by(ResImp[ , ACCOUNTNO], ResImp[Property], length) PARCELS Property: UNSOLD [1] 9053 --- Property: SOLD [1]

Re: [R] cbind or ?

2010-01-15 Thread Henrique Dallazuanna
Try this: `class-`(lapply(1:length(QuanImpUnsold), function(idx)c(QuanImpUnsold[[idx]], PARCELS[[idx]])), by) On Fri, Jan 15, 2010 at 5:06 PM, L.A. ro...@millect.com wrote: Hey Guys,  It sure seems I get stuck on things that should be easy. Heres my question: PARCELS-by(ResImp[ ,

[R] bootstrapping

2010-01-15 Thread aaron.foley
Hi All, I'm new to R so please bear with me. I have a dataset with 337 turn angles ranging from -180 to 180 degrees. I need to bootstrap (sample with replacement) 1,000 times to create expected average turn angle with 95% CIs. The code is pretty straightforward (-boot(data =, statistic

[R] 'nlme' library - lme function results

2010-01-15 Thread Michal Figurski
Dear R-helpers I am running a simple mixed effects model using lme(). The call looks like this: fit - lme(Analyte~Sample, data=Data, random=~1 | Run) I am particularly interested in the estimated random effects. When I print the 'fit' object, it looks something like example below: (...)

[R] Possible to write text inside a bar of a barplot?

2010-01-15 Thread Rex C. Eastbourne
How can I write text inside a bar of a barplot? I tried using text(), but I am only able to specify the numeric y-coordinate. The different columns of my barplot correspond to factors and not numbers, so I don't know how to access the horizontal positions of the bars. I tried fiddling with

Re: [R] R package dependencies

2010-01-15 Thread Seth Falcon
On 1/13/10 11:21 AM, James W. MacDonald wrote: Hi Colin, The pkgDepTools package from Bioconductor will help with question #1: http://bioconductor.org/packages/2.5/bioc/html/pkgDepTools.html I am not positive on this, but I believe this package is also used to determine the reverse

[R] (no subject)

2010-01-15 Thread saleem mukhtar
Hello, I am running R on cygwin for windows. File R1234 contains data - read.table(data) q() On the command line I type R --no-save -q R_PROFILE=R1234 returns Error: could not find function read.table THanks. __ R-help@r-project.org

Re: [R] advice/opinion on quot; lt; -quot; vs quot; =quot; in teaching R

2010-01-15 Thread Douglas Bates
On Fri, Jan 15, 2010 at 10:00 AM, Ben Bolker bol...@ufl.edu wrote: John Kane jrkrideau at yahoo.ca writes: I've only been using R for about 2.5 years but and I'm not all that good  but I vote for - . I think the deciding factor is in  RSiteSearch() and the various manuals. Almost

Re: [R] Possible to write text inside a bar of a barplot?

2010-01-15 Thread Rex C. Eastbourne
Thanks for the replies! The answer is that barplot() returns the x coordinates of the bars. On Fri, Jan 15, 2010 at 12:01 PM, Rex C. Eastbourne rex.eastbou...@gmail.com wrote: How can I write text inside a bar of a barplot? I tried using text(), but I am only able to specify the numeric

Re: [R] Eigenvectors and values in R and SAS

2010-01-15 Thread Juliet Hannah
Here is an example that may be helpful. A - matrix(c(-3,5,4,-2),nrow=2,byrow=TRUE) eigs - eigen(A) eigs $values [1] -7 2 $vectors [,1] [,2] [1,] -0.7808688 -0.7071068 [2,] 0.6246950 -0.7071068 The eigenvectors may be scaled differently because they are not unique (or have a

Re: [R] Can I save R graphs as a R objects

2010-01-15 Thread Greg Snow
As a general rule, you really do not want to edit graphs by pointing/clicking/dragging. It may seem an easy way to make some modifications, but in the long run it will become more of a headache than a help. Better to create a script with the commands to create the plot, then if there is some

[R] randomForest maxnodes

2010-01-15 Thread Epic John
Has anyone sucessfully used the maxnodes feature in randomForest? I tried setting it, but when it is non-NULL I always get back a forest in which all trees have size 1. I am using a continuous response (regression). Any help would be appreciated. Thanks. [[alternative HTML version

Re: [R] (no subject)

2010-01-15 Thread milton ruser
Saleem, I have no idea about this, but may be you can use other data.frame name instead of data because data is a name of a function (see ?data). good luck milton On Fri, Jan 15, 2010 at 3:33 PM, saleem mukhtar saleem...@yahoo.com wrote: Hello, I am running R on cygwin for windows. File

[R] weighting (survey) data

2010-01-15 Thread vivi ane
Hi, is there a function in R equivalent to the weight by-command in SPSS? I'm working with survey datasets and the data need to be weighted by a survey/ probability/ design weight (to compensate for different probabilities to be included in the sample in each country). The weight variables are

Re: [R] weighting (survey) data

2010-01-15 Thread David Winsemius
On Jan 15, 2010, at 5:13 PM, vivi ane wrote: Hi, is there a function in R equivalent to the weight by-command in SPSS? I'm working with survey datasets and the data need to be weighted by a survey/ probability/ design weight (to compensate for different probabilities to be included in the

Re: [R] (no subject)

2010-01-15 Thread Bert Gunter
?Startup Read this help page **carefully**. It tells you what happens when R starts up. The profile file is executed with **only the base package loaded**, and read.table is not in the base package. If you replace your read statement with data - utils::read.table(data) it would work (if there

Re: [R] randomForest maxnodes

2010-01-15 Thread Liaw, Andy
Please try to follow the posting guide and give a reproducible example, as below: R library(randomForest) randomForest 4.5-34 Type rfNews() to see new features/changes/bug fixes. R iris2 = iris[-5] R iris.rf = randomForest(Petal.Width~., iris2, maxnodes=4, ntree=50) R nodesize(iris.rf) Error:

Re: [R] bootstrapping

2010-01-15 Thread Stephan Kolassa
Hi Aaron, try the argument statistic=mean. Then boot() will give you the mean turn angle in your actual data (which appears to be 6 degrees, judging from what you write), as well as the means of the bootstrapped data. Then you can get (nonparametric) bootstrap CIs by

  1   2   >