Re: [R] Package 'operators'

2009-07-02 Thread Romain Francois
My point is your problem is not entirely related to this package in particular but more "should I trust additional R packages", ie should I use package cron when R can handle date objects, should I use ggplot when i could do it all in grid, ... operators comes with unit tests that allow me to

[R] Query

2009-07-02 Thread MINI GHOSH
Dear R-User, Is it possible to simulate Impulsive differential equation using R? If yes, please let me know how? Thanking you, Best Regards, Mini Ghosh See the Web's breaking stories, chosen by people like you. Check out Yahoo! Buzz. http://in.buzz.yahoo.com/

Re: [R] How to use current value of variable in function definition?

2009-07-02 Thread Mark Wardle
2009/7/2 Peter Dalgaard : > Mark Wardle wrote: >> [...] >> Otherwise, it sounds like a recipe for obfuscation! What are you >> trying to do really? > > Not really obfuscation, there are legitimate reasons to want this sort of > behaviour. See demo(scoping) for a related example > [...] I would hav

Re: [R] Backward logistic regression

2009-07-02 Thread Tal Galili
If the daya set is not "too big", I believe the easiest will be: stepAIC from the MASS package... On Thu, Jul 2, 2009 at 11:21 PM, Angela Radulescu < angela.radule...@gmail.com> wrote: > Hi, > > I have performed a binary logistic regression using the glm ( family = > binomial("logit") )comm

Re: [R] Computer Modern

2009-07-02 Thread Paul Murrell
Hi Also see http://www.stat.auckland.ac.nz/~paul/R/CM/CMR.html Paul (Ted Harding) wrote: On 02-Jul-09 09:06:44, Mr Derik wrote: I am trying to use computer modern fonts in postscript files for a latex document. Ultimately I want to automate this through sweave. I've read the documentation an

Re: [R] symbols duplicated in plot output

2009-07-02 Thread Paul Murrell
Hi There's now a fix in the development version of R. Paul Paul Murrell wrote: Hi It is indeed a bug. Should have a fix soon. Thanks for the report! Paul baptiste auguie wrote: Thanks for the info. It does look like a bug to me, but it's always best to try and identify the cause befor

Re: [R] sum of list elements

2009-07-02 Thread David Winsemius
On Jul 2, 2009, at 11:24 PM, David Winsemius wrote: On Jul 2, 2009, at 10:20 PM, Ivo Shterev wrote: a = list(diag(3), diag(3), diag(3)) a = list(diag(3), diag(3), diag(3)) > sum(unlist(a)) [1] 9 Also: > sum(sapply(a,I)) [1] 9 David Winsemius, MD Heritage Laboratories West Hartford,

Re: [R] sum of list elements

2009-07-02 Thread David Winsemius
On Jul 2, 2009, at 10:20 PM, Ivo Shterev wrote: a = list(diag(3), diag(3), diag(3)) a = list(diag(3), diag(3), diag(3)) > sum(unlist(a)) [1] 9 David Winsemius, MD Heritage Laboratories West Hartford, CT __ R-help@r-project.org mailing list https

Re: [R] sum of list elements

2009-07-02 Thread Richard M. Heiberger
I think you are asking for Reduce > Reduce(`+`, a) [,1] [,2] [,3] [1,]300 [2,]030 [3,]003 > You might be asking for do.call with some function's name as its first argument. > do.call("sum", a) [1] 9 > __ R-h

Re: [R] Passing expression as argument to do.call

2009-07-02 Thread Sebastien . Bihorel
Damned, I did tried as.list but not list... Thanks Hadley and Duncan for your quick replies > On Thu, Jul 2, 2009 at 3:34 PM, Sebastien > Bihorel wrote: >> Dear R-users, >> >> I would like to know how expressions could be passed as arguments to >> do.call >> functions. As illustrated in the short

[R] sum of list elements

2009-07-02 Thread Ivo Shterev
Dear All, Is there an automatic way to sum the elements of a list? For example given a = list(diag(3), diag(3), diag(3)) to obtain b=a[1]+a[2]+a[3]. Thanks Ivo __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE d

[R] mapping states with colors

2009-07-02 Thread Donald Braman
Hi folks, I'm just learning how to use maps. As an initial foray, I'm mapping the states that have "duty to retreat" (blue) and "stand your ground" (red) self-defense standards. Here is my extremely naive script: dtr <- c('alabama', 'arizona', 'conneticut', 'delaware', 'dist of columbia' , 'hawa

[R] Thanks to all who commented on my code

2009-07-02 Thread Murray Cooper
As I said, I am new to R after spending far too many years using SAS. I'm slowly getting the hang of R and like it very much. Thanks for your insights and help. Murray M Cooper, Ph.D. Richland Statistics 9800 N 24th St Richland, MI, USA 49083 Mail: richs...@earthlink.net __

Re: [R] Plot two graphs with different ranges in one

2009-07-02 Thread Mark Knecht
On 7/2/09, Rolf Turner wrote: > > On 3/07/2009, at 11:29 AM, Hongwei Dong wrote: > > > > Hi, I'm trying to plot two variables in one graph. One ranges between 0 > and > > 1, while the other ranges between 50 and 500. Can I plot them in one graph > > with similar scale? > > > > Yes you can, but D

Re: [R] Plot two graphs with different ranges in one

2009-07-02 Thread Rolf Turner
On 3/07/2009, at 11:29 AM, Hongwei Dong wrote: Hi, I'm trying to plot two variables in one graph. One ranges between 0 and 1, while the other ranges between 50 and 500. Can I plot them in one graph with similar scale? Yes you can, but DON'T!!! Such graphs are terribly misleading and co

Re: [R] Getting identify() to work with lattice::cloud()

2009-07-02 Thread Deepayan Sarkar
On Thu, Jul 2, 2009 at 10:11 AM, Robert A. LaBudde wrote: > I don't seem to be able to put any syntax into identify() that gets it to > work with "lattice" cloud() graph: > > layout(1) > require('lattice') > cloud(g3 ~ g1 + g2, data=gapp, col = "blue", >  xlab='G1 Score', ylab='G2 Score', >  zlab='

Re: [R] another xyplot question

2009-07-02 Thread Deepayan Sarkar
On Wed, Jul 1, 2009 at 10:38 PM, jlfmssm wrote: > I have a data set like this > > ID=c("A","A","A","A","A","A","A","B","B","B","B","B","B","B") > s=c(1.1,2.2,1.3,1.1,3.1,4.1,4.2,1.1,2.2,1.3,1.1,3.1,4.1,4.2) > d=c(1,2,3,4,5,6,7,1,2,3,4,5,6,7) > t=c(-3,-1,0,1,2,3,4,-3,-2,-1,0,1,2,3) > > mydata<-data.

[R] Plot Fonts in Windows vs Mac OSX

2009-07-02 Thread Sean Carmody
I have been plotting the same charts using png on a Windows machine and on a Mac OSX and the quality of the resulting images, particularly in relation to the fonts, look far superior in the plots produced on the Mac. Is there any way I can enhance the quality of the plots produced on the Windows ma

Re: [R] How to use current value of variable in function definition?

2009-07-02 Thread Gabor Grothendieck
The proto package generalizes this to an OO approach based on the prototype or object-based model of OO. This corresponds to the previous code: library(proto) p <- proto(c = 1, foo = function(.) print(.$c)) p$foo() # 1 # but now we can also create q which overrides c # while inheriting foo from

Re: [R] Box Plot outliers label

2009-07-02 Thread Raphael Saldanha
Works very well for me! Very thanks! 2009/7/2 Henrique Dallazuanna > Try something about like this: > > bp <- boxplot(x ~ id, data = DF) > text(bp$group, bp$out, labels = "Teste", pos = 3) > > > On Thu, Jul 2, 2009 at 7:40 PM, Raphael Saldanha < > saldanha.plan...@gmail.com> wrote: > >> Hi! >> >

Re: [R] Box Plot outliers label

2009-07-02 Thread Henrique Dallazuanna
Try something about like this: bp <- boxplot(x ~ id, data = DF) text(bp$group, bp$out, labels = "Teste", pos = 3) On Thu, Jul 2, 2009 at 7:40 PM, Raphael Saldanha wrote: > Hi! > > How can I add labels in the outliers inside a boxplot. > > Here is my code, at now: > > mun <- as.data.frame(read.

Re: [R] How to use current value of variable in function definition?

2009-07-02 Thread Nordlund, Dan (DSHS/RDA)
Alan, Doesn't Peter Dalgaard's response get you what you originally asked for? You said you wanted something like: > if (1) { c <- 1; foo <- function () print(c); } >c <- 2 >foo() Based on Peter's email you could do > c <- 1 > foo <- local({x <- c; function() print(x) }) > foo() [1] 1 > c <-

[R] Plot two graphs with different ranges in one

2009-07-02 Thread Hongwei Dong
Hi, I'm trying to plot two variables in one graph. One ranges between 0 and 1, while the other ranges between 50 and 500. Can I plot them in one graph with similar scale? Thanks Harry [[alternative HTML version deleted]] __ R-help@r-project.o

Re: [R] Package 'operators'

2009-07-02 Thread Seeliger . Curt
Thanks for replying, Francois. To directly answer your question, the difference between using base R functions and a library comes down to code correctness and stability, as well as future support. Portions of the language, whether in base or in packages, which have been around a long time, o

[R] Box Plot outliers label

2009-07-02 Thread Raphael Saldanha
Hi! How can I add labels in the outliers inside a boxplot. Here is my code, at now: mun <- as.data.frame(read.csv2("consolidada_v3.csv")) micro <- mun$nmicro medprop <- mun$medprop mimedprop <- split(medprop, micro) boxplot(mimedprop, col="chartreuse3", main="Área média das propriedades rurai

Re: [R] Package 'operators'

2009-07-02 Thread Romain Francois
How is this different to dependency on regular functions ? On 07/02/2009 10:29 PM, seeliger.c...@epamail.epa.gov wrote: Folks, In brief -- how many of you have found the 'operators' package to be valuable in their work? Not that I lack respect for the amount of work involved in creating and ma

Re: [R] How to use current value of variable in function definition?

2009-07-02 Thread William Dunlap
From: Allan Engelhardt [mailto:all...@cybaea.com] Sent: Thursday, July 02, 2009 11:12 AM To: William Dunlap Cc: r-help@r-project.org Subject: Re: [R] How to use current value of variable in function definition?

Re: [R] save the result into a word file

2009-07-02 Thread John Kane
I don't know any direct way. ?sink perhaps and then load into Word. You might want to have a look at R2HTML as well. Alternatively have a look at Sweave for output in pdf or OOo formats. --- On Thu, 7/2/09, Suyan Tian wrote: > From: Suyan Tian > Subject: [R] save the result into a word f

Re: [R] Passing expression as argument to do.call

2009-07-02 Thread hadley wickham
On Thu, Jul 2, 2009 at 3:34 PM, Sebastien Bihorel wrote: > Dear R-users, > > I would like to know how expressions could be passed as arguments to do.call > functions. As illustrated in the short example below, concatenating lists > objects and an expression creates an expression object, which is no

Re: [R] working with texts

2009-07-02 Thread Don MacQueen
From the CRAN task view on natural language processing: (package) tm provides a comprehensive text mining framework for R. The Journal of Statistical Software article Text Mining Infrastructure in R gives a detailed overview and presents techniques for count-based analysis methods, text c

Re: [R] Passing expression as argument to do.call

2009-07-02 Thread Duncan Murdoch
On 7/2/2009 4:34 PM, Sebastien Bihorel wrote: Dear R-users, I would like to know how expressions could be passed as arguments to do.call functions. As illustrated in the short example below, concatenating lists objects and an expression creates an expression object, which is not an acceptable

Re: [R] constrained optimisation in R.

2009-07-02 Thread Ravi Varadhan
An errratum to my previous email: In your problem, you can do as follows: f <- function(par, data, lambda1, lambda2) loglik(par, data) - lambda1 * (sum(Ai))^2 - lambda2 * (sum(Di))^2 Note the correct negative signs in front of the penalty terms. Ravi. ---

[R] Backward logistic regression

2009-07-02 Thread Angela Radulescu
Hi, I have performed a binary logistic regression using the glm ( family = binomial("logit") )command on 6 IV's and one DV. I would like to now repeat the regression in backward fashion. What is the easiest way to do so in R? Thanks in advance! Best, Angela [[alternative HTML version de

Re: [R] How to use current value of variable in function definition?

2009-07-02 Thread Peter Dalgaard
Mark Wardle wrote: Hi. I've stared at your code for a number of minutes and can't understand what you're trying to achieve here. It looks as if you're fighting scope - it may be worth refactoring your approach to simplify matters. Otherwise, it sounds like a recipe for obfuscation! What are you

[R] Passing expression as argument to do.call

2009-07-02 Thread Sebastien Bihorel
Dear R-users, I would like to know how expressions could be passed as arguments to do.call functions. As illustrated in the short example below, concatenating lists objects and an expression creates an expression object, which is not an acceptable argument for do.call. Is there a way to avoid

Re: [R] Name of data.frame as a text string?

2009-07-02 Thread Duncan Murdoch
On 7/2/2009 3:33 PM, Mark Knecht wrote: On 7/2/09, Don MacQueen wrote: Use deparse(substitute(df)) Example from ?deparse: function(x, y) { plot(x, y, xlab=deparse(substitute(x)), ylab=deparse(substitute(y))) } -Don Now that's interesting... deparsed mean

Re: [R] help exporting to excel via xlsReadWritePro

2009-07-02 Thread Hans-Peter Suter
> I’m trying to export a file from R to excel using the xlsReadWritePro > function and I keep getting the error below. POSIXt is not currently supported (neither in data.frames nor vectors) and must be converted to other types (see ?write.xls). I almost never use POSIXlt/ct myself but it would pr

Re: [R] Warning when trying to access a variable out of scope?

2009-07-02 Thread Duncan Murdoch
On 7/2/2009 2:17 PM, Steve Lianoglou wrote: Hi, I was wondering if I could get R to warn me, or give me a rude awakening somehow, if I'm accessing a variable that is out of my function's scope. For example, often times I'm creating a function as I'm testing it in the REPL, copying and pa

Re: [R] lpSolve: how to allow variables to become negative

2009-07-02 Thread Rob Helpert
Sorry. Of course, I meant the DIFFERENCE of two non-negative variables. So, for example, write b1 = b1p - b1n, where both b1p and b1n are non-negative. On Thu, Jul 2, 2009 at 4:18 PM, Rob Helpert wrote: > Hi Alicia, > > I think the trick may be to split b1 into the sum of two non-negative > varia

[R] Package 'operators'

2009-07-02 Thread Seeliger . Curt
Folks, In brief -- how many of you have found the 'operators' package to be valuable in their work? Not that I lack respect for the amount of work involved in creating and maintaining a package, but I am unsure about the utility of these new operators. Several of the operators appear to offer

Re: [R] How to use current value of variable in function definition?

2009-07-02 Thread Allan Engelhardt
On 02/07/09 21:02, Mark Wardle wrote: Hi. I've stared at your code for a number of minutes and can't understand what you're trying to achieve here. It looks as if you're fighting scope - it may be worth refactoring your approach to simplify matters. Otherwise, it sounds like a recipe for obfusca

Re: [R] lpSolve: how to allow variables to become negative

2009-07-02 Thread Rob Helpert
Hi Alicia, I think the trick may be to split b1 into the sum of two non-negative variables. You will then also have to alter your constraints and objective to include the two new variables with negative values in appropriate places, but I believe that this will solve the problem. On Thu, Jul 2,

Re: [R] How to use current value of variable in function definition?

2009-07-02 Thread Mark Wardle
Hi. I've stared at your code for a number of minutes and can't understand what you're trying to achieve here. It looks as if you're fighting scope - it may be worth refactoring your approach to simplify matters. Otherwise, it sounds like a recipe for obfuscation! What are you trying to do really?

Re: [R] productivity tools in R?

2009-07-02 Thread Liviu Andronic
On 7/2/09, Mark Knecht wrote: > For kicks I tried JGR yesterday. In the Rgui console, or sourcing, my > code runs fine. In JGR it crashed with messages about stack > imbalances. > Perhaps report the exact issue to stats-rosuda-de...@listserv.uni-augsburg.de; the JGR devels may be interested in f

[R] working with texts

2009-07-02 Thread Helter Two
WinXP, R-2.9.1 LS., I have been trying to solve a (for me) tricky issue. No matter what I've tried, I just can't find a way to do this. This is the issue: I have a text file (ansi text) "titles.txt" with lines of text; here is an example of such a file: > a brief history of polio vaccines

Re: [R] Name of data.frame as a text string?

2009-07-02 Thread Mark Knecht
On 7/2/09, Don MacQueen wrote: > Use > deparse(substitute(df)) > > Example from ?deparse: > > function(x, y) { > plot(x, y, xlab=deparse(substitute(x)), > ylab=deparse(substitute(y))) > } > > -Don > Now that's interesting... deparsed means ?? de-analyze ?? I'm n

Re: [R] Regarding which.max()

2009-07-02 Thread Henrique Dallazuanna
Try this: which(x %in% max(x)) Then yuo can use, max or tail for get the last value. On Thu, Jul 2, 2009 at 4:30 PM, Kenny D'Amica wrote: > Hello, > > > > I'm currently writing a program to analyze economic indicators, and need > to identify the indices of peaks and troughs in certain interval

Re: [R] constrained optimisation in R.

2009-07-02 Thread Ravi Varadhan
Hi, I know nothing about neither your model nor the Skellam distribution. I will assume that it is a sensible model and that the parameters are identifiable from the data. Here is a toy example showing how to impose equality constraints: # To maximize x1 + x2, subject to x1^2 + x2^2 = 1 # f <-

[R] Regarding which.max()

2009-07-02 Thread Kenny D'Amica
Hello, I'm currently writing a program to analyze economic indicators, and need to identify the indices of peaks and troughs in certain intervals (business cycles) of my time series. I am using which.max() for this, which gives me the index of the first max in the interval. However, I need a f

[R] [R-pkgs] SweaveListingUtils --- a package for joining markup provided by TeX package 'listings' with Sweave

2009-07-02 Thread Peter Ruckdeschel
As indicated in some off-list mail by Frank E. Harrell Jr., the announcement of the availability of package %- SweaveListingUtils %- on CRAN, mingled into mail "New versions for the distr-family of packages" t

[R] Quantitative Risk Management by McNeil

2009-07-02 Thread Andriy Fetsun
Dear Specialists in R, May be somebody has experiment in using pakage for the book Quantitative Risk Management by McNeil? This package is writen in R. I have run this package for fitting the data to Nornal Inverse Gaussian distribution and fased with following problem. > Return<-read.csv("data

Re: [R] Name of data.frame as a text string?

2009-07-02 Thread Mark Knecht
On 7/2/09, Ted Harding wrote: > On 02-Jul-09 19:00:44, Mark Knecht wrote: > > I've passed a data.frame as an input into a function which does some > > plotting on a 4x4 matrix of certain parameters within in the > > data.frame. I'd like to add a small header on top of each plot with > > the na

Re: [R] Name of data.frame as a text string?

2009-07-02 Thread Mark Knecht
Perfect! Thanks! Cheers, Mark On 7/2/09, Phil Spector wrote: > Mark - >Take a look at the help file for substitute. > For example: > > > > zz = function(x)print(substitute(x)) > > zz(variablename) > > > variablename > > - Phil > > > > On Thu, 2 Jul

Re: [R] Name of data.frame as a text string?

2009-07-02 Thread Don MacQueen
Use deparse(substitute(df)) Example from ?deparse: function(x, y) { plot(x, y, xlab=deparse(substitute(x)), ylab=deparse(substitute(y))) } -Don At 12:00 PM -0700 7/2/09, Mark Knecht wrote: I've passed a data.frame as an input into a function which does some pl

Re: [R] Name of data.frame as a text string?

2009-07-02 Thread Ted Harding
On 02-Jul-09 19:00:44, Mark Knecht wrote: > I've passed a data.frame as an input into a function which does some > plotting on a 4x4 matrix of certain parameters within in the > data.frame. I'd like to add a small header on top of each plot with > the name of the data.frame so that it's clear as I

Re: [R] gnls : Rho

2009-07-02 Thread spencerg
Your example is not self-contained, which makes it more difficult to answer your question. However, I believe you should be able to answer the question by studying the examples on the help pages for "gnls" and possibly "corCompSymm", using the following additional commands: # T

[R] Name of data.frame as a text string?

2009-07-02 Thread Mark Knecht
I've passed a data.frame as an input into a function which does some plotting on a 4x4 matrix of certain parameters within in the data.frame. I'd like to add a small header on top of each plot with the name of the data.frame so that it's clear as I compare these 16 things where each on came from.

[R] skip the error to continue the logistic regression in a loop

2009-07-02 Thread Suyan Tian
Hi, everyone: I am running logistic regression on a bunch of variables using apply command. But an error occurs, the whole process stops. I am wondering if anyone knows how to skip this error and to continue the regression for the rest of variable. What I did is that first confine a func

Re: [R] Export data to Multiple Sheets in Excel via xlsReadWritePro

2009-07-02 Thread Jorge Ivan Velez
Dear Chris, Perhaps the WriteXLS package (see [1]) by Marc Schwartz might be useful for your proposes. HTH, Jorge [1] http://cran.r-project.org/web/packages/WriteXLS/index.html On Thu, Jul 2, 2009 at 2:12 PM, Chris Anderson wrote: > Is there a way to export multiple datasets into multiple exc

Re: [R] superimpose multiple scatterplot matrices

2009-07-02 Thread Richard M. Heiberger
Ping-Hsun Hsieh wrote: Dear R- experts, I am trying to superimpose two or more scatterplot matrices generated by pairs() to visualize the differences over each datasets, but have not been very successful. Two data frames, df1 and df2 for example, each has the same five variables in column

[R] Warning when trying to access a variable out of scope?

2009-07-02 Thread Steve Lianoglou
Hi, I was wondering if I could get R to warn me, or give me a rude awakening somehow, if I'm accessing a variable that is out of my function's scope. For example, often times I'm creating a function as I'm testing it in the REPL, copying and pasting between both. As a simple example, I

[R] Export data to Multiple Sheets in Excel via xlsReadWritePro

2009-07-02 Thread Chris Anderson
Is there a way to export multiple datasets into multiple excel spreadsheets using xlsReadWritePro or with xlsReadWrite? Chris Anderson 707.315.8486 www.sassydeals4u.com Turn any room into a work of art. Click now for beautiful oriental

Re: [R] How to use current value of variable in function definition?

2009-07-02 Thread Allan Engelhardt
Thanks for the pointer to substitute(), William. This seems to work and is a little shorter than yours: a <- 1; foo <- eval(substitute(function () print(a), env=list(a=a))) a <- 2; foo() # [1] 1 Not the clearest code I have ever seen, especially as 'foo' still shows 'a': print(foo) # function

[R] Problem with groupedData and lme

2009-07-02 Thread Luc Villandre
Dear R-users, I'm currently having trouble with the implementation of a groupedData object in the lme() function. Executing the following function applyScalingSimp <- function(input.population) { ## GA is a time value varInOrder <- c("GA","weight","grouping","sex") mod

Re: [R] read.xls: number of sheets

2009-07-02 Thread William Dunlap
Try changing "sample_file.xls" to normalizePath("sample_file.xls") so you are passing an absolute file path to Excel. Bill Dunlap TIBCO Software Inc - Spotfire Division wdunlap tibco.com > -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] O

Re: [R] read.xls: number of sheets

2009-07-02 Thread Lauri Nikkinen
Thanks, it did not work but this worked: xl$Workbooks()$Open("\\sample_file.xls")$Sheets()$Count() Cheers, Lauri 2009/7/2 Henrique Dallazuanna : > Try this: > > xl$Workbooks()$Open("/sample_file.xls")$Sheets()$Count() > > On Thu, Jul 2, 2009 at 2:23 PM, Lauri Nikkinen > wrote: >> >> Thanks, I t

[R] superimpose multiple scatterplot matrices

2009-07-02 Thread Ping-Hsun Hsieh
Dear R- experts, I am trying to superimpose two or more scatterplot matrices generated by pairs() to visualize the differences over each datasets, but have not been very successful. Two data frames, df1 and df2 for example, each has the same five variables in columns. My goal is to paint ea

Re: [R] read.xls: number of sheets

2009-07-02 Thread Henrique Dallazuanna
Try this: xl$Workbooks()$Open("/sample_file.xls")$Sheets()$Count() On Thu, Jul 2, 2009 at 2:23 PM, Lauri Nikkinen wrote: > Thanks, I tried and got this error: > > > setwd("C:/") > > list.files(pattern=".xls") > [1] "sample_file.xls" > > library(RDCOMClient) > > xl <- COMCreate("Excel.Application

[R] save the result into a word file

2009-07-02 Thread Suyan Tian
Hi, everyone: I forget on how to save a result from R as a word document. For example, if I run the linear regression and want to save the result: summary(lm(y~x) in a word file. So I can show it later to my clients. Any idea on how to do this? Thanks a lot, Suyan ___

Re: [R] How to use current value of variable in function definition?

2009-07-02 Thread William Dunlap
> From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Allan Engelhardt > Sent: Thursday, July 02, 2009 9:47 AM > To: r-help@r-project.org > Subject: [R] How to use current value of variable in function > definition? > > Must be the heat or something but I can'

Re: [R] read.xls: number of sheets

2009-07-02 Thread Lauri Nikkinen
Thanks, I tried and got this error: > setwd("C:/") > list.files(pattern=".xls") [1] "sample_file.xls" > library(RDCOMClient) > xl <- COMCreate("Excel.Application") > xl$Workbooks()$Open("sample_file.xls")$Sheets()$Count() Error in .COM(x, name, ...) : 'sample_file.xls' could not be found. Check

Re: [R] constrained optimisation in R.

2009-07-02 Thread Ravi Varadhan
Please tell us about the actual problem that you are trying to solve, because the "answer" would very much depend on that. Are your constraints really sum(par) = 0? If so, you can just eliminate one of the parameters and solve the optimization problems with (p-1) parameters. If you have other c

[R] Getting identify() to work with lattice::cloud()

2009-07-02 Thread Robert A. LaBudde
I don't seem to be able to put any syntax into identify() that gets it to work with "lattice" cloud() graph: layout(1) require('lattice') cloud(g3 ~ g1 + g2, data=gapp, col = "blue", xlab='G1 Score', ylab='G2 Score', zlab='G3 Score', main='3D Plot for Applicants') identify(gapp[,2:4], labels

Re: [R] Windows zip-files (binaries) for older version of scatterplot3d

2009-07-02 Thread Uwe Ligges
Kristian Karlson wrote: Hi, I am working with -poLCA- which uses the package -scatterplot3d- in order to work. However, I work on a restricted server that is not online. The R-version installed there is 2.6. However, running library(poLCA) after installing the most recent -scatterplot3d- on th

Re: [R] lokern package

2009-07-02 Thread Ravi Varadhan
Dear Martin, Thank you for the propmt and highly informative reply! In my experiments, I compared (a) smooth.spline (with both GCV and CV for automatic bw selection), (b) spm() in "SemiPar", which implements penalized splines smoothing with REML estimation of penalty, (c) glkerns() in "lokern", w

Re: [R] Interaction plots (six on one page)

2009-07-02 Thread ukoenig
Thank you Rich, it looks very nice and seems to be the better solution. Udo Quoting "Richard M. Heiberger" : I would do this as a lattice plot. Continuing with your data: tmp <- data.frame(sapply(data, tapply, data[1:2], mean)) tmp$time <- factor(tmp$time) xyplot(thanaa+thalcho+thalino+pona

Re: [R] Average of data files in a directory

2009-07-02 Thread Peter Perez
Hi Henrique, This works perfectly!. Thanks so much for your help. Best regards, Peter Henrique Dallazuanna wrote: > > Peter, > > Try this: > > apply(do.call(merge, c(loadfiles, by = "Time"))[2:3], 1, mean) > > On Thu, Jul 2, 2009 at 10:39 AM, Peter Perez wrote: > >> >> Hi, >> >> Thanks t

[R] lpSolve: how to allow variables to become negative

2009-07-02 Thread Alicia Perez-alonso
Dear all, I am interested in solving a MIP problem with binary outcomes and continuous variables, which ARE NOT RESTRICTED TO BE NEGATIVE. In particular, Max {z1,z2,z3,b1} z1 + z2 + z3 (s.t.) # 7 z1 + 0 z2 + 0 z3 + b1 <= 5 # 0 z1 + 8 z2 + 0 z3 - b1 <= 5 # 0 z1 + 0 z2 + 6 z3 + b1 <=

[R] How to use current value of variable in function definition?

2009-07-02 Thread Allan Engelhardt
Must be the heat or something but I can't get my brain into gear and figure out how to get something like if (1) { c <- 1; foo <- function () print(c); } c <- 2 foo() to print 1, not 2. (The real life example is a little more complex, but you get the idea. I don't want the variable c in the

Re: [R] lokern package

2009-07-02 Thread Martin Maechler
> "RV" == Ravi Varadhan > on Thu, 2 Jul 2009 10:51:03 -0400 writes: RV> Dear Martin, I have been playing a lot with the RV> glkerns() function in the "lokern" package for RV> "automatic" smoothing of time-series data. This kernel RV> smoothing approach of Gasser and M

[R] Windows zip-files (binaries) for older version of scatterplot3d

2009-07-02 Thread Kristian Karlson
Hi, I am working with -poLCA- which uses the package -scatterplot3d- in order to work. However, I work on a restricted server that is not online. The R-version installed there is 2.6. However, running library(poLCA) after installing the most recent -scatterplot3d- on the server leaves me with R te

Re: [R] read.xls: number of sheets

2009-07-02 Thread Gabor Grothendieck
A second possibility (not as automated but very simple to do) is to read the first sheet with verbose = TRUE: DF <- read.xls("test.xls", sheet = 1, verbose = TRUE) and it will display the number of sheets in a message. You can then read them in in a loop. On Thu, Jul 2, 2009 at 11:05 AM, Gabor

[R] constrained optimisation in R.

2009-07-02 Thread Iason Christodoulou
i want to estimate parameters with maximum likelihood method with contraints (contant numbers). for example sum(Ai)=0 and sum(Bi)=0 i have done it without the constraints but i realised that i have to use the contraints. Without constraints(just a part-not complete): skellamreg_LL=function(pa

[R] R package to analyze time course microarray data

2009-07-02 Thread ss
Hello! Just want to get some suggestions on which R package is good for analyzing time course microarray data. Thank you so much for your input! Sincerely, Allen [[alternative HTML version deleted]] __ R-help@r-project.org mailing list ht

Re: [R] to creates an array

2009-07-02 Thread Steve Lianoglou
Hi, On Jul 2, 2009, at 11:13 AM, barbara.r...@uniroma1.it wrote: Is there a command as "mat.or.vec(nr,nc)" to create an array that I must calculate with more cicle? I'm not sure your question is very clear: what do you mean by "calculate with more cicle"? Could you give an example of wh

Re: [R] Need to study and learn about better plots

2009-07-02 Thread Mark Knecht
On 7/2/09, Dirk Eddelbuettel wrote: > > On 2 July 2009 at 11:14, Steve Lianoglou wrote: > | On Jul 2, 2009, at 10:39 AM, Mark Knecht wrote: > > | > 2) The closest example of the second would be a multi-study chart sort > | > of like is typical in a lot of stock charting programs. Here's (I > |

Re: [R] productivity tools in R?

2009-07-02 Thread Mark Knecht
On 7/1/09, seeliger.c...@epamail.epa.gov wrote: > > ... I saw my friend has a R Console window which has automatic syntax > > reminder when he types in the first a few letters of R command. ... > > You might be thinking of JGR (Jaguar) at > http://jgr.markushelbig.org/JGR.html . This editor als

Re: [R] Need to study and learn about better plots

2009-07-02 Thread Steve Lianoglou
Hi, On Jul 2, 2009, at 11:26 AM, Mark Knecht wrote: On 7/2/09, Steve Lianoglou wrote: [snip] One thing you could do is to peruse the R Graph Gallery to see what people can do: http://addictedtor.free.fr/graphiques/ In particular, the graph below looks *somehow* similar to the chart you

Re: [R] Need to study and learn about better plots

2009-07-02 Thread Gabor Grothendieck
plot.zoo and xyplot.zoo in the zoo package both produce multipanel plots with one panel per series (or optionally all on one panel or a mixture). library(zoo) example(plot.zoo) example(xyplot.zoo) and see the three zoo vignettes. The quantmod package has charting specifically oriented to securit

[R] multiple comparisons and generalized least squares

2009-07-02 Thread Alaerts Katrijn
Dear R users, I 'm working on a dataset consisting of 4 different dataframes with tree, leaf, fruit and seed measurements made on 300 trees, coming from 10 provenances (30 trees per provenance, 10 leaves/fruits/seeds per tree). Provenances are fixed effects (they were not randomly chosen), but

Re: [R] Need to study and learn about better plots

2009-07-02 Thread Dirk Eddelbuettel
On 2 July 2009 at 11:14, Steve Lianoglou wrote: | On Jul 2, 2009, at 10:39 AM, Mark Knecht wrote: | > 2) The closest example of the second would be a multi-study chart sort | > of like is typical in a lot of stock charting programs. Here's (I | > hope) a simple example: | > | > http://stockcharts.

Re: [R] Need to study and learn about better plots

2009-07-02 Thread Mark Knecht
On 7/2/09, Mark Knecht wrote: > On 7/2/09, Steve Lianoglou wrote: > > > > In particular, the graph below looks *somehow* similar to the chart you > > link to. > > > > http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=109 > > What a great site! Thanks! > > The chart you point

Re: [R] productivity tools in R?

2009-07-02 Thread Duncan Murdoch
On 7/2/2009 10:53 AM, Bert Gunter wrote: -- (The Windows GUI does have syntax completion using TAB, but not the hints.) I never knew that! Where is this documented? -- i.e. where are all the features of the Windows GUI documented (as there may well be others I don't know about). The CHA

[R] to creates an array

2009-07-02 Thread Barbara . Rogo
Is there a command as "mat.or.vec(nr,nc)" to create an array that I must calculate with more cicle? [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

Re: [R] read.xls: number of sheets

2009-07-02 Thread Gabor Grothendieck
If you are on Windows and have Excel on the same machine then the code here: http://tolstoy.newcastle.edu.au/R/e6/help/09/03/7736.html will return the number of worksheets as well as a vector of the worksheet names. It seems that the email has somehow caused some of the lines to wrap so you will

Re: [R] Need to study and learn about better plots

2009-07-02 Thread David Winsemius
On Jul 2, 2009, at 11:26 AM, Mark Knecht wrote: On 7/2/09, Steve Lianoglou wrote: Hi, On Jul 2, 2009, at 10:39 AM, Mark Knecht wrote: Hi, So far my plotting needs have been sort of ignored as I got acquainted with R this week, but now that I have the basics in place for the program I want

Re: [R] productivity tools in R?

2009-07-02 Thread Gene Leynes
I have recently discovered the "playwith" library, which is great for creating complex lattice objects. If you start with a simple lattice plot then modify it using playwith, you can export the code to produce the spiffed up plot. I noticed this function at the bottom of the xyplot documentation i

Re: [R] Need to study and learn about better plots

2009-07-02 Thread Mark Knecht
On 7/2/09, Steve Lianoglou wrote: > Hi, > > On Jul 2, 2009, at 10:39 AM, Mark Knecht wrote: > > > > Hi, > > So far my plotting needs have been sort of ignored as I got > > acquainted with R this week, but now that I have the basics in place > > for the program I wanted to write it's time for me

Re: [R] Getting the month out of my date as a number not characters

2009-07-02 Thread Don MacQueen
Try hf$hour <- as.POSIXlt(hf$date)$hour hf$month <- as.POSIXlt(hf$date)$mon+1 To see why, use the man pages to study the structure of POSIXlt objects. Try: tmp <- strptime("20/2/06 11:16:16.683", "%d/%m/%y %H:%M:%OS") unclass(tmp) For example: tmp <- strptime("20/2/06 11:16:16.6

Re: [R] Need to study and learn about better plots

2009-07-02 Thread Steve Lianoglou
Hi, On Jul 2, 2009, at 10:39 AM, Mark Knecht wrote: Hi, So far my plotting needs have been sort of ignored as I got acquainted with R this week, but now that I have the basics in place for the program I wanted to write it's time for me to start learning about how to make output that better s

  1   2   >