[R] Help with Using gtext in gWidgetsWWW for Outputting Results to Webpage

2011-05-07 Thread Ron Fricker
All: Using gWidgetsWWW, I'm in the process of designing a website that will provide users with a GUI to interact with various datasets. As part of that, I want to provide users the ability select particular variables (via combo boxes) that will then result in summary (text) output being returned

[R] save and load user modifications of options

2011-05-07 Thread xwang14
Hi, Could anyone help me with the following problem? After I finished a R session and modified some options (for example, set options(editor=neditor)), I want save these modifications so that after I load the saved R data I do not need to modify these options again. What is the best way to do

[R] Convenience-at-the-expense-of-clarity (was: quantmod's addTA plotting functions)

2011-05-07 Thread Russ Abbott
Thanks, Writing plot(addTA()) worked fine. I find myself with such mixed feelings about R. After finding that addTA worked fine at the command line but not in a function, I puzzled for a long time about what kind of virtual machine structure could possibly account for that. I couldn't think of

Re: [R] Convenience-at-the-expense-of-clarity (was: quantmod's addTA plotting functions)

2011-05-07 Thread Joshua Wiley
On Fri, May 6, 2011 at 11:38 PM, Russ Abbott russ.abb...@gmail.com wrote: snip That's my rant for today. If you use Emacs, I recommend: M-x doctor RET Cheers, Josh P.S. Many package authors would love help writing documentation (it is often on their to-do lists somewhere slogged behind

Re: [R] Custom Zero equivalent in R

2011-05-07 Thread Petr Savicky
On Fri, May 06, 2011 at 11:49:30AM -0700, Megh Dal wrote: Hi all, I am to find some way on how I can tell R to use this small number 10^-20 as zero by default. This means if any number is below this then that should be treated as negative, or if I divide something by any number less than

Re: [R] Convenience-at-the-expense-of-clarity (was: quantmod's addTA plotting functions)

2011-05-07 Thread Jeff Newmiller
There is a simple principle to remember: interactively, R evaluates expressions and prints them. If the expression returns a simple object like a numeric vector, it prints in the obvious way. When the result is more complex, like an lm object, it uses a custom print function and you see a

Re: [R] Simple loop

2011-05-07 Thread peter dalgaard
On May 4, 2011, at 17:52 , William Dunlap wrote: -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Petr Savicky Sent: Wednesday, May 04, 2011 12:51 AM To: r-help@r-project.org Subject: Re: [R] Simple loop On Tue, May 03,

Re: [R] functions pandit and treebase in the package apTreeshape

2011-05-07 Thread Arnau Mir
El 06/05/11 01:33, Andrew Robinson escribió: Hi Arnau, please send the output of sessionInfo() and the exact commands and response that you used to install and load apTreeshape. Here It is: sessionInfo() R version 2.12.1 (2010-12-16) Platform: x86_64-pc-linux-gnu (64-bit) locale: [1]

Re: [R] functions pandit and treebase in the package apTreeshape

2011-05-07 Thread Arnau Mir
El 07/05/11 09:49, Arnau Mir escribió: El 06/05/11 01:33, Andrew Robinson escribió: Hi Arnau, please send the output of sessionInfo() and the exact commands and response that you used to install and load apTreeshape. Sorry, I forgot the commands. Here they are: library(apTreeshape)

Re: [R] functions pandit and treebase in the package apTreeshape

2011-05-07 Thread Andrew Robinson
Thanks! As noted by an earlier poster, these functions seem to have been removed from the package. It might be worth contacting the maintainer to ask if any equivalents are available ... Cheers Andrew On Sat, May 07, 2011 at 09:56:49AM +0200, Arnau Mir wrote: El 07/05/11 09:49, Arnau Mir

Re: [R] R forum for only Statistics

2011-05-07 Thread Gavin Simpson
On Thu, 2011-04-28 at 05:41 -0700, Jeremy Hetzel wrote: Vincy, In addition to the R-help mailing list, other forums for R and statistics that I go to include: Stackoverflow's R tagged questions http://stackoverflow.com/questions/tagged/r SO is *not* meant for statistical Q's - R or

Re: [R] maximum likelihood convergence reproducing Anderson Blundell 1982 Econometrica R vs Stata

2011-05-07 Thread peter dalgaard
On May 6, 2011, at 14:29 , Alex Olssen wrote: Dear R-help, I am trying to reproduce some results presented in a paper by Anderson and Blundell in 1982 in Econometrica using R. The estimation I want to reproduce concerns maximum likelihood estimation of a singular equation system. I can

Re: [R] Insert values to histogram

2011-05-07 Thread JCFaria
Hi, A new version of the package fdth (1.1-4) was released today. More than one person have been requesting this option, so, it was incorporated in the methods (S3) to plot a fdth object. This task will be more easy now. For example: library(dfth) plot(fdt(iris), v=TRUE, cex=.8) # for histogram

[R] Exporting list with unequal length of rows

2011-05-07 Thread ashutosh srivastava
Dear users I have received an output from one of the functions of igraph. The output is in the following form [[1]] [1] 1 196 94 89 92 197 0 [[2]] [1] 1 [[3]] [1] 1 196 97 193 4 [[4]] [1] 1 194 97 193 4 [[5]] [1] 1 194 97 193 4 6 [[6]] [1] 1 196 97 193 4 6

Re: [R] Evaluating a multivariable function XXXX

2011-05-07 Thread Dan Abner
Hello everyone, I have the following R code for a multivariable function: fn2-function(x,y,z){(y+2*z)/(5*y-x*z)} fn2(-5,-2,3) [1] 0.8 No problems. === If, however, I call the function using a vector substitution for the arguments, R sees this as 3 separate calls to the

[R] Printing a title for an object in the console when writing a function XXXX

2011-05-07 Thread Dan Abner
Hello everyone, What is the best way to have R print a title and then skip a line (both without the [1] line preffix) when writing a function that prints an object (to the console)? Simplified example: fn3-function(x,y){ c1-cov(x,y) print(c1)} data1-data.frame(age=rnorm(50),weight=rnorm(50))

Re: [R] save and load user modifications of options

2011-05-07 Thread David Winsemius
On May 6, 2011, at 8:59 PM, xwang14 wrote: Hi, Could anyone help me with the following problem? After I finished a R session and modified some options (for example, set options(editor=neditor)), I want save these modifications so that after I load the saved R data I do not need to modify

Re: [R] Exporting list with unequal length of rows

2011-05-07 Thread David Winsemius
On May 7, 2011, at 6:54 AM, ashutosh srivastava wrote: Dear users I have received an output from one of the functions of igraph. The output is in the following form [[1]] [1] 1 196 94 89 92 197 0 [[2]] [1] 1 [[3]] [1] 1 196 97 193 4 [[4]] [1] 1 194 97 193 4 [[5]] [1]

Re: [R] Evaluating a multivariable function XXXX

2011-05-07 Thread Duncan Murdoch
On 11-05-07 4:06 AM, Dan Abner wrote: Hello everyone, I have the following R code for a multivariable function: fn2-function(x,y,z){(y+2*z)/(5*y-x*z)} fn2(-5,-2,3) [1] 0.8 No problems. === If, however, I call the function using a vector substitution for the arguments, R sees this as

Re: [R] (no subject)

2011-05-07 Thread Dennis Murphy
Hi: To quote one of the sages of this list: 'Loops? We don't need no steenking loops!!'. Here's one way to do what you were asking with a two-pass approach. Generate some random data, use the sample() function to get 20 indices which are then used to generate NAs in the original vector. Then

Re: [R] Printing a title for an object in the console when writing a function XXXX

2011-05-07 Thread David Winsemius
On May 7, 2011, at 4:16 AM, Dan Abner wrote: Hello everyone, What is the best way to have R print a title and then skip a line (both without the [1] line preffix) when writing a function that prints an object (to the console)? Simplified example: fn3-function(x,y){ c1-cov(x,y)

[R] venn diagramm

2011-05-07 Thread khush ........
Dear all, I have a set of five datasets with string, for which I need to draw the venn diagram. there are tools available to draw venn diagram online, but limited to three sets. I can also generate venn for three from limma package, but do not know how to proceed with five subsets. Help me in

Re: [R] Confidence intervals and polynomial fits

2011-05-07 Thread Ben Haller
On May 6, 2011, at 4:27 PM, David Winsemius wrote: On May 6, 2011, at 4:16 PM, Ben Haller wrote: As for correlated coefficients: x, x^2, x^3 etc. would obviously be highly correlated, for values close to zero. Not just for x close to zero: cor( (10:20)^2, (10:20)^3 ) [1] 0.9961938

[R] write.table vs. read.table and the argument fill

2011-05-07 Thread Carl Witthoft
Just wondering how come read.table lets you specify fill=TRUE for ragged arrays, but so far as I can tell, no equivalent for write.table? Not a big deal, since I'm perfectly comfortable w/ write and scan and the other file I/O goodies. A foolish inconsistency... and all that. Carl

Re: [R] Simple loop

2011-05-07 Thread Hadley Wickham
Using paste(Site,Prof) when calling ave() is ugly, in that it forces you to consider implementation details that you expect ave() to take care of (how does paste convert various types to strings?).  It also courts errors  since paste(A B, C) and paste(A, B C) give the same result but

Re: [R] maximum likelihood convergence reproducing Anderson Blundell 1982 Econometrica R vs Stata

2011-05-07 Thread Ravi Varadhan
There is something strange in this problem. I think the log-likelihood is incorrect. See the results below from optimx. You can get much larger log-likelihood values than for the exact solution that Peter provided. ## model 18 lnl - function(theta,y1, y2, x1, x2, x3) { n - length(y1)

Re: [R] Help with Using gtext in gWidgetsWWW for Outputting Results to Webpage

2011-05-07 Thread jverzani
Ron Fricker rdfricker at nps.edu writes: Ron, A few things. I am in the process of rewriting this package to use the new Rook package. The current package is on r-forge as gWidgetsWWW2. It works for local use, but Rook isn't yet integrated in with rapache to serve in a public way.

Re: [R] Simple loop

2011-05-07 Thread peter dalgaard
On May 7, 2011, at 17:21 , Hadley Wickham wrote: Well, ave() uses interaction(...) and interaction() has a drop argument, so with(x, ave(H, Site, Prof, drop=TRUE, FUN=function(y)y-min(y))) [1] 8 0 51 0 33 22 21 0 I don't understand why this isn't the default. Hadley Defensive

Re: [R] Help with Using gtext in gWidgetsWWW for Outputting Results to Webpage

2011-05-07 Thread jverzani
jverzani jverzani at gmail.com writes: I was remiss in not mentioning the use of the nifty hwriter package for formatting tables for display through ghtml as an alternative to using gtext for what you want to do. See the package description at: http://www.embl.de/~gpau/hwriter/ --John

Re: [R] Simple loop

2011-05-07 Thread Jeff Newmiller
Cannot revert it? Doesn't setting up a new default parameter in the calling function (ave) accomplish that? --- Jeff Newmiller The . . Go Live... DCN:jdnew...@dcn.davis.ca.us Basics: ##.#. ##.#. Live Go... Live: OO#..

Re: [R] venn diagramm

2011-05-07 Thread Breheny, Patrick
I've never actually used it with 5 subsets, but the 'venn' function in the gplots package claims to be able to make a Venn diagram with up to 5 subsets. --Patrick From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] On Behalf Of khush

[R] (no subject)

2011-05-07 Thread Giulio Di Giovanni
http://kabarknives.handmadebestgifts.com/wp-content/plugins/mylife.html [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do

[R] help!! warning:only the first element has been used

2011-05-07 Thread pwldk
i simply want a set of numbers in a vector which: in the vector v, i want the numbers be (x[1]*x[2]**x[100], x[2]*x[3]*...*x[100], x[3]*x[4]*...*x[100],...,x[98]*x[99]*x[100], x[99]*x[100],x[100]) so there should be 100 elements in the vector. here's how i do it x=rnorm(100,0.5,0.2)

[R] Cannot read in a csv file.

2011-05-07 Thread John Kane
Can anyone suggest why this file http://www.mediafire.com/?afeyhhpacaq is refusing to open for me.? I must admit I don't know all its history but the original data was taken from an OOo spreadsheet that I edited (good bit of copying and pasting and the month variable added by hand in OOo

Re: [R] help!! warning:only the first element has been used

2011-05-07 Thread Dennis Murphy
Hi: Try sapply(1:length(x), function(y) prod(x[y:length(x)])) HTH, Dennis On Sat, May 7, 2011 at 9:37 AM, pwldk pw...@hotmail.com wrote: i simply want a set of numbers in a vector which: in the vector v, i want the numbers be (x[1]*x[2]**x[100], x[2]*x[3]*...*x[100],

Re: [R] help!! warning:only the first element has been used

2011-05-07 Thread Ravi Varadhan
x - 1:5 rev(cumprod(rev(x))) rev(cumprod(rev(x))) [1] 120 120 60 20 5 Ravi. From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] On Behalf Of pwldk [pw...@hotmail.com] Sent: Saturday, May 07, 2011 12:37 PM To: r-help@r-project.org

Re: [R] Compiling Rgraphiz on Windows 7 64bit with R-2.13.0

2011-05-07 Thread Ben Rhelp
Hi Martin, Thanks a lot for your help. this was spot on. With your instructions, I manage to successfully compile Rgraphiz. thanks again. regards, Ben - Original Message From: Martin Morgan mtmor...@fhcrc.org To: Ben Rhelp benrh...@yahoo.co.uk Cc: r-help@r-project.org Sent:

Re: [R] how to calculate the mean of a group in a table

2011-05-07 Thread Pete Brecknock
tornanddesperate wrote: Hi its me again I don't mean to get on your nerves, but the use of R proofs to be a bit more complicated than envisaged. I would like to calculate the mean of a group of values, here wage_accepted. The group is determined by the stage and period, so in the end

Re: [R] maximum likelihood convergence reproducing Anderson Blundell 1982 Econometrica R vs Stata

2011-05-07 Thread peter dalgaard
On May 7, 2011, at 17:51 , Ravi Varadhan wrote: There is something strange in this problem. I think the log-likelihood is incorrect. See the results below from optimx. You can get much larger log-likelihood values than for the exact solution that Peter provided. ## model 18 lnl -

[R] spdep::poly2nb problem

2011-05-07 Thread Philip A. Viton
I downloaded a US states+territories shapefile from http://www.weather.gov/geodata/catalog/national/html/us-state.htm and unzipped it into my working directory. Then in R (version 12.2.0 for ms-win32): library(rgdal) # Version: 0.6-28 library(spdep) # Version: 0.5-24 (loads sp: Version:

[R] how to calculate the mean of a group in a table

2011-05-07 Thread tornanddesperate
Hi its me again I don't mean to get on your nerves, but the use of R proofs to be a bit more complicated than envisaged. I would like to calculate the mean of a group of values, here wage_accepted. The group is determined by the stage and period, so in the end there should be a column with the

Re: [R] how to calculate the mean of a group in a table

2011-05-07 Thread David Winsemius
On May 7, 2011, at 2:24 PM, tornanddesperate wrote: Hi its me again I don't mean to get on your nerves, but the use of R proofs to be a bit more complicated than envisaged. I would like to calculate the mean of a group of values, here wage_accepted. The group is determined by the stage

Re: [R] Cannot read in a csv file.

2011-05-07 Thread Duncan Murdoch
On 11-05-07 1:26 PM, John Kane wrote: Can anyone suggest why this file http://www.mediafire.com/?afeyhhpacaq is refusing to open for me.? I must admit I don't know all its history but the original data was taken from an OOo spreadsheet that I edited (good bit of copying and pasting and the

[R] generate multiple mvrnorm samples using apply-like

2011-05-07 Thread Michael Friendly
I want to generate multiple multivariate normal samples with different mean vectors and common covariance matrix. I can do this with a loop, but can't quite figure out how to do it with apply and friends. In the example below, I want values to have 3 columns: group, x, y # number of groups,

[R] how to not match partial names

2011-05-07 Thread William Revelle
Dear friends, How do I stop partial matching of list names? e.g., x - list(=a, B=b) is.null(x$A) #returns FALSE even though there is no element A. if(is.null(x$A)) {result - x$} else {result - x$A} result #is even though there is no x$A element x -

Re: [R] Cannot read in a csv file.

2011-05-07 Thread John Kane
--- On Sat, 5/7/11, Duncan Murdoch murdoch.dun...@gmail.com wrote: From: Duncan Murdoch murdoch.dun...@gmail.com Subject: Re: [R] Cannot read in a csv file. To: John Kane jrkrid...@yahoo.ca Cc: r-help@r-project.org Received: Saturday, May 7, 2011, 4:20 PM On 11-05-07 1:26 PM, John Kane

Re: [R] how to not match partial names

2011-05-07 Thread Thomas Lumley
On Sun, May 8, 2011 at 11:09 AM, William Revelle li...@revelle.net wrote: Dear friends, How do I stop partial matching of list names? e.g., x - list(=a, B=b) is.null(x$A)   #returns FALSE  even though there is no element A. if(is.null(x$A))  {result -  x$} else

Re: [R] how to not match partial names

2011-05-07 Thread Duncan Murdoch
On 07/05/2011 7:09 PM, William Revelle wrote: Dear friends, How do I stop partial matching of list names? e.g., x- list(=a, B=b) is.null(x$A) #returns FALSE even though there is no element A. if(is.null(x$A)) {result- x$} else {result- x$A} result #is even

Re: [R] how to not match partial names

2011-05-07 Thread Tóth Dénes
Dear friends, How do I stop partial matching of list names? e.g., x - list(=a, B=b) is.null(x$A) #returns FALSE even though there is no element A. if(is.null(x$A)) {result - x$} else {result - x$A} result #is even though there is no x$A element x -

Re: [R] Bigining with a Program of SVR

2011-05-07 Thread Max Kuhn
As far as caret goes, you should read http://cran.r-project.org/web/packages/caret/vignettes/caretVarImp.pdf and look at rfe() and sbf(). On Fri, May 6, 2011 at 2:53 PM, ypriverol yprive...@gmail.com wrote: Thanks Max. I'm using now the library caret with my data. But the models showed a

[R] X-SQUARED of resids ?

2011-05-07 Thread katerinaaa
Hi all, I am trying to compute X-SQUARED from normality test of resids for the regression with xaa variable dependent variable and independent variable aus Could you help me please ? Thanks a lot -- View this message in context:

Re: [R] X-SQUARED of resids ?

2011-05-07 Thread David Winsemius
On May 7, 2011, at 5:57 PM, katerinaaa wrote: Hi all, I am trying to compute X-SQUARED from normality test of resids for the regression with xaa variable dependent variable and independent variable aus Could you help me please ? Would it help to be offered the extractor function for

Re: [R] generate multiple mvrnorm samples using apply-like

2011-05-07 Thread Dennis Murphy
Hi: Does this work? v - lapply(1:nrow(means), function(j) mvrnorm(n, means[j, ], Sigma, empirical = TRUE)) vals - cbind(group = rep(1:nrow(means), each = n), do.call(rbind, v)) HTH, Dennis On Sat, May 7, 2011 at 3:34 PM, Michael Friendly frien...@yorku.ca wrote: I want to generate multiple

Re: [R] write.table vs. read.table and the argument fill

2011-05-07 Thread Joshua Wiley
Hi Carl, What would the equivalent argument for write.table do? Or perhaps to rephrase my question what type of R object do you have in mind to write that is a ragged array? Josh On Sat, May 7, 2011 at 7:38 AM, Carl Witthoft c...@witthoft.com wrote: Just wondering how come read.table lets you

[R] The 4th Chinese R Conference (Beijing, May 28, 2011)

2011-05-07 Thread Yihui Xie
Hi all, Just a short announcement that the 4th Chinese R Conference (ChinaR) will take place at the Renmin University of China (Beijing session) on May 28, 2011. Since 2008 we have been holding ChinaR conferences in Beijing (summer) and Shanghai (winter) each year. This conference is mainly for