Re: [R] time function behavior for ts class objects

2009-06-14 Thread Prof Brian Ripley

Try not reducing options(digit=)!  I get (with the default value 7)


time(xts)

  Jan  Feb  Mar  Apr  May  Jun  Jul  Aug
1973 1973.000 1973.083 1973.167 1973.250 1973.333 1973.417 1973.500 1973.583
1974 1974.000 1974.083 1974.167 1974.250 1974.333 1974.417 1974.500 1974.583
  Sep  Oct  Nov  Dec
1973 1973.667 1973.750 1973.833 1973.917
1974 1974.667 1974.750 1974.833 1974.917

That is the 'correct linear sequence' in years, the units selected by 
'frequency = 12'.  It seems you printed it rounded to 4 digits 
(without telling us, so maybe you had forgotten that you had altered 
the setting).


Please do not confuse the printed representation of an object with its 
value -- this is especially important if you choose to reduce the 
default printing precision so much.


On Sat, 13 Jun 2009, Ron Burns wrote:


Hi all-

I am trying to use the time function for ts class objects and do not 
understand the return value.  I want to use it to set up a time trend in 
arima fits.  It does not seem to return a correct linear sequence that 
matches the underlying time series.  I am running:

R version 2.8.1 (2008-12-22).

For example:

R ## create a time series
R x - rnorm(24)
R (xts - ts(x,start=c(1973),frequency=12))
Jan  Feb  Mar  Apr  May  Jun  Jul  Aug
1973 -0.09220  0.29838 -0.48667 -1.08046 -0.65665 -0.11695  0.3  0.00769
1974  1.23304  0.04211  0.88410  1.08454 -0.38852  0.05231  0.50548 -0.71105
Sep  Oct  Nov  Dec
1973 -0.17923 -1.29722 -1.04519 -0.90785
1974  1.28810  0.43334 -0.71618  0.26681

R plot(xts)
The plot of xts starts at 1973.0 as expected (as given by the plot x-axis 
first tick). 
R ## check what time returns

R (time.ts - time(xts))
Jan  Feb  Mar  Apr  May  Jun  Jul  Aug  Sep  Oct  Nov  Dec
1973 1973 1973 1973 1973 1973 1973 1974 1974 1974 1974 1974 1974
1974 1974 1974 1974 1974 1974 1974 1974 1975 1975 1975 1975 1975

I would have expected the 1973 row to contain 1973 for all months and not to 
have a jump after Jun 1973 to Jul 1974.   That is  I  would expect something 
like:


R ## const my own time specific to this xts
R y - c(rep(1973,12),rep(1974,12))
R (tsp(y) - attr(hasTsp(xts),tsp))
[1] 1973 1975   12
R (my.time.ts - as.ts(y))
Jan  Feb  Mar  Apr  May  Jun  Jul  Aug  Sep  Oct  Nov  Dec
1973 1973 1973 1973 1973 1973 1973 1973 1973 1973 1973 1973 1973
1974 1974 1974 1974 1974 1974 1974 1974 1974 1974 1974 1974 1974

I certainly don't think R expects me to construct this myself! So I must be 
missing something, doing something wrong, or there is bug somewhere.  Looking 
a bit further, I tried adding an offset in the time() call:


R time(xts,offset=-6)
Jan  Feb  Mar  Apr  May  Jun  Jul  Aug  Sep  Oct  Nov  Dec
1973 1972 1973 1973 1973 1973 1973 1973 1973 1973 1973 1973 1973
1974 1974 1974 1974 1974 1974 1974 1974 1974 1974 1974 1974 1974

which is close (i.e. Jan 1972) still not what I expect.  However

time(xts,offset=(-6+.1))
Jan  Feb  Mar  Apr  May  Jun  Jul  Aug  Sep  Oct  Nov  Dec
1973 1973 1973 1973 1973 1973 1973 1973 1973 1973 1973 1973 1973
1974 1974 1974 1974 1974 1974 1974 1974 1974 1974 1974 1974 1974

does it.  This behavior is not clear from the help pages (to me at least!) 
and also (to me at least!) represents buggy behavior. It is even less clear 
now to me how to properly set up the time trends for an arima fit?  Does arma 
expect the results from time() without an offset, or what I think it should 
be? 
Thanks in advance for your consideration and help.


Best regards,
  Ron

--
R. R. Burns
Physicist (Retired)
Oceanside, CA


--
Brian D. Ripley,  rip...@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] 'Errors' with Ubuntu

2009-06-14 Thread Paul Hiemstra

Hi,

As Uwe said, this is not really the place to get support for Ubuntu. 
They have excellent forums. But the problem seems to be that GRUB was 
not correctly installed. Run an ubuntu live cd and reinstall GRUB from 
that. The command might be grub-install, but i'm not sure


cheers,
Paul

Len Vir schreef:

Good Day To You All,

I have installed Ubuntu 9.04 on a Laptop running Vista Business.

When I try to start my little machine,
GRUB keeps telling me there is an error:

Either: Error 25, Error 21, or  Error 5.
Once in a while, it is 'Error 22'.

And then there is no way to go any further:
End of the line. The 'Error' crashes me into being nothing.

Why do I get these 'Error Messages'
when I try to boot up my Laptop ?

I have tried to boot up in many
different 'dimensions':
With or without the mouse connected,
with or without my external hard-drive connected,
with or without my girlfriend being in the bath tub or not,
etc.
and all the other permutations that R would allow me to do...
if I had access to it.

Any and all cues would be greatly appreciated,

Many Thanks,

Len

  len...@gmail.com joseph.j.gazai...@gmail.com

p.s. Ubuntu 9.04 is giving me problems
   I never had with Ubuntu 8.04

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.



__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] a proposal regarding documentation

2009-06-14 Thread Patrick Burns

Proposal

That a new mailing list be established
that pertains exclusively to R documentation.
The purpose of the list would be to discuss
weak sections of the documentation and
establish fixes for those weak spots.


Pro

If it works, there would be better documentation.

It would be an excellent opportunity for newish
and/or less technical people to contribute to R.
In some respects such people would be much more
valuable to the process than very experienced
people.

It could take some pressure off of R-core.


Con

It needs at least one person (and probably more)
with a strong commitment to make it work.  The
proposed changes would need to be installed, and
activity would need to be encouraged and focused.


Background

A couple weeks ago I sent a message suggesting that
people with issues about the documentation should
send a message about it.  I left the exact details
vague for two reasons:
1) I wasn't sure what the preferred details are.
2) I realized that if people actually followed
the suggestion and sent messages about documentation,
R-core would be overwhelmed and not especially happy.



Patrick Burns
patr...@burns-stat.com
+44 (0)20 8525 0696
http://www.burns-stat.com
(home of The R Inferno and A Guide for the Unwilling S User)

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] a proposal regarding documentation

2009-06-14 Thread Peter Flom
Patrick Burns pbu...@pburns.seanet.com wrote

Proposal

That a new mailing list be established
that pertains exclusively to R documentation.
The purpose of the list would be to discuss
weak sections of the documentation and
establish fixes for those weak spots.


Pro

If it works, there would be better documentation.

It would be an excellent opportunity for newish
and/or less technical people to contribute to R.
In some respects such people would be much more
valuable to the process than very experienced
people.

It could take some pressure off of R-core.


Con

It needs at least one person (and probably more)
with a strong commitment to make it work.  The
proposed changes would need to be installed, and
activity would need to be encouraged and focused.


Background

A couple weeks ago I sent a message suggesting that
people with issues about the documentation should
send a message about it.  I left the exact details
vague for two reasons:
1) I wasn't sure what the preferred details are.
2) I realized that if people actually followed
the suggestion and sent messages about documentation,
R-core would be overwhelmed and not especially happy.



I think this is an excellent idea.

I would be glad to be one of the newish or less technical people.

Peter

Peter L. Flom, PhD
Statistical Consultant
www DOT peterflomconsulting DOT com

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] a proposal regarding documentation

2009-06-14 Thread John Sorkin
Issues
(1) Will people use the new listserver?
(2) Will developers respond to postings
Question
(1) Are there any guidelines for creating documentation? If not should they be 
developed? It seems to me that every help page should include (a) examples, and 
when approprate (b) a reference to an article relevant to the help page's 
content. 
Thoughts
The pages should explain a concept using as little jargon as possible and 
should try not to be circular, i.e. do not define something using the defined 
term in its own definition.  
John



John David Sorkin M.D., Ph.D.
Chief, Biostatistics and Informatics
University of Maryland School of Medicine Division of Gerontology
Baltimore VA Medical Center
10 North Greene Street
GRECC (BT/18/GR)
Baltimore, MD 21201-1524
(Phone) 410-605-7119
(Fax) 410-605-7913 (Please call phone number above prior to faxing)

 Peter Flom peterflomconsult...@mindspring.com 6/14/2009 7:05 AM 
Patrick Burns pbu...@pburns.seanet.com wrote

Proposal

That a new mailing list be established
that pertains exclusively to R documentation.
The purpose of the list would be to discuss
weak sections of the documentation and
establish fixes for those weak spots.


Pro

If it works, there would be better documentation.

It would be an excellent opportunity for newish
and/or less technical people to contribute to R.
In some respects such people would be much more
valuable to the process than very experienced
people.

It could take some pressure off of R-core.


Con

It needs at least one person (and probably more)
with a strong commitment to make it work.  The
proposed changes would need to be installed, and
activity would need to be encouraged and focused.


Background

A couple weeks ago I sent a message suggesting that
people with issues about the documentation should
send a message about it.  I left the exact details
vague for two reasons:
1) I wasn't sure what the preferred details are.
2) I realized that if people actually followed
the suggestion and sent messages about documentation,
R-core would be overwhelmed and not especially happy.



I think this is an excellent idea.

I would be glad to be one of the newish or less technical people.

Peter

Peter L. Flom, PhD
Statistical Consultant
www DOT peterflomconsulting DOT com

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help 
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html 
and provide commented, minimal, self-contained, reproducible code.

Confidentiality Statement:
This email message, including any attachments, is for th...{{dropped:6}}

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] a proposal regarding documentation

2009-06-14 Thread stephen sefick
I have a package StreamMetabolism.  I believe that documentation is
the toughest part.  I find it to be straight foward, but  then I wrote
the package.  Lets try one?  I don't m
ind helping.

Stephen Sefick

On Sun, Jun 14, 2009 at 7:23 AM, John Sorkinjsor...@grecc.umaryland.edu wrote:
 Issues
 (1) Will people use the new listserver?
 (2) Will developers respond to postings
 Question
 (1) Are there any guidelines for creating documentation? If not should they 
 be developed? It seems to me that every help page should include (a) 
 examples, and when approprate (b) a reference to an article relevant to the 
 help page's content.
 Thoughts
 The pages should explain a concept using as little jargon as possible and 
 should try not to be circular, i.e. do not define something using the defined 
 term in its own definition.
 John



 John David Sorkin M.D., Ph.D.
 Chief, Biostatistics and Informatics
 University of Maryland School of Medicine Division of Gerontology
 Baltimore VA Medical Center
 10 North Greene Street
 GRECC (BT/18/GR)
 Baltimore, MD 21201-1524
 (Phone) 410-605-7119
 (Fax) 410-605-7913 (Please call phone number above prior to faxing)

 Peter Flom peterflomconsult...@mindspring.com 6/14/2009 7:05 AM 
 Patrick Burns pbu...@pburns.seanet.com wrote

Proposal

That a new mailing list be established
that pertains exclusively to R documentation.
The purpose of the list would be to discuss
weak sections of the documentation and
establish fixes for those weak spots.


Pro

If it works, there would be better documentation.

It would be an excellent opportunity for newish
and/or less technical people to contribute to R.
In some respects such people would be much more
valuable to the process than very experienced
people.

It could take some pressure off of R-core.


Con

It needs at least one person (and probably more)
with a strong commitment to make it work.  The
proposed changes would need to be installed, and
activity would need to be encouraged and focused.


Background

A couple weeks ago I sent a message suggesting that
people with issues about the documentation should
send a message about it.  I left the exact details
vague for two reasons:
1) I wasn't sure what the preferred details are.
2) I realized that if people actually followed
the suggestion and sent messages about documentation,
R-core would be overwhelmed and not especially happy.



 I think this is an excellent idea.

 I would be glad to be one of the newish or less technical people.

 Peter

 Peter L. Flom, PhD
 Statistical Consultant
 www DOT peterflomconsulting DOT com

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.

 Confidentiality Statement:
 This email message, including any attachments, is for ...{{dropped:22}}

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] boxplot size

2009-06-14 Thread luscinia

Hey everybody,

I am trying to generate multiple boxplots on one page by using the layout ()
function. This works really well but the plots are always badly proportioned
(3 times wider than high) and much too small to be easily readable. I have
tried reducing margins to allow for bigger plots, but that hasn't had the
desired effect.
Does anybody know how if there is a size function in layout, or if I can at
least determine boxplot size separately for each plot?

Thank you!
-- 
View this message in context: 
http://www.nabble.com/boxplot-size-tp24020781p24020781.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Gtk objects disappears

2009-06-14 Thread Olivier Nuñez

It woks fine.
Thanks very much.
Olivier
--   



Olivier G. Nuñez
Email: onu...@iberstat.es
Tel : +34 663 03 69 09
Web: http://www.iberstat.es






El 14/06/2009, a las 4:30, Michael Lawrence escribió:

I would recommend just running gtkMain(), so that GTK+ blocks R.  
Then you need your GUI to call gtkMainQuit() when it's time to kill R.


On Fri, Jun 12, 2009 at 6:59 AM, Olivier Nuñez onu...@iberstat.es  
wrote:

Dear John,

I have a question.

When I  run a RGtk code in my terminal (without using the R GUI)

R --vanilla  EOF
source(myRGtkcode.R)
EOF

the GTK objects do not remain on the screen.
Until now, I bypass this problem using the following commands:

require(tcltk)
tkmessageBox(Press to exit)

But it is not really satisfactory and the tcltk Box cannot be
minimized (at least in Mac OSX).

Any idea?

Best regards. Olivier


--


Olivier G. Nuñez
Email: onu...@iberstat.es
Tel : +34 663 03 69 09
Web: http://www.iberstat.es







   [[alternative HTML version deleted]]


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting- 
guide.html

and provide commented, minimal, self-contained, reproducible code.




__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Problem in installation of Rgraphviz package

2009-06-14 Thread Takeshi N

Hi,there, 

I could install Rgraphviz in R version 2.6. I could not install this in R
version 2.7 or 2.8.
Please try in version2.6.


ram basnet wrote:
 
 Dear R users,
  
 I am not so used to this R software. I have to use the package 
 Rgraphviz but found some problem in the installation process. I download
 this package and store in R library but i am not getting this package in R
 installation list. 
 I made review in google search net and use the following command:
  
 ###
 source(http://bioconductor.org/biocLite.R;)
 biocLite(Rgraphviz)
 
 set.seed(123)
 V - letters[1:10]
 M - 1:4
 g1 - randomGraph(V, M, 0.2)
 library(graph)
 library(grid)
 library(Rgraphviz)
 ###
  
 I got following Error message:
  
  
 Error in inDL(x, as.logical(local), as.logical(now), ...) : 
   unable to load shared library
 'C:/PROGRA~1/R/R-27~1.0/library/Rgraphviz/libs/Rgraphviz.dll':
   LoadLibrary failure:  The specified module could not be found. 
 Error : .onLoad failed in 'loadNamespace' for 'Rgraphviz'
 Error: package/namespace load failed for 'Rgraphviz'
 '
 May be some of users can recognize this problem and request for solutions.
  
 Thanks in advance.
  
 Sincerely,
  
 Ram Kumar Basnet
 Graduate student,
 Wageningen University,
 The Netherlands.
 
 
   
   [[alternative HTML version deleted]]
 
 
 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.
 
 

-- 
View this message in context: 
http://www.nabble.com/Problem-in-installation-of-%22Rgraphviz%22-package-tp20196715p24019809.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] boxplot size

2009-06-14 Thread David Winsemius

Have you actually looked at the help page for layout()?

--  
David Winsemius

On Jun 14, 2009, at 7:35 AM, luscinia wrote:



Hey everybody,

I am trying to generate multiple boxplots on one page by using the  
layout ()
function. This works really well but the plots are always badly  
proportioned
(3 times wider than high) and much too small to be easily readable.  
I have
tried reducing margins to allow for bigger plots, but that hasn't  
had the

desired effect.
Does anybody know how if there is a size function in layout, or if I  
can at

least determine boxplot size separately for each plot?-

--

David Winsemius, MD
Heritage Laboratories
West Hartford, CT

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] a proposal regarding documentation

2009-06-14 Thread Patrick Burns

I neglected to say that I don't have the
time to be one of the drivers for the
proposed list.

Pat


Patrick Burns wrote:

Proposal

That a new mailing list be established
that pertains exclusively to R documentation.
The purpose of the list would be to discuss
weak sections of the documentation and
establish fixes for those weak spots.


Pro

If it works, there would be better documentation.

It would be an excellent opportunity for newish
and/or less technical people to contribute to R.
In some respects such people would be much more
valuable to the process than very experienced
people.

It could take some pressure off of R-core.


Con

It needs at least one person (and probably more)
with a strong commitment to make it work.  The
proposed changes would need to be installed, and
activity would need to be encouraged and focused.


Background

A couple weeks ago I sent a message suggesting that
people with issues about the documentation should
send a message about it.  I left the exact details
vague for two reasons:
1) I wasn't sure what the preferred details are.
2) I realized that if people actually followed
the suggestion and sent messages about documentation,
R-core would be overwhelmed and not especially happy.



Patrick Burns
patr...@burns-stat.com
+44 (0)20 8525 0696
http://www.burns-stat.com
(home of The R Inferno and A Guide for the Unwilling S User)

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide 
http://www.R-project.org/posting-guide.html

and provide commented, minimal, self-contained, reproducible code.



__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] a proposal regarding documentation

2009-06-14 Thread Patrick Burns

I had only envisioned the scope of the
list to be the packages that R-core are
responsible for.

Expanding to contributed packages would
expand both potential usefulness and
certain complexity exponentially.

Pat


stephen sefick wrote:

I have a package StreamMetabolism.  I believe that documentation is
the toughest part.  I find it to be straight foward, but  then I wrote
the package.  Lets try one?  I don't m
ind helping.

Stephen Sefick

On Sun, Jun 14, 2009 at 7:23 AM, John Sorkinjsor...@grecc.umaryland.edu wrote:

Issues
(1) Will people use the new listserver?
(2) Will developers respond to postings
Question
(1) Are there any guidelines for creating documentation? If not should they be 
developed? It seems to me that every help page should include (a) examples, and 
when approprate (b) a reference to an article relevant to the help page's 
content.
Thoughts
The pages should explain a concept using as little jargon as possible and 
should try not to be circular, i.e. do not define something using the defined 
term in its own definition.
John



John David Sorkin M.D., Ph.D.
Chief, Biostatistics and Informatics
University of Maryland School of Medicine Division of Gerontology
Baltimore VA Medical Center
10 North Greene Street
GRECC (BT/18/GR)
Baltimore, MD 21201-1524
(Phone) 410-605-7119
(Fax) 410-605-7913 (Please call phone number above prior to faxing)


Peter Flom peterflomconsult...@mindspring.com 6/14/2009 7:05 AM 

Patrick Burns pbu...@pburns.seanet.com wrote


Proposal

That a new mailing list be established
that pertains exclusively to R documentation.
The purpose of the list would be to discuss
weak sections of the documentation and
establish fixes for those weak spots.


Pro

If it works, there would be better documentation.

It would be an excellent opportunity for newish
and/or less technical people to contribute to R.
In some respects such people would be much more
valuable to the process than very experienced
people.

It could take some pressure off of R-core.


Con

It needs at least one person (and probably more)
with a strong commitment to make it work.  The
proposed changes would need to be installed, and
activity would need to be encouraged and focused.


Background

A couple weeks ago I sent a message suggesting that
people with issues about the documentation should
send a message about it.  I left the exact details
vague for two reasons:
1) I wasn't sure what the preferred details are.
2) I realized that if people actually followed
the suggestion and sent messages about documentation,
R-core would be overwhelmed and not especially happy.



I think this is an excellent idea.

I would be glad to be one of the newish or less technical people.

Peter

Peter L. Flom, PhD
Statistical Consultant
www DOT peterflomconsulting DOT com

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Confidentiality Statement:
This email message, including any attachments, is for ...{{dropped:22}}


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] a proposal regarding documentation

2009-06-14 Thread stephen sefick
That make sense to just do the R-core documentation.  I was suggesting
using my package because I understand it and could have a dialog about
the design choices for the documentation, which would also improve the
package itself.  I am starting my PhD program tomorrow and will
probably not have enough time to be in charge of this, but I wouldn't
mind helping.

Stephen Sefick
On Sun, Jun 14, 2009 at 12:30 PM, Patrick Burnspbu...@pburns.seanet.com wrote:
 I had only envisioned the scope of the
 list to be the packages that R-core are
 responsible for.

 Expanding to contributed packages would
 expand both potential usefulness and
 certain complexity exponentially.

 Pat


 stephen sefick wrote:

 I have a package StreamMetabolism.  I believe that documentation is
 the toughest part.  I find it to be straight foward, but  then I wrote
 the package.  Lets try one?  I don't m
 ind helping.

 Stephen Sefick

 On Sun, Jun 14, 2009 at 7:23 AM, John Sorkinjsor...@grecc.umaryland.edu
 wrote:

 Issues
 (1) Will people use the new listserver?
 (2) Will developers respond to postings
 Question
 (1) Are there any guidelines for creating documentation? If not should
 they be developed? It seems to me that every help page should include (a)
 examples, and when approprate (b) a reference to an article relevant to the
 help page's content.
 Thoughts
 The pages should explain a concept using as little jargon as possible and
 should try not to be circular, i.e. do not define something using the
 defined term in its own definition.
 John



 John David Sorkin M.D., Ph.D.
 Chief, Biostatistics and Informatics
 University of Maryland School of Medicine Division of Gerontology
 Baltimore VA Medical Center
 10 North Greene Street
 GRECC (BT/18/GR)
 Baltimore, MD 21201-1524
 (Phone) 410-605-7119
 (Fax) 410-605-7913 (Please call phone number above prior to faxing)

 Peter Flom peterflomconsult...@mindspring.com 6/14/2009 7:05 AM 

 Patrick Burns pbu...@pburns.seanet.com wrote

 Proposal

 That a new mailing list be established
 that pertains exclusively to R documentation.
 The purpose of the list would be to discuss
 weak sections of the documentation and
 establish fixes for those weak spots.


 Pro

 If it works, there would be better documentation.

 It would be an excellent opportunity for newish
 and/or less technical people to contribute to R.
 In some respects such people would be much more
 valuable to the process than very experienced
 people.

 It could take some pressure off of R-core.


 Con

 It needs at least one person (and probably more)
 with a strong commitment to make it work.  The
 proposed changes would need to be installed, and
 activity would need to be encouraged and focused.


 Background

 A couple weeks ago I sent a message suggesting that
 people with issues about the documentation should
 send a message about it.  I left the exact details
 vague for two reasons:
 1) I wasn't sure what the preferred details are.
 2) I realized that if people actually followed
 the suggestion and sent messages about documentation,
 R-core would be overwhelmed and not especially happy.


 I think this is an excellent idea.

 I would be glad to be one of the newish or less technical people.

 Peter

 Peter L. Flom, PhD
 Statistical Consultant
 www DOT peterflomconsulting DOT com

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.

 Confidentiality Statement:
 This email message, including any attachments, is for ...{{dropped:22}}

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.




-- 
Stephen Sefick

Let's not spend our time and resources thinking about things that are
so little or so large that all they really do for us is puff us up and
make us feel like gods.  We are mammals, and have not exhausted the
annoying little problems of being mammals.

-K. Mullis

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] a proposal regarding documentation

2009-06-14 Thread spencerg
 The documentation for the nlme package was improved a few years 
ago by an informal process of this nature.  When I first started 
following r-help, I answered many questions suggesting in part the the 
person read some portion of Pinheiro and Bates (2000).  At that time, 
none of the help pages mentioned Pinheiro and Bates, because they were 
completed before the book and had not been updated.  Eventually, I 
volunteered to add that to some of the help pages.  Doug agreed.  In the 
process, I also expanded some of the examples and modified the text in 
places where I thought I could make it more easily understood. 



 One obvious way to do this would be to provide write access to the 
main R subversion repository.  However, that likely would not be 
acceptable to the R-core team unless it were limited to a very few 
individuals they already knew and trusted, and those individuals could 
process suggestions from others.  As mentioned, there would need to be 
additional ground rules.  For example, an inappropriate example might 
cause R CMD check to fail on some platforms but not others.  This 
could expose problems with the core code, which perhaps should be fixed 
but not necessarily in the time frame desired by this new documentation 
improvement team.  For a second example, Brian Ripley once rejected a 
suggested change to a help page because it referred to a package outside 
the core R code. 



 A less threatening alternative might be to direct this energy into 
improving the R Wiki.  I have contributed to other Wiki projects, and 
I've found them to be quite useful and dynamic.  The current R Wiki has 
not so far lived up to its potential.  However, I believe that is just a 
matter of building a critical mass of R Wiki contributors.  Many 
questions on R help could best be answers by first cheking and perhaps 
improving the R Wiki and then directing the questioner to the Wiki.  I 
plan to do that sometime, but not yet. 



 Hope this helps. 
 Spencer Graves



stephen sefick wrote:

That make sense to just do the R-core documentation.  I was suggesting
using my package because I understand it and could have a dialog about
the design choices for the documentation, which would also improve the
package itself.  I am starting my PhD program tomorrow and will
probably not have enough time to be in charge of this, but I wouldn't
mind helping.

Stephen Sefick
On Sun, Jun 14, 2009 at 12:30 PM, Patrick Burnspbu...@pburns.seanet.com wrote:
  

I had only envisioned the scope of the
list to be the packages that R-core are
responsible for.

Expanding to contributed packages would
expand both potential usefulness and
certain complexity exponentially.

Pat


stephen sefick wrote:


I have a package StreamMetabolism.  I believe that documentation is
the toughest part.  I find it to be straight foward, but  then I wrote
the package.  Lets try one?  I don't m
ind helping.

Stephen Sefick

On Sun, Jun 14, 2009 at 7:23 AM, John Sorkinjsor...@grecc.umaryland.edu
wrote:
  

Issues
(1) Will people use the new listserver?
(2) Will developers respond to postings
Question
(1) Are there any guidelines for creating documentation? If not should
they be developed? It seems to me that every help page should include (a)
examples, and when approprate (b) a reference to an article relevant to the
help page's content.
Thoughts
The pages should explain a concept using as little jargon as possible and
should try not to be circular, i.e. do not define something using the
defined term in its own definition.
John



John David Sorkin M.D., Ph.D.
Chief, Biostatistics and Informatics
University of Maryland School of Medicine Division of Gerontology
Baltimore VA Medical Center
10 North Greene Street
GRECC (BT/18/GR)
Baltimore, MD 21201-1524
(Phone) 410-605-7119
(Fax) 410-605-7913 (Please call phone number above prior to faxing)



Peter Flom peterflomconsult...@mindspring.com 6/14/2009 7:05 AM 
  

Patrick Burns pbu...@pburns.seanet.com wrote



Proposal

That a new mailing list be established
that pertains exclusively to R documentation.
The purpose of the list would be to discuss
weak sections of the documentation and
establish fixes for those weak spots.


Pro

If it works, there would be better documentation.

It would be an excellent opportunity for newish
and/or less technical people to contribute to R.
In some respects such people would be much more
valuable to the process than very experienced
people.

It could take some pressure off of R-core.


Con

It needs at least one person (and probably more)
with a strong commitment to make it work.  The
proposed changes would need to be installed, and
activity would need to be encouraged and focused.


Background

A couple weeks ago I sent a message suggesting that
people with issues about the documentation should
send a message about it.  I left the exact details
vague for two reasons:
1) I wasn't sure what the preferred details 

Re: [R] a proposal regarding documentation

2009-06-14 Thread John Sorkin
Perhaps help pages should have links to relevant portions of the WIKI.
John  

John David Sorkin M.D., Ph.D.
Chief, Biostatistics and Informatics
University of Maryland School of Medicine Division of Gerontology
Baltimore VA Medical Center
10 North Greene Street
GRECC (BT/18/GR)
Baltimore, MD 21201-1524
(Phone) 410-605-7119
(Fax) 410-605-7913 (Please call phone number above prior to faxing)

 spencerg spencer.gra...@prodsyse.com 6/14/2009 1:53 PM 
The documentation for the nlme package was improved a few years 
ago by an informal process of this nature.  When I first started 
following r-help, I answered many questions suggesting in part the the 
person read some portion of Pinheiro and Bates (2000).  At that time, 
none of the help pages mentioned Pinheiro and Bates, because they were 
completed before the book and had not been updated.  Eventually, I 
volunteered to add that to some of the help pages.  Doug agreed.  In the 
process, I also expanded some of the examples and modified the text in 
places where I thought I could make it more easily understood. 


  One obvious way to do this would be to provide write access to the 
main R subversion repository.  However, that likely would not be 
acceptable to the R-core team unless it were limited to a very few 
individuals they already knew and trusted, and those individuals could 
process suggestions from others.  As mentioned, there would need to be 
additional ground rules.  For example, an inappropriate example might 
cause R CMD check to fail on some platforms but not others.  This 
could expose problems with the core code, which perhaps should be fixed 
but not necessarily in the time frame desired by this new documentation 
improvement team.  For a second example, Brian Ripley once rejected a 
suggested change to a help page because it referred to a package outside 
the core R code. 


  A less threatening alternative might be to direct this energy into 
improving the R Wiki.  I have contributed to other Wiki projects, and 
I've found them to be quite useful and dynamic.  The current R Wiki has 
not so far lived up to its potential.  However, I believe that is just a 
matter of building a critical mass of R Wiki contributors.  Many 
questions on R help could best be answers by first cheking and perhaps 
improving the R Wiki and then directing the questioner to the Wiki.  I 
plan to do that sometime, but not yet. 


  Hope this helps. 
  Spencer Graves


stephen sefick wrote:
 That make sense to just do the R-core documentation.  I was suggesting
 using my package because I understand it and could have a dialog about
 the design choices for the documentation, which would also improve the
 package itself.  I am starting my PhD program tomorrow and will
 probably not have enough time to be in charge of this, but I wouldn't
 mind helping.

 Stephen Sefick
 On Sun, Jun 14, 2009 at 12:30 PM, Patrick Burnspbu...@pburns.seanet.com 
 wrote:
   
 I had only envisioned the scope of the
 list to be the packages that R-core are
 responsible for.

 Expanding to contributed packages would
 expand both potential usefulness and
 certain complexity exponentially.

 Pat


 stephen sefick wrote:
 
 I have a package StreamMetabolism.  I believe that documentation is
 the toughest part.  I find it to be straight foward, but  then I wrote
 the package.  Lets try one?  I don't m
 ind helping.

 Stephen Sefick

 On Sun, Jun 14, 2009 at 7:23 AM, John Sorkinjsor...@grecc.umaryland.edu
 wrote:
   
 Issues
 (1) Will people use the new listserver?
 (2) Will developers respond to postings
 Question
 (1) Are there any guidelines for creating documentation? If not should
 they be developed? It seems to me that every help page should include (a)
 examples, and when approprate (b) a reference to an article relevant to the
 help page's content.
 Thoughts
 The pages should explain a concept using as little jargon as possible and
 should try not to be circular, i.e. do not define something using the
 defined term in its own definition.
 John



 John David Sorkin M.D., Ph.D.
 Chief, Biostatistics and Informatics
 University of Maryland School of Medicine Division of Gerontology
 Baltimore VA Medical Center
 10 North Greene Street
 GRECC (BT/18/GR)
 Baltimore, MD 21201-1524
 (Phone) 410-605-7119
 (Fax) 410-605-7913 (Please call phone number above prior to faxing)

 
 Peter Flom peterflomconsult...@mindspring.com 6/14/2009 7:05 AM 
   
 Patrick Burns pbu...@pburns.seanet.com wrote

 
 Proposal

 That a new mailing list be established
 that pertains exclusively to R documentation.
 The purpose of the list would be to discuss
 weak sections of the documentation and
 establish fixes for those weak spots.


 Pro

 If it works, there would be better documentation.

 It would be an excellent opportunity for newish
 and/or less technical people to contribute to R.
 In some respects such people would be much more
 valuable to the process 

[R] Centering graphics by default in Sweave

2009-06-14 Thread Frank E Harrell Jr
Is there an elegant way to get Sweave to center graphics by default? 
I'd like to use \centerline{\includegraphics{}} etc. to save some 
vertical space that \begin{center} ... \end{center} uses, and I'd like 
to avoid centering with each fig=T=


Thanks
Frank
--
Frank E Harrell Jr   Professor and Chair   School of Medicine
 Department of Biostatistics   Vanderbilt University

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] a proposal regarding documentation

2009-06-14 Thread Peter Flom
Maybe once the list is going, people who are willing
to submit their packages to such scrutiny and critique 
could join in?

Peter

-Original Message-
From: Patrick Burns pbu...@pburns.seanet.com
Sent: Jun 14, 2009 12:30 PM
To: stephen sefick ssef...@gmail.com
Cc: r-h...@stat.math.ethz.ch, John Sorkin jsor...@grecc.umaryland.edu
Subject: Re: [R] a proposal regarding documentation

I had only envisioned the scope of the
list to be the packages that R-core are
responsible for.

Expanding to contributed packages would
expand both potential usefulness and
certain complexity exponentially.

Pat


stephen sefick wrote:
 I have a package StreamMetabolism.  I believe that documentation is
 the toughest part.  I find it to be straight foward, but  then I wrote
 the package.  Lets try one?  I don't m
 ind helping.
 
 Stephen Sefick
 
 On Sun, Jun 14, 2009 at 7:23 AM, John Sorkinjsor...@grecc.umaryland.edu 
 wrote:
 Issues
 (1) Will people use the new listserver?
 (2) Will developers respond to postings
 Question
 (1) Are there any guidelines for creating documentation? If not should they 
 be developed? It seems to me that every help page should include (a) 
 examples, and when approprate (b) a reference to an article relevant to the 
 help page's content.
 Thoughts
 The pages should explain a concept using as little jargon as possible and 
 should try not to be circular, i.e. do not define something using the 
 defined term in its own definition.
 John



 John David Sorkin M.D., Ph.D.
 Chief, Biostatistics and Informatics
 University of Maryland School of Medicine Division of Gerontology
 Baltimore VA Medical Center
 10 North Greene Street
 GRECC (BT/18/GR)
 Baltimore, MD 21201-1524
 (Phone) 410-605-7119
 (Fax) 410-605-7913 (Please call phone number above prior to faxing)

 Peter Flom peterflomconsult...@mindspring.com 6/14/2009 7:05 AM 
 Patrick Burns pbu...@pburns.seanet.com wrote

 Proposal

 That a new mailing list be established
 that pertains exclusively to R documentation.
 The purpose of the list would be to discuss
 weak sections of the documentation and
 establish fixes for those weak spots.


 Pro

 If it works, there would be better documentation.

 It would be an excellent opportunity for newish
 and/or less technical people to contribute to R.
 In some respects such people would be much more
 valuable to the process than very experienced
 people.

 It could take some pressure off of R-core.


 Con

 It needs at least one person (and probably more)
 with a strong commitment to make it work.  The
 proposed changes would need to be installed, and
 activity would need to be encouraged and focused.


 Background

 A couple weeks ago I sent a message suggesting that
 people with issues about the documentation should
 send a message about it.  I left the exact details
 vague for two reasons:
 1) I wasn't sure what the preferred details are.
 2) I realized that if people actually followed
 the suggestion and sent messages about documentation,
 R-core would be overwhelmed and not especially happy.


 I think this is an excellent idea.

 I would be glad to be one of the newish or less technical people.

 Peter

 Peter L. Flom, PhD
 Statistical Consultant
 www DOT peterflomconsulting DOT com

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.

 Confidentiality Statement:
 This email message, including any attachments, is for ...{{dropped:22}}
 
 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Peter L. Flom, PhD
Statistical Consultant
www DOT peterflomconsulting DOT com

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] learning about panel functions in lattice

2009-06-14 Thread Juliet Hannah
Hi All,

I am trying to understand panel functions. Let's use this example.


library(lattice)
time-c(rep(1:10,5))
y -time+rnorm(50,5,2)
group-c(rep('A',30),rep('B',20))
subject-c(rep('a',10),rep('b',10),rep('c',10),rep('d',10),rep('e',10))
myData -data.frame(subject,group,time,y)
head(myData)

Plot 1

xyplot(y ~ time | group, data = myData, groups = subject,
   panel = panel.superpose,
   panel.groups = function(...)
   panel.loess(...)
   )


Plot 2

xyplot(y ~ time | group, data = myData, groups = subject,
   panel = function(...) {
   panel = panel.superpose(...)
   panel.groups = function(...)
   panel.loess(...)
   })

Why does Plot 2 not produce the loess curves? Why are points not
plotted on Plot 1?

Plot 3

xyplot(y ~ time | group, data = myData, groups = subject,
panel = function(...) {
  panel.superpose(...)
  panel.superpose(panel.groups = panel.loess, ...)
})

What is the effect of writing panel.superpose twice? What is it about
this call that makes the data points
appear on the graph?


Thanks,

Juliet

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] learning about panel functions in lattice

2009-06-14 Thread Gabor Grothendieck
2009/6/14 Juliet Hannah juliet.han...@gmail.com:
 Hi All,

 I am trying to understand panel functions. Let's use this example.


 library(lattice)
 time-c(rep(1:10,5))
 y -time+rnorm(50,5,2)
 group-c(rep('A',30),rep('B',20))
 subject-c(rep('a',10),rep('b',10),rep('c',10),rep('d',10),rep('e',10))
 myData -data.frame(subject,group,time,y)
 head(myData)

 Plot 1

 xyplot(y ~ time | group, data = myData, groups = subject,
       panel = panel.superpose,
       panel.groups = function(...)
       panel.loess(...)
       )


 Plot 2

 xyplot(y ~ time | group, data = myData, groups = subject,
       panel = function(...) {
       panel = panel.superpose(...)
       panel.groups = function(...)
       panel.loess(...)
       })

 Why does Plot 2 not produce the loess curves? Why are points not
 plotted on Plot 1?

The above creates a function called panel.groups within the anonymous
panel function but that is meaningless.  In particular, its not even
accessible outside of the anonymous function and is never called
within the anonymous function so its never called  at all.


 Plot 3

 xyplot(y ~ time | group, data = myData, groups = subject,
        panel = function(...) {
          panel.superpose(...)
          panel.superpose(panel.groups = panel.loess, ...)
        })

 What is the effect of writing panel.superpose twice? What is it about
 this call that makes the data points
 appear on the graph?

The first superpose draws the points and the second draws the
loess curve.  Try instrumenting it with browser() calls (resulting
in a pause) and also adding a col attribute and it will become clearer:


xyplot(y ~ time | group, data = myData, groups = subject,
  panel = function(...) {
browser()
panel.superpose(..., col = purple)
browser()
panel.superpose(panel.groups = panel.loess, col = green, ...)
browser()
  }
)




 Thanks,

 Juliet

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] if + is.na

2009-06-14 Thread Grześ

Hello!
I wont to use a function is.na() 

I have  two vectors:
  a=c(1,NA,3,3,3)
  b=c(0,0,0,0,0)
and when I use is.na function it's ok:
 is.na(a)
[1] FALSE  TRUE FALSE FALSE FALSE

but I would create sth like this:

 for i in 1:length(a){
 if (wsp[i] == is.na(a)) {b=43}
  }
or like this 

 if(is.na(a)) b=3 else a
[1]  1 NA  3  3  3

but I always get an error:
  the condition has length  1 and only the first element will be used
 
Could you help me how I may avoid this problem and use function is.na inside
function if - else
Please
 

-- 
View this message in context: 
http://www.nabble.com/if-%2B-is.na-tp24025136p24025136.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] if + is.na

2009-06-14 Thread Ben Bolker



Grześ wrote:
 
 Hello!
 I wont to use a function is.na() 
 
 I have  two vectors:
  a=c(1,NA,3,3,3)
  b=c(0,0,0,0,0)
 and when I use is.na function it's ok:
 is.na(a)
 [1] FALSE  TRUE FALSE FALSE FALSE
 
 but I would create sth like this:
 
  for i in 1:length(a){
  if (wsp[i] == is.na(a)) {b=43}
   }
 or like this 
 
  if(is.na(a)) b=3 else a
 [1]  1 NA  3  3  3
 
 but I always get an error:
   the condition has length  1 and only the first element will be used
  
 Could you help me how I may avoid this problem and use function is.na
 inside function if - else
 
 

Use ifelse instead of if


-- 
View this message in context: 
http://www.nabble.com/if-%2B-is.na-tp24025136p24025414.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] if + is.na

2009-06-14 Thread Rolf Turner


On 15/06/2009, at 7:48 AM, Grześ wrote:



Hello!
I wont to use a function is.na()

I have  two vectors:

 a=c(1,NA,3,3,3)
 b=c(0,0,0,0,0)

and when I use is.na function it's ok:

is.na(a)

[1] FALSE  TRUE FALSE FALSE FALSE

but I would create sth like this:

 for i in 1:length(a){
 if (wsp[i] == is.na(a)) {b=43}
  }
or like this

 if(is.na(a)) b=3 else a
[1]  1 NA  3  3  3

but I always get an error:
  the condition has length  1 and only the first element will be used

Could you help me how I may avoid this problem and use function  
is.na inside

function if - else
Please


?ifelse
##
Attention: 
This e-mail message is privileged and confidential. If you are not the 
intended recipient please delete the message and notify the sender. 
Any views or opinions presented are solely those of the author.


This e-mail has been scanned and cleared by MailMarshal 
www.marshalsoftware.com

##

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] External signal in ODE written in C (using deSolve and approx1?)

2009-06-14 Thread Thomas Petzoldt

Glenn Woodart wrote:

Dear Thomas

Thank you for your excellent help. I agree method 3 would be the best one,
and this is the one I have been trying to get working (like you described).
So far my skills with pointers, what is returned etc in pure C code is
limited, so my attempts have failed so far. 


That's why I use R for most cases, even if it is somewhat slower than C 
-- is simply much more comfortable.



If it is possible to get a
working example in the vignette it would be great.


Yes, this will surely come ..., but for the moment, see the ad-hoc 
example on:


http://www.simecol.de/models/c_ode_signal.zip

You will see that in addition to linear interpolation one needs a method 
to transfer the data of the signal to the C side. There are several 
possibilities and I'm not yet sure which one will eventually find its 
way to the package.


Note also that the code is a quick hack without any warranty.


Again, thank you for your brilliant work on implementing solvers for
differential equations in R.

Best wishes
Glenn


Thanks for giving feedback.

Thomas Petzoldt

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] [R-help] how to install own R withour root?

2009-06-14 Thread Patrick Connolly
Or you could do what I suggested below.  I had assumed you had a
~/bin/ directory and knew how to make a symbolic link.  If that
assumption is incorrect, let us know and we can tell you how to do
it. 

As Bill suggests, removing the present old version would be
preferable, but I can understand you could be in a position of having
to depend on an unreachable administrator, so that might not be
possible.

best

Patrick

On Sat, 13-Jun-2009 at 03:43PM +1000, bill.venab...@csiro.au wrote:

| You need to adjust your PATH environment variable so that the 
/path_of_my_home/R/bin comes ahead of the system R/bin directory.  (Or you can 
simply remove the system R/bin and substitute your own R/bin.
| 
| W.
| 
| From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] On Behalf 
Of Daofeng Li [lid...@gmail.com]
| Sent: 13 June 2009 15:28
| To: Paul Hiemstra
| Cc: r-help@r-project.org
| Subject: Re: [R] [R-help] how to install own R withour root?
| 
| Hi,
| 
| i had intstalled R in my home directory
| and i can run the new install R from /path_of_my_home/R/bin/R
| but when i type R, it runs the system installed older R 2.4
| can i just type an R command and it runs my new installed R?
| 
| Thanks!
| 
| On Tue, Jun 9, 2009 at 4:00 PM, Paul Hiemstra p.hiems...@geo.uu.nl wrote:
| 
|  Hi,
| 
|  In addition. You can also install everything just in your home drive. Using
|  the configure script you can change the installation path of all R related
|  stuff:
| 
|  ./configure --prefix=/home/bla/progsandlibs
| 
|  The binaries end up in ~/progsandlibs/bin, and the libraries in
|  ~/progsandlibs/bin. If you use this consistently with all the programs you
|  install using ./configure and add progsandlibs to you $PATH, you can 
install
|  all the software in your home drive with no difference in functionality.
| 
|  cheers,
|  Paul
| 
| 
|  Patrick Connolly wrote:
| 
|  On Tue, 09-Jun-2009 at 11:50AM +0800, Daofeng Li wrote:
| 
|  | Dear list members,
|  | | i am currently want to install Rpy2 in a linux box which has R 2.4.0
|  | installed
|  | RPy requries R 2.7.0 or above
|  | but i have no root previlleges
|  | so my question is how to install R 2.7.0 on my own directory?
| 
|  You might as well install R-2.9.0 while you're at it.
| 
|  | and replace the system installed R 2.4.0 when i input R command from
|  the
|  | bash Shell?
| 
|  You can download the R-2.9.0.tar.gz to a directory you have access to.
|  I'll call it ~/Rhome/
| 
|  uncompress the file with tar xvzf R-2.9.0.tar.gz
|  and then move to the R-2.9.0 subdirectory that will be created.
| 
|  In that directory, you'll find a file called INSTALL which will give
|  you very simple clear directions.  Don't try to make a site-wide
|  installation which isn't appropriate in your case.
| 
|  The executable will be at ~/Rhome/R-2.9.0/bin/R
| 
|  Assuming you have a ~/bin directory, I find the simplest thing is to
|  make a link in that directory to the executable.
| 
|  Now the part that might be slightly tricky.  If you can't get someone
|  with root access to remove the R-2.4.0 installation, it's simple
|  enough to prevent it clashing with your newer version.  Make the name
|  of the link in ~/bin/ something slightly different from R, such as RR
|  or whatever you fancy.  You then start R with that name.
| 
|  HTH
| 
| 
| 
| 
| 
| 
| 
|  --
|  Drs. Paul Hiemstra
|  Department of Physical Geography
|  Faculty of Geosciences
|  University of Utrecht
|  Heidelberglaan 2
|  P.O. Box 80.115
|  3508 TC Utrecht
|  Phone:  +3130 274 3113 Mon-Tue
|  Phone:  +3130 253 5773 Wed-Fri
|  http://intamap.geo.uu.nl/~paul
| 
| 
| 
| 
| --
| Daofeng Li,PhD Candidate
| China Agricultural University
| 
| [[alternative HTML version deleted]]
| 
| __
| R-help@r-project.org mailing list
| https://stat.ethz.ch/mailman/listinfo/r-help
| PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
| and provide commented, minimal, self-contained, reproducible code.
| 
| __
| R-help@r-project.org mailing list
| https://stat.ethz.ch/mailman/listinfo/r-help
| PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
| and provide commented, minimal, self-contained, reproducible code.

-- 
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.   
   ___Patrick Connolly   
 {~._.~}   Great minds discuss ideas
 _( Y )_ Average minds discuss events 
(:_~*~_:)  Small minds discuss people  
 (_)-(_)  . Eleanor Roosevelt
  
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide 

[R] estimate the reliability of a scale with dichotomous items

2009-06-14 Thread Martin Batholdy

hi,

How can I compute a reliability score of a scale consisting only of  
dichotomous items?




thanks for any help!

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] a proposal regarding documentation

2009-06-14 Thread Philippe Grosjean

John Sorkin wrote:

Perhaps help pages should have links to relevant portions of the WIKI.
John  


John David Sorkin M.D., Ph.D.
Chief, Biostatistics and Informatics
University of Maryland School of Medicine Division of Gerontology
Baltimore VA Medical Center
10 North Greene Street
GRECC (BT/18/GR)
Baltimore, MD 21201-1524
(Phone) 410-605-7119
(Fax) 410-605-7913 (Please call phone number above prior to faxing)


spencerg spencer.gra...@prodsyse.com 6/14/2009 1:53 PM 
The documentation for the nlme package was improved a few years 
ago by an informal process of this nature.  When I first started 
following r-help, I answered many questions suggesting in part the the 
person read some portion of Pinheiro and Bates (2000).  At that time, 
none of the help pages mentioned Pinheiro and Bates, because they were 
completed before the book and had not been updated.  Eventually, I 
volunteered to add that to some of the help pages.  Doug agreed.  In the 
process, I also expanded some of the examples and modified the text in 
places where I thought I could make it more easily understood. 



  One obvious way to do this would be to provide write access to the 
main R subversion repository.  However, that likely would not be 
acceptable to the R-core team unless it were limited to a very few 
individuals they already knew and trusted, and those individuals could 
process suggestions from others.  As mentioned, there would need to be 
additional ground rules.  For example, an inappropriate example might 
cause R CMD check to fail on some platforms but not others.  This 
could expose problems with the core code, which perhaps should be fixed 
but not necessarily in the time frame desired by this new documentation 
improvement team.  For a second example, Brian Ripley once rejected a 
suggested change to a help page because it referred to a package outside 
the core R code. 



  A less threatening alternative might be to direct this energy into 
improving the R Wiki.  I have contributed to other Wiki projects, and 
I've found them to be quite useful and dynamic.  The current R Wiki has 
not so far lived up to its potential.  However, I believe that is just a 
matter of building a critical mass of R Wiki contributors.  Many 
questions on R help could best be answers by first cheking and perhaps 
improving the R Wiki and then directing the questioner to the Wiki.  I 
plan to do that sometime, but not yet. 



  Hope this helps. 
  Spencer Graves


I agree. The R Wiki probably needs these steps:
1) To reorganize its general structure in order to find more easily 
relevant pages,


2) To rework the engine, and in particular the main page template to 
make it easier and more intuitive for R users,


3) ... most importantly: to move it to a faster server, so that it will 
be more responsive, and


4) To build a RWiki package with functions to ease access of the wiki 
pages (direct search in the wiki, retrieve code in R from a given wiki 
page, etc.). I have started something in this direction, but currently 
lack time to finalize it.


Finally, the most important aspect is to get a group of volunteers to 
move and reformat nice discussions from R-Help/R-Devel/R-SIG-whatever 
into refined wiki pages... and with a referee mechanism to double/triple 
check content on the wiki. This happens erratically and certainly lacks 
proof-checking and feedback to the corresponding mailing list.


Beside this, I am completely open to suggestions.

Interested people could contact me directly. We could certainly arrange 
a dinner in Rennes at User!2009 to discuss evolution of the R Wiki, in 
particular, targeting collaborative writing of *good quality* documentation.


Best,

Philippe Grosjean


[...]


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] a proposal regarding documentation

2009-06-14 Thread Peter Flom
I certainly don't have anything against the WIKI, but I think that the 
documentation
is where the action is, especially for newbies.  It's the  natural first step
when you want to learn about a function or when you  get an error message you 
don't understand.

Peter

Peter L. Flom, PhD
Statistical Consultant
www DOT peterflomconsulting DOT com

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] estimate the reliability of a scale with dichotomous items

2009-06-14 Thread William Revelle

At 11:02 PM +0200 6/14/09, Martin Batholdy wrote:

hi,

How can I compute a reliability score of a scale consisting only of 
dichotomous items?



RSiteSearch(cronbach's alpha) suggests the ltm,  psych, psy, 
psycho, epicalc, packages (among others).


There are a number of ways of estimating reliability, alpha is the 
most common (and perhaps overused).  Other ways include MacDonald's 
omega_h and omega_t as well as the six estimates of Guttman.  I tend 
to use the various functions found in psych, but then again, I am 
probably biased.


Bill







thanks for any help!

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.



--
William Revelle http://personality-project.org/revelle.html
Professor   http://personality-project.org/personality.html
Department of Psychology http://www.wcas.northwestern.edu/psych/
Northwestern University http://www.northwestern.edu/
Attend  ISSID/ARP:2009   http://issid.org/issid.2009/

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] a proposal regarding documentation

2009-06-14 Thread spencerg
 I agree that the documentation is a primary source, made now more 
accessible with the availability of the RSiteSearch package that allows 
more structures searches of the help pages in contributed packages than 
previously available.  On the other hand, it can sometimes be difficult 
to get the attention and support of someone who can make necessary 
improvements to the help pages. 



 Moreover, the R Wiki should be the primary place for comparing 
similar capabilities in different packages.  For example, a function 
named gam appears in two different packages, with similar 
functionality but subtle incompatibilities.  The R Wiki provides a forum 
for an open-ended debate about which is best for which purpose.  The 
Wiki model has proven its worth by allowing anyone to write anything 
they feel moved to write (in the language of their choice).  If 
something is disputed, there are referees to lock particular Wiki pages, 
after which point the dispute can continue but without burdening the 
casual reader with the details.  The success of Wikipedia shows a 
context in which anarchy is almost uniformly superior to prior 
censorship.  The current task views provide a very limited overview of 
contributed capabilities but the way those are currently managed make 
them entirely too static and unsuited to this kind of thing.  I plan 
eventually to start contributing to the R Wiki, making comparisons of 
similar capabilities in different packages and inviting the package 
maintainers to correct or expand on anything I write.  However, I have 
other tasks I need to complete before I can start working on that. 



 Best Wishes,
 Spencer Graves


Peter Flom wrote:

I certainly don't have anything against the WIKI, but I think that the 
documentation
is where the action is, especially for newbies.  It's the  natural first step
when you want to learn about a function or when you  get an error message you 
don't understand.


Peter

Peter L. Flom, PhD
Statistical Consultant
www DOT peterflomconsulting DOT com

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.




__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] How to fix my nested conditional IF ELSE code?

2009-06-14 Thread Mark Na
Hi,
I've been struggling most of the morning with an IF ELSE problem, and I
wonder if someone might be able to sort me out.

Here's what I need to do (dummy example, my data are more complicated):

If type = A or B or C
 and status = a then count = 1
 and status = b then count = 2
 and status = c then count = 3

Else if type = D or E or F
 and status = a then count = 9
 and status = b then count = 8
 and status = c then count = 7

End

Seems simple when I write it like that, but the R code is escaping me.

Thanks!

Mark Na

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] a proposal regarding documentation

2009-06-14 Thread Gabor Grothendieck
In PHP and also in MySQL the manual has a wiki capability
so that users can add notes at the end of each page, e.g.

http://www.php.net/manual/en/functions.variable-functions.php

http://dev.mysql.com/doc/refman/4.1/en/update.html

That would combine documentation and wiki into one. Here it would
involve copying the R help pages into the wiki in a readonly mode with the
writeable wiki portion at the end of each such page.  It would also be
necessary to be able to update the help pages in the wiki when new versions
became available.

No explicit email group or coordination would be needed.  It would also address
the organization problem as they could be organized as they are now, i.e. into
packages: base, stats, utils, ...

It would require the development of a program to initially copy the help pages
and to update them while keeping the notes in place whenever a new version
of R came out.

On Sun, Jun 14, 2009 at 5:35 PM, Peter
Flompeterflomconsult...@mindspring.com wrote:
 I certainly don't have anything against the WIKI, but I think that the 
 documentation
 is where the action is, especially for newbies.  It's the  natural first step
 when you want to learn about a function or when you  get an error message you
 don't understand.

 Peter

 Peter L. Flom, PhD
 Statistical Consultant
 www DOT peterflomconsulting DOT com

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] How to fix my nested conditional IF ELSE code?

2009-06-14 Thread Chuck Cleland
On 6/14/2009 6:18 PM, Mark Na wrote:
 Hi,
 I've been struggling most of the morning with an IF ELSE problem, and I
 wonder if someone might be able to sort me out.
 
 Here's what I need to do (dummy example, my data are more complicated):
 
 If type = A or B or C
  and status = a then count = 1
  and status = b then count = 2
  and status = c then count = 3
 
 Else if type = D or E or F
  and status = a then count = 9
  and status = b then count = 8
  and status = c then count = 7
 
 End
 
 Seems simple when I write it like that, but the R code is escaping me.

mydf - data.frame(type = sample(LETTERS[1:6], 40, replace=TRUE),
   status = sample(letters[1:3], 40, replace=TRUE))

mydf$count - with(mydf,
ifelse(type %in% c('A','B','C')  status == 'a', 1,
ifelse(type %in% c('A','B','C')  status == 'b', 2,
ifelse(type %in% c('A','B','C')  status == 'c', 3,
ifelse(type %in% c('D','E','F')  status == 'a', 9,
ifelse(type %in% c('D','E','F')  status == 'b', 8,
ifelse(type %in% c('D','E','F')  status == 'c', 7,
NA)))

mydf
   type status count
1 C  c 3
2 F  b 8
3 B  b 2
4 A  a 1
5 C  b 2
6 D  c 7
7 C  a 1
8 E  c 7
9 F  a 9
10E  b 8
11F  a 9
12D  a 9
13A  c 3
14B  b 2
15D  b 8
16C  c 3
17E  c 7
18A  c 3
19B  a 1
20E  a 9
21E  b 8
22E  a 9
23C  b 2
24A  b 2
25F  b 8
26D  a 9
27B  c 3
28E  b 8
29E  c 7
30F  b 8
31B  a 1
32F  c 7
33F  b 8
34E  c 7
35C  b 2
36C  a 1
37F  b 8
38D  c 7
39F  a 9
40D  b 8

 Thanks!
 
 Mark Na
 
   [[alternative HTML version deleted]]
 
 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code. 

-- 
Chuck Cleland, Ph.D.
NDRI, Inc. (www.ndri.org)
71 West 23rd Street, 8th floor
New York, NY 10010
tel: (212) 845-4495 (Tu, Th)
tel: (732) 512-0171 (M, W, F)
fax: (917) 438-0894

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] a proposal regarding documentation

2009-06-14 Thread Ted Harding
On 14-Jun-09 22:23:24, Gabor Grothendieck wrote:
 In PHP and also in MySQL the manual has a wiki capability
 so that users can add notes at the end of each page, e.g.
 
 http://www.php.net/manual/en/functions.variable-functions.php
 
 http://dev.mysql.com/doc/refman/4.1/en/update.html
 
 That would combine documentation and wiki into one. Here it would
 involve copying the R help pages into the wiki in a readonly mode
 with the writeable wiki portion at the end of each such page. It
 would also be necessary to be able to update the help pages in the
 wiki when new versions became available.

That is an interesting and potentially very fruitful idea. I'd like
to propose a quasi-readonly mode in which wiki users could interpolate
the comments at chosen points within the original text of a help-page
(but without any alteration of the original), with the interpolation
clearly marked by some kind of highlighting (e.g. change of font or
colour).

In that way, a user reading through the original help-page on the
wiki would encounter, in context and in timely fashion, comments
by other users who had themselves met difficulties at that point
and who (hopefully) have provided more detailed guidance and/or
links to other parts of the documentation which illuminate or
fill-in what was not obvious in the first place. With, preferably,
the option to back up to where they were before, if they are
led to some other help page.

Ted.

 No explicit email group or coordination would be needed. It would
 also address the organization problem as they could be organized
 as they are now, i.e. into packages: base, stats, utils, ...
 
 It would require the development of a program to initially copy
 the help pages and to update them while keeping the notes in place
 whenever a new version of R came out.
 
 On Sun, Jun 14, 2009 at 5:35 PM, Peter
 Flompeterflomconsult...@mindspring.com wrote:
 I certainly don't have anything against the WIKI, but I think that the
 documentation
 is where the action is, especially for newbies. _It's the _natural
 first step
 when you want to learn about a function or when you _get an error
 message you
 don't understand.

 Peter

 Peter L. Flom, PhD
 Statistical Consultant
 www DOT peterflomconsulting DOT com

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.

 
 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


E-Mail: (Ted Harding) ted.hard...@manchester.ac.uk
Fax-to-email: +44 (0)870 094 0861
Date: 14-Jun-09   Time: 23:41:39
-- XFMail --

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Leave One Out Cross Validation

2009-06-14 Thread muddz

Hi All,

I have been trying to get this LOO-Cross Validation method to work on R for
the past 3 weeks but have had no luck. I am hoping someone would kindly help
me. 

Essentially I want to code the LOO-Cross Validation for the 'Local Constant'
and 'Local Linear' constant estimators. I want to find optimal h, bandwidth.

Thank you very much!
-M


-- 
View this message in context: 
http://www.nabble.com/Leave-One-Out-Cross-Validation-tp24025738p24025738.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] a proposal regarding documentation

2009-06-14 Thread Gabor Grothendieck
On Sun, Jun 14, 2009 at 6:41 PM, Ted
Hardingted.hard...@manchester.ac.uk wrote:
 That is an interesting and potentially very fruitful idea. I'd like
 to propose a quasi-readonly mode in which wiki users could interpolate
 the comments at chosen points within the original text of a help-page
 (but without any alteration of the original), with the interpolation
 clearly marked by some kind of highlighting (e.g. change of font or
 colour).

Potentially, many comments could disrupt the flow of the
help page.  I think it might be better to only have links to the
comments which themselves are located below and even
that might be too disruptive.

Also, from an implementation viewpoint this would seem to add a
significant complication particularly when updating the help pages
with new versions of the help pages so I think it might be better
to just follow the formats of PHP and MySQL and keep it simple.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] a proposal regarding documentation

2009-06-14 Thread Peter Flom
Well, suppose I wanted to suggest changes to some documentation, or write an 
alternate help file for some function.  Where would I put it?

Let's say I type, in R, ?median.  Now suppose I have suggestions.  If I look at

http://wiki.r-project.org/rwiki/doku.php?id=idx=rdoc:base

I don't see the median listed.  Should I add one?

OK, I do see mean listed, but the page

http://wiki.r-project.org/rwiki/doku.php?id=rdoc:base:mean

is blank.  Should I edit it?  Should it include the original documentation? My 
proposed changes?
Or what?

-
Let's say I figure all that out.  Now, someone else disagrees with my 
documentation and changes it, perhaps making it confusing (in my view).  Is 
this a good way to proceed?

Peter

Peter L. Flom, PhD
Statistical Consultant
www DOT peterflomconsulting DOT com

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Comparative evaluation studies of R packages and functions. Was: Re: a proposal regarding documentation

2009-06-14 Thread Ravi Varadhan
Hi Spencer,

You have brought up an important topic.  I agree with you that a comparative 
evaluation of R packages providing similar capabilities is a worthwhile task.  
Your example of gam is a very good one.  Let me give you a couple of other 
examples of comparative evaluation that I am working on: (1) optimization - 
John Nash and I are currently doing this for basic optimization packages. By 
basic optimization, I am referring to the optimization of smooth functions, 
with box-constarints or no constraints, (2) smoothing or non-parametric 
regression. I am currently comparing some smoothers for their ability to 
accurately estimate functions and their first 2 derivatives from discretely 
sampled data (in terms of mean integrated squared error).  

Comparative studies, if conducted rigorously and objectively by independent 
folks not associated with packages, are likely to be very useful to R users. 
The new R Journal would be a natural avenue to disseminate the results of 
comparative studies.  I can think of some criteria for comparing packages or 
functions (in different packages) that are meant for essentially similar tasks 
(e.g. the 2 gam functions):

1.  Ease of use and misuse
2.  Documenation and examples
3.  Transparency of coding (this would give more weight to all-R functions 
and packages as opposed to C/Fortran interfaces)
4.  Theoretical foundation
5.  Performance on simulated examples designed to highlight potential trouble 
spots
6.  Actual performance on real problems.
7.  Identification of niche areas for each package, i.e. things that no other 
package can do or do as well.

Best,
Ravi. 


Ravi Varadhan, Ph.D.
Assistant Professor,
Division of Geriatric Medicine and Gerontology
School of Medicine
Johns Hopkins University

Ph. (410) 502-2619
email: rvarad...@jhmi.edu


- Original Message -
From: spencerg spencer.gra...@prodsyse.com
Date: Sunday, June 14, 2009 6:08 pm
Subject: Re: [R] a proposal regarding documentation
To: Peter Flom peterflomconsult...@mindspring.com
Cc: r-h...@stat.math.ethz.ch, Philippe Grosjean phgrosj...@sciviews.org, John 
Sorkin jsor...@grecc.umaryland.edu, Patrick Burns pbu...@pburns.seanet.com


   I agree that the documentation is a primary source, made now 
 more 
  accessible with the availability of the RSiteSearch package that 
 allows 
  more structures searches of the help pages in contributed packages 
 than 
  previously available.  On the other hand, it can sometimes be 
 difficult 
  to get the attention and support of someone who can make necessary 
  improvements to the help pages. 
  
  
Moreover, the R Wiki should be the primary place for comparing 
 
  similar capabilities in different packages.  For example, a function 
 
  named gam appears in two different packages, with similar 
  functionality but subtle incompatibilities.  The R Wiki provides a 
 forum 
  for an open-ended debate about which is best for which purpose.  The 
 
  Wiki model has proven its worth by allowing anyone to write anything 
 
  they feel moved to write (in the language of their choice).  If 
  something is disputed, there are referees to lock particular Wiki 
 pages, 
  after which point the dispute can continue but without burdening the 
 
  casual reader with the details.  The success of Wikipedia shows a 
  context in which anarchy is almost uniformly superior to prior 
  censorship.  The current task views provide a very limited overview 
 of 
  contributed capabilities but the way those are currently managed make 
 
  them entirely too static and unsuited to this kind of thing.  I plan 
 
  eventually to start contributing to the R Wiki, making comparisons of 
 
  similar capabilities in different packages and inviting the package 
  maintainers to correct or expand on anything I write.  However, I 
 have 
  other tasks I need to complete before I can start working on that. 
  
  
Best Wishes,
Spencer Graves
  
  
  Peter Flom wrote:
   I certainly don't have anything against the WIKI, but I think that 
 the documentation
   is where the action is, especially for newbies.  It's the  natural 
 first step
   when you want to learn about a function or when you  get an error 
 message you 
   don't understand.
  
   Peter
  
   Peter L. Flom, PhD
   Statistical Consultant
   www DOT peterflomconsulting DOT com
  
   __
   R-help@r-project.org mailing list
   
   PLEASE do read the posting guide 
   and provide commented, minimal, self-contained, reproducible code.
  
  
  
  __
  R-help@r-project.org mailing list
  
  PLEASE do read the posting guide 
  and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide 

[R] Identifying clusters of size n

2009-06-14 Thread Nathan S. Watson-Haigh
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Is there a library which is capable of identifying distinct clusters of size n
from a series of XY coordinates?

Failing this, I'd like to be able to to something like:
Using a sliding window of size n along the x-axis I'd like to determine the
distance between the center of the points in the window and the closest point
outside the window. I could then use a distance cutoff to help define my
clusters of size n. However, how can I calculate this distance?

Cheers,
Nathan



- --
- 
Dr. Nathan S. Watson-Haigh
OCE Post Doctoral Fellow
CSIRO Livestock Industries
Queensland Bioscience Precinct
St Lucia, QLD 4067
Australia

Tel: +61 (0)7 3214 2922
Fax: +61 (0)7 3214 2900
Web: http://www.csiro.au/people/Nathan.Watson-Haigh.html
- 

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAko1ikEACgkQ9gTv6QYzVL4sUACdGOMLYGaQ0Wkq+ywKD7k+w/kZ
WkkAoKPA9RLFNc3nJOX5hR2qPJXfAZ8d
=ATd3
-END PGP SIGNATURE-

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] How to fix my nested conditional IF ELSE code?

2009-06-14 Thread David Winsemius


On Jun 14, 2009, at 6:33 PM, Chuck Cleland wrote:


On 6/14/2009 6:18 PM, Mark Na wrote:


Here's what I need to do (dummy example, my data are more  
complicated):


If type = A or B or C
and status = a then count = 1
and status = b then count = 2
and status = c then count = 3

Else if type = D or E or F
and status = a then count = 9
and status = b then count = 8
and status = c then count = 7

End

Seems simple when I write it like that, but the R code is escaping  
me.


mydf - data.frame(type = sample(LETTERS[1:6], 40, replace=TRUE),
  status = sample(letters[1:3], 40, replace=TRUE))

mydf$count - with(mydf,
   ifelse(type %in% c('A','B','C')  status == 'a', 1,
   ifelse(type %in% c('A','B','C')  status == 'b', 2,
   ifelse(type %in% c('A','B','C')  status == 'c', 3,
   ifelse(type %in% c('D','E','F')  status == 'a', 9,
   ifelse(type %in% c('D','E','F')  status == 'b', 8,
   ifelse(type %in% c('D','E','F')  status == 'c', 7,
NA)))


Or more compactly and perhaps easier to maintain since you are  
approaching the nesting limits of ifelse and the OP said he had a more  
complex operation to perform:


library(car)
mydf$count - with(mydf, ifelse( type %in% c('A','B','C'),
 recode( status,  'a'=1; 'b'=2; 'c'=3 ,  
FALSE),

 ifelse( type %in% c('D','E','F') ,
  recode( status,  'a'=9; 'b'=8;  
'c'=7 , FALSE),

  NA)  )  )





David Winsemius, MD
Heritage Laboratories
West Hartford, CT

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Centering graphics by default in Sweave

2009-06-14 Thread Marc Schwartz


On Jun 14, 2009, at 2:28 PM, Frank E Harrell Jr wrote:

Is there an elegant way to get Sweave to center graphics by default?  
I'd like to use \centerline{\includegraphics{}} etc. to save some  
vertical space that \begin{center} ... \end{center} uses, and I'd  
like to avoid centering with each fig=T=


Frank,

My comments below are based upon the presumption that you are using a  
'figure' environment for your plots.


As far as I know, there is no Sweave option for this, however,  
reviewing the code for the handling of the 'include' option, it looks  
like (at first glance) that it might not be too difficult to add one.  
The 'includegraphics' statement is output as part of the handling of  
the 'include' option code. It would take more time to be sure that I  
am not missing something.


However, there is an alternative, which is to define a new environment  
using the \newenvironment command and have it encapsulate the normal  
'figure' environment along with a \centering command. \centering will  
accomplish the same thing as using \centerline, which is to save some  
vertical space after the figure environment if otherwise using the  
'center' environment. BTW, this extra vertical space occurs because  
the 'center' environment is built on top of the 'list' environment,  
which introduces different paragraph spacing.


To that end, below is some example .Rnw code for a document including  
the specification of a new environment called 'centerfig', which can  
then be used in the same way you would call the regular 'figure'  
environment. The definition consists of two lines. The first is what  
is used at the beginning of the environment and the second is used at  
the end. In this case, the first line calls the figure environment  
with the addition of \centering. The second line simply ends the  
figure environment. Think of the two lines as macro substitutions.


I have included a copy of a PDF file that contains the result of this  
code. Note that the first and third pages are essentially the same,  
while the second has extra space after the figure when  
\begin{center}...\end{center} is used.


This would be one way of altering the default behavior of the figure  
environment, so that it is centered by default. Now just use:


  \begin{centerfig}
  ...
  \end{centerfig}

instead of:

  \begin{figure}
\begin{center}
...
\end{center}
  \end{figure}

HTH,

Marc Schwartz



\documentclass[10pt]{article}
\usepackage{graphicx}

\begin{document}

\setlength{\parindent}{0pt}
\setlength{\parskip}{0pt}


%% Here is the new environment called centerfig
\newenvironment{centerfig}
{\begin{figure}[htp]\centering}
{\end{figure}}


Here is some text before the figure

\begin{centerfig}
fig=TRUE=
  x - seq(0, 5, 0.1)
  y - x^3
  par(mar = c(2, 3, 0, 0))
  plot(x, y, ann = FALSE, type = l, las = 1)
@
\caption{Using ``centerfig''}
\end{centerfig}

Here is some text after the figure


\clearpage


Here is some text before the figure

\begin{figure}[htp]
\begin{center}
fig=TRUE=
  x - seq(0, 5, 0.1)
  y - x^3
  par(mar = c(2, 3, 0, 0))
  plot(x, y, ann = FALSE, type = l, las = 1)
@
\caption{Using ``figure'' with $\backslash$begin\{center\}...$ 
\backslash$end\{center\}}

\end{center}
\end{figure}

Here is some text after the figure


\clearpage


Here is some text before the figure

\begin{figure}[htp]
\begin{Schunk}
\begin{Sinput}
 x - seq(0, 5, 0.1)
 y - x^3
 par(mar = c(2, 3, 0, 0))
 plot(x, y, ann = FALSE, type = l, las = 1)
\end{Sinput}
\end{Schunk}
%% Use same graphic file as the first
\centerline{\includegraphics{test-001}}
\caption{Using ``figure'' with $\backslash$centerline}
\end{figure}

Here is some text after the figure


\end{document}






test.pdf
Description: Adobe PDF document


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] How to fix my nested conditional IF ELSE code?

2009-06-14 Thread Gabor Grothendieck
Note that TRUE and FALSE become 1 and 0 when used in arithmetic
formulae so:

result - with(DF,
(type %in% c(A, B, C)) *
(1 * (status == a) + 2 * (status == b) + 3 * (status == 
c)) +
(type %in% c(D, E, F)) *
(9 * (status == a) + 8 * (status == b) + 7 * (status == 
c)))

If none of the conditions hold for row i then result[i] will be 0.


On Sun, Jun 14, 2009 at 6:18 PM, Mark Namtb...@gmail.com wrote:
 Hi,
 I've been struggling most of the morning with an IF ELSE problem, and I
 wonder if someone might be able to sort me out.

 Here's what I need to do (dummy example, my data are more complicated):

 If type = A or B or C
     and status = a then count = 1
     and status = b then count = 2
     and status = c then count = 3

 Else if type = D or E or F
     and status = a then count = 9
     and status = b then count = 8
     and status = c then count = 7

 End

 Seems simple when I write it like that, but the R code is escaping me.

 Thanks!

 Mark Na

        [[alternative HTML version deleted]]

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] lack of memory for logistic regression in R?

2009-06-14 Thread Michael
Hi all,

I am getting the following error message:

 mymodel = glm(response ~ . , family=binomial, data=C);
Error: cannot allocate vector of size 734.2 Mb
In addition: Warning messages:
1: In array(0, c(n, n), list(levs, levs)) :
  Reached total allocation of 1535Mb: see help(memory.size)
2: In array(0, c(n, n), list(levs, levs)) :
  Reached total allocation of 1535Mb: see help(memory.size)
3: In array(0, c(n, n), list(levs, levs)) :
  Reached total allocation of 1535Mb: see help(memory.size)
4: In array(0, c(n, n), list(levs, levs)) :
  Reached total allocation of 1535Mb: see help(memory.size)

---

The data frame is 6 x 20,

is it too large for R?

What shall I do? Will close all other softwares/applications help? My
PC is Vista with 4GB memory. Thank you.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] FBI Homicide data?

2009-06-14 Thread spencerg
Hi, Mario: 



 The following suggest to me that these data may not be available 
in any contributed R package: 



library(RSiteSearch)
fbi - RSiteSearch.function('FBI Homicide')
hits(fbi) # 0
hom - RSiteSearch.function('Homicide')
hits(hom) # 4
HTML(hom)


 The 4 items exposed via the last line here seemed to be different 
data sets from the one you described.  This searched all the help pages 
for contributed packages.  I also searched for FBI with comparable 
results.  If it exists in a contributed package, it is not easy to find. 



 Have you tried writing to someone at the Institute for 
Visualization and Perception Research at U Mass-Lowell? 



 Hope this helps. 
 Spencer


Mario Valle wrote:

Dear all,
do you know if it's available and where the FBI Homicide dataset?
It has at least the following columns: victim age, homicide age.
A scatterplot of this data is visible here:
 http://www.uml.edu/gallery/main.php?g2_itemId=6016

Thanks for your help!
mario



__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] books on Time series

2009-06-14 Thread Antonio Olinto

Dear list fellows,

I want to study time series and use R to analyse time series of fishing 
data from several species (landings and cpue) investigating the 
correlation between them and with environmental factors (water 
temperature, wind, etc.).


Searching at Amazon I found three books with examples in R:

Time Series Analysis: With Applications in R by Jonathan D. Cryer and 
Jonathan D. Cryer


Time Series Analysis and Its Applications: With R Examples by Robert H. 
Shumway and Robert H. Shumway


Introductory Time Series with R (Use R) by Paul S.P. Cowpertwait and 
Andrew V. Metcalfe


I would like to receive any suggestion of which is most appropriate for 
a non-statistician (I am a biologist). Reading only the index I could 
not evaluate it.


Thanks in advance,

Antonio Olinto

Marine Fisheries Center
Sao Paulo Fisheries Institute
Brazil

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] FBI Homicide data?

2009-06-14 Thread David Winsemius
That graphic was created as part of a Ph D thesis in the mid 1990's. I  
sent the OP off-list a link to that work and the FBI webpage that  
describes access to such data.


--
David


On Jun 14, 2009, at 9:11 PM, spencerg wrote:


Hi, Mario:

The following suggest to me that these data may not be available  
in any contributed R package:


library(RSiteSearch)
fbi - RSiteSearch.function('FBI Homicide')
hits(fbi) # 0
hom - RSiteSearch.function('Homicide')
hits(hom) # 4
HTML(hom)


The 4 items exposed via the last line here seemed to be  
different data sets from the one you described.  This searched all  
the help pages for contributed packages.  I also searched for FBI  
with comparable results.  If it exists in a contributed package, it  
is not easy to find.


Have you tried writing to someone at the Institute for  
Visualization and Perception Research at U Mass-Lowell?


Hope this helps.  Spencer

Mario Valle wrote:

Dear all,
do you know if it's available and where the FBI Homicide dataset?
It has at least the following columns: victim age, homicide age.
A scatterplot of this data is visible here:
http://www.uml.edu/gallery/main.php?g2_itemId=6016

Thanks for your help!
mario

--
David Winsemius, MD
Heritage Laboratories
West Hartford, CT

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] lack of memory for logistic regression in R?

2009-06-14 Thread David Winsemius


On Jun 14, 2009, at 9:06 PM, Michael wrote:


Hi all,

I am getting the following error message:


mymodel = glm(response ~ . , family=binomial, data=C);

Error: cannot allocate vector of size 734.2 Mb
In addition: Warning messages:
1: In array(0, c(n, n), list(levs, levs)) :
 Reached total allocation of 1535Mb: see help(memory.size)
2: In array(0, c(n, n), list(levs, levs)) :
 Reached total allocation of 1535Mb: see help(memory.size)
3: In array(0, c(n, n), list(levs, levs)) :
 Reached total allocation of 1535Mb: see help(memory.size)
4: In array(0, c(n, n), list(levs, levs)) :
 Reached total allocation of 1535Mb: see help(memory.size)

---

The data frame is 6 x 20,

is it too large for R?

What shall I do? Will close all other softwares/applications help? My
PC is Vista with 4GB memory. Thank you.


It's certainly not too large for R. Have you looked at the R Windows  
FAQ on the topic?


http://cran.r-project.org/bin/windows/base/rw-FAQ.html#There-seems-to-be-a-limit-on-the-memory-it-uses_0021

... and perhaps:

http://finzi.psych.upenn.edu/Rhelp08/2008-August/171649.html


David Winsemius, MD
Heritage Laboratories
West Hartford, CT

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Identifying clusters of size n

2009-06-14 Thread Dylan Beaudette
On Sun, Jun 14, 2009 at 4:39 PM, Nathan S.
Watson-Haighnathan.watson-ha...@csiro.au wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Is there a library which is capable of identifying distinct clusters of size n
 from a series of XY coordinates?

 Failing this, I'd like to be able to to something like:
 Using a sliding window of size n along the x-axis I'd like to determine the
 distance between the center of the points in the window and the closest point
 outside the window. I could then use a distance cutoff to help define my
 clusters of size n. However, how can I calculate this distance?

 Cheers,
 Nathan


Here is a start, using PAM clustering:

http://casoilresource.lawr.ucdavis.edu/drupal/node/340

cheers,
Dylan

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] if + is.na

2009-06-14 Thread Jeremiah Rounds

Your error message is because if wants a single value and you are giving it a 
vector.  

 

Typically you want to use functions all or any to correct this error message 
(look them up ?all ?any) and eg if(any(is.na(...)))   But in this case to 
accomplish the task you're after I don't even think you want to use an if.  I 
am not going to give you precise code because I wasn't able to decipher exactly 
what you were trying to do but something like:

 

b[is.na(a)] = 43

 

might be helpful.  This line would put a 43 in b in the corresponding entry 
that was na in a.

 

Good luck!.

 


 
 Date: Sun, 14 Jun 2009 12:48:58 -0700
 From: gregori...@gmail.com
 To: r-help@r-project.org
 Subject: [R] if + is.na
 
 
 Hello!
 I wont to use a function is.na() 
 
 I have two vectors:
  a=c(1,NA,3,3,3)
  b=c(0,0,0,0,0)
 and when I use is.na function it's ok:
  is.na(a)
 [1] FALSE TRUE FALSE FALSE FALSE
 
 but I would create sth like this:
 
 for i in 1:length(a){
 if (wsp[i] == is.na(a)) {b=43}
 }
 or like this 
 
 if(is.na(a)) b=3 else a
 [1] 1 NA 3 3 3
 
 but I always get an error:
 the condition has length  1 and only the first element will be used
 
 Could you help me how I may avoid this problem and use function is.na inside
 function if - else
 Please
 
 
 -- 
 View this message in context: 
 http://www.nabble.com/if-%2B-is.na-tp24025136p24025136.html
 Sent from the R help mailing list archive at Nabble.com.
 
 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.

_
Lauren found her dream laptop. Find the PC that’s right for you.

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Identifying clusters of size n

2009-06-14 Thread Dylan Beaudette
On Sun, Jun 14, 2009 at 7:26 PM, Nathan S.
Watson-Haighnathan.watson-ha...@csiro.au wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Dylan Beaudette wrote:
 On Sun, Jun 14, 2009 at 4:39 PM, Nathan S.
 Watson-Haighnathan.watson-ha...@csiro.au wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Is there a library which is capable of identifying distinct clusters of 
 size n
 from a series of XY coordinates?

 Failing this, I'd like to be able to to something like:
 Using a sliding window of size n along the x-axis I'd like to determine the
 distance between the center of the points in the window and the closest 
 point
 outside the window. I could then use a distance cutoff to help define my
 clusters of size n. However, how can I calculate this distance?

 Cheers,
 Nathan


 Here is a start, using PAM clustering:

 http://casoilresource.lawr.ucdavis.edu/drupal/node/340

 cheers,
 Dylan


Hi,


 Thanks, that looks interesting. However I need a clustering algorithm which 
 has
 the following properties:

 1) The ability to define clusters of size n
 2) No need to specify a priory how many clusters there will be
 3) The ability to omit data from any cluster. I don't think this package can 
 do
 this.

Time to do some reading on the various clustering algorithms, their
assumptions, and their overall behaviour. Although I am not an expert,
many of the constraints you are trying to impose on the clustering
will require some kind of programming / decision on your end. It may
help to re-formulate the problem into some kind of raster-operation,
in which case GRASS GIS might be of interest to you.

 I suspect for something like this I'll have to define, a priory, how tight
 points within a cluster should be using some measure.


Hmm... In this case you may need to use a model-based / or
density-based approach. See mclust and spatstat packages. (???)

Cheers,

Dylan

 Any thoughts?
 Nathan

 - --
 - 
 Dr. Nathan S. Watson-Haigh
 OCE Post Doctoral Fellow
 CSIRO Livestock Industries
 Queensland Bioscience Precinct
 St Lucia, QLD 4067
 Australia

 Tel: +61 (0)7 3214 2922
 Fax: +61 (0)7 3214 2900
 Web: http://www.csiro.au/people/Nathan.Watson-Haigh.html
 - 

 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.9 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

 iEYEARECAAYFAko1sWMACgkQ9gTv6QYzVL7grwCZAQh72v33vPNJJgEFJEhfyNc3
 718AnA3k7wvvLEZ4NS1enW3Xp5WhO+qJ
 =1gyG
 -END PGP SIGNATURE-


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Centering graphics by default in Sweave

2009-06-14 Thread Frank E Harrell Jr

Thanks very much Marc for the very useful ideas.

I do hope there will be an even more concise way to do this.  At present 
I'm not using figure environments in Sweave as in stat reports I don't 
usually need floats.


I tried re-defining \includegraphics to include \centerline but got into 
infinite recursion as expected.  It would be nice if LaTeX had an easy 
way to \renewcommand that allowed use of the existing definition of the 
command.


Frank


Marc Schwartz wrote:


On Jun 14, 2009, at 2:28 PM, Frank E Harrell Jr wrote:

Is there an elegant way to get Sweave to center graphics by default? 
I'd like to use \centerline{\includegraphics{}} etc. to save some 
vertical space that \begin{center} ... \end{center} uses, and I'd like 
to avoid centering with each fig=T=


Frank,

My comments below are based upon the presumption that you are using a 
'figure' environment for your plots.


As far as I know, there is no Sweave option for this, however, reviewing 
the code for the handling of the 'include' option, it looks like (at 
first glance) that it might not be too difficult to add one. The 
'includegraphics' statement is output as part of the handling of the 
'include' option code. It would take more time to be sure that I am not 
missing something.


However, there is an alternative, which is to define a new environment 
using the \newenvironment command and have it encapsulate the normal 
'figure' environment along with a \centering command. \centering will 
accomplish the same thing as using \centerline, which is to save some 
vertical space after the figure environment if otherwise using the 
'center' environment. BTW, this extra vertical space occurs because the 
'center' environment is built on top of the 'list' environment, which 
introduces different paragraph spacing.


To that end, below is some example .Rnw code for a document including 
the specification of a new environment called 'centerfig', which can 
then be used in the same way you would call the regular 'figure' 
environment. The definition consists of two lines. The first is what is 
used at the beginning of the environment and the second is used at the 
end. In this case, the first line calls the figure environment with the 
addition of \centering. The second line simply ends the figure 
environment. Think of the two lines as macro substitutions.


I have included a copy of a PDF file that contains the result of this 
code. Note that the first and third pages are essentially the same, 
while the second has extra space after the figure when 
\begin{center}...\end{center} is used.


This would be one way of altering the default behavior of the figure 
environment, so that it is centered by default. Now just use:


  \begin{centerfig}
  ...
  \end{centerfig}

instead of:

  \begin{figure}
\begin{center}
...
\end{center}
  \end{figure}

HTH,

Marc Schwartz



\documentclass[10pt]{article}
\usepackage{graphicx}

\begin{document}

\setlength{\parindent}{0pt}
\setlength{\parskip}{0pt}


%% Here is the new environment called centerfig
\newenvironment{centerfig}
{\begin{figure}[htp]\centering}
{\end{figure}}


Here is some text before the figure

\begin{centerfig}
fig=TRUE=
  x - seq(0, 5, 0.1)
  y - x^3
  par(mar = c(2, 3, 0, 0))
  plot(x, y, ann = FALSE, type = l, las = 1)
@
\caption{Using ``centerfig''}
\end{centerfig}

Here is some text after the figure


\clearpage


Here is some text before the figure

\begin{figure}[htp]
\begin{center}
fig=TRUE=
  x - seq(0, 5, 0.1)
  y - x^3
  par(mar = c(2, 3, 0, 0))
  plot(x, y, ann = FALSE, type = l, las = 1)
@
\caption{Using ``figure'' with 
$\backslash$begin\{center\}...$\backslash$end\{center\}}

\end{center}
\end{figure}

Here is some text after the figure


\clearpage


Here is some text before the figure

\begin{figure}[htp]
\begin{Schunk}
\begin{Sinput}
  x - seq(0, 5, 0.1)
  y - x^3
  par(mar = c(2, 3, 0, 0))
  plot(x, y, ann = FALSE, type = l, las = 1)
\end{Sinput}
\end{Schunk}
%% Use same graphic file as the first
\centerline{\includegraphics{test-001}}
\caption{Using ``figure'' with $\backslash$centerline}
\end{figure}

Here is some text after the figure


\end{document}








--
Frank E Harrell Jr   Professor and Chair   School of Medicine
 Department of Biostatistics   Vanderbilt University

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] lack of memory for logistic regression in R?

2009-06-14 Thread Michael
I have to use logistic regression...

On Sun, Jun 14, 2009 at 8:04 PM, Frank E Harrell
Jrf.harr...@vanderbilt.edu wrote:
 Also it would be useful to compare glm with the lrm function in the Design
 package, for speed and memory use.

 Frank


 David Winsemius wrote:

 On Jun 14, 2009, at 9:06 PM, Michael wrote:

 Hi all,

 I am getting the following error message:

 mymodel = glm(response ~ . , family=binomial, data=C);

 Error: cannot allocate vector of size 734.2 Mb
 In addition: Warning messages:
 1: In array(0, c(n, n), list(levs, levs)) :
  Reached total allocation of 1535Mb: see help(memory.size)
 2: In array(0, c(n, n), list(levs, levs)) :
  Reached total allocation of 1535Mb: see help(memory.size)
 3: In array(0, c(n, n), list(levs, levs)) :
  Reached total allocation of 1535Mb: see help(memory.size)
 4: In array(0, c(n, n), list(levs, levs)) :
  Reached total allocation of 1535Mb: see help(memory.size)

 ---

 The data frame is 6 x 20,

 is it too large for R?

 What shall I do? Will close all other softwares/applications help? My
 PC is Vista with 4GB memory. Thank you.

 It's certainly not too large for R. Have you looked at the R Windows FAQ
 on the topic?


 http://cran.r-project.org/bin/windows/base/rw-FAQ.html#There-seems-to-be-a-limit-on-the-memory-it-uses_0021

 ... and perhaps:

 http://finzi.psych.upenn.edu/Rhelp08/2008-August/171649.html


 David Winsemius, MD
 Heritage Laboratories
 West Hartford, CT

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.



 --
 Frank E Harrell Jr   Professor and Chair           School of Medicine
                     Department of Biostatistics   Vanderbilt University


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] How to fix my nested conditional IF ELSE code?

2009-06-14 Thread Mark Na
Thanks Gabor, this is quite clever and it's nice to see another way of doing
it (without ifelse).
Mark


On Sun, Jun 14, 2009 at 6:51 PM, Gabor Grothendieck ggrothendi...@gmail.com
 wrote:

 Note that TRUE and FALSE become 1 and 0 when used in arithmetic
 formulae so:

 result - with(DF,
(type %in% c(A, B, C)) *
(1 * (status == a) + 2 * (status == b) + 3 * (status ==
 c)) +
(type %in% c(D, E, F)) *
(9 * (status == a) + 8 * (status == b) + 7 * (status ==
 c)))

 If none of the conditions hold for row i then result[i] will be 0.


 On Sun, Jun 14, 2009 at 6:18 PM, Mark Namtb...@gmail.com wrote:
  Hi,
  I've been struggling most of the morning with an IF ELSE problem, and I
  wonder if someone might be able to sort me out.
 
  Here's what I need to do (dummy example, my data are more complicated):
 
  If type = A or B or C
  and status = a then count = 1
  and status = b then count = 2
  and status = c then count = 3
 
  Else if type = D or E or F
  and status = a then count = 9
  and status = b then count = 8
  and status = c then count = 7
 
  End
 
  Seems simple when I write it like that, but the R code is escaping me.
 
  Thanks!
 
  Mark Na
 
 [[alternative HTML version deleted]]
 
  __
  R-help@r-project.org mailing list
  https://stat.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
  and provide commented, minimal, self-contained, reproducible code.
 


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] lack of memory for logistic regression in R?

2009-06-14 Thread Frank E Harrell Jr

Michael wrote:

I have to use logistic regression...


Good.  That's what lrm is dedicated to.
Frank



On Sun, Jun 14, 2009 at 8:04 PM, Frank E Harrell
Jrf.harr...@vanderbilt.edu wrote:

Also it would be useful to compare glm with the lrm function in the Design
package, for speed and memory use.

Frank


David Winsemius wrote:

On Jun 14, 2009, at 9:06 PM, Michael wrote:


Hi all,

I am getting the following error message:


mymodel = glm(response ~ . , family=binomial, data=C);

Error: cannot allocate vector of size 734.2 Mb
In addition: Warning messages:
1: In array(0, c(n, n), list(levs, levs)) :
 Reached total allocation of 1535Mb: see help(memory.size)
2: In array(0, c(n, n), list(levs, levs)) :
 Reached total allocation of 1535Mb: see help(memory.size)
3: In array(0, c(n, n), list(levs, levs)) :
 Reached total allocation of 1535Mb: see help(memory.size)
4: In array(0, c(n, n), list(levs, levs)) :
 Reached total allocation of 1535Mb: see help(memory.size)

---

The data frame is 6 x 20,

is it too large for R?

What shall I do? Will close all other softwares/applications help? My
PC is Vista with 4GB memory. Thank you.

It's certainly not too large for R. Have you looked at the R Windows FAQ
on the topic?


http://cran.r-project.org/bin/windows/base/rw-FAQ.html#There-seems-to-be-a-limit-on-the-memory-it-uses_0021

... and perhaps:

http://finzi.psych.upenn.edu/Rhelp08/2008-August/171649.html


David Winsemius, MD
Heritage Laboratories
West Hartford, CT

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.



--
Frank E Harrell Jr   Professor and Chair   School of Medicine
Department of Biostatistics   Vanderbilt University






--
Frank E Harrell Jr   Professor and Chair   School of Medicine
 Department of Biostatistics   Vanderbilt University

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Sweave template

2009-06-14 Thread Frank E Harrell Jr

Dear Group,

I have made significant improvements to our Sweave template, have made 
the template self-contained (i.e., you can run it yourself and it will 
find the datasets it needs), and have included the output pdf file. 
This is at http://biostat.mc.vanderbilt.edu/SweaveTemplate .  You will 
see in the pdf file the enhancements in how R code is pretty-printed, 
and I have added an example where some R function output is suppressed 
from the listing that Sweave typesets.  The new template also suggests 
how to auto-document the computing environment at the end of the report, 
and how to properly reference R and add-on packages.  Figures are 
centered (but not as nicely as Marc Schwartz' approach) and better 
defaults are used for axis label and tick mark label positioning.


Thanks to Romain Francois for providing the trick of suppressing parts 
of R output (replacing it with ...) and Peter Ruckdeschel for his 
excellent SweaveListingUtils package.  Suggestions for further 
improvements are welcomed.


Frank
--
Frank E Harrell Jr   Professor and Chair   School of Medicine
 Department of Biostatistics   Vanderbilt University

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Identifying clusters of size n

2009-06-14 Thread Nathan S. Watson-Haigh
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Dylan Beaudette wrote:
 On Sun, Jun 14, 2009 at 4:39 PM, Nathan S.
 Watson-Haighnathan.watson-ha...@csiro.au wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Is there a library which is capable of identifying distinct clusters of size 
 n
 from a series of XY coordinates?

 Failing this, I'd like to be able to to something like:
 Using a sliding window of size n along the x-axis I'd like to determine the
 distance between the center of the points in the window and the closest point
 outside the window. I could then use a distance cutoff to help define my
 clusters of size n. However, how can I calculate this distance?

 Cheers,
 Nathan

 
 Here is a start, using PAM clustering:
 
 http://casoilresource.lawr.ucdavis.edu/drupal/node/340
 
 cheers,
 Dylan


Thanks, that looks interesting. However I need a clustering algorithm which has
the following properties:

1) The ability to define clusters of size n
2) No need to specify a priory how many clusters there will be
3) The ability to omit data from any cluster. I don't think this package can do
this.

I suspect for something like this I'll have to define, a priory, how tight
points within a cluster should be using some measure.

Any thoughts?
Nathan

- --
- 
Dr. Nathan S. Watson-Haigh
OCE Post Doctoral Fellow
CSIRO Livestock Industries
Queensland Bioscience Precinct
St Lucia, QLD 4067
Australia

Tel: +61 (0)7 3214 2922
Fax: +61 (0)7 3214 2900
Web: http://www.csiro.au/people/Nathan.Watson-Haigh.html
- 

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAko1sWMACgkQ9gTv6QYzVL7grwCZAQh72v33vPNJJgEFJEhfyNc3
718AnA3k7wvvLEZ4NS1enW3Xp5WhO+qJ
=1gyG
-END PGP SIGNATURE-

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Identifying clusters of size n

2009-06-14 Thread Mose
Hey Nathan,

You might like the DBSCAN algorithm.

http://en.wikipedia.org/wiki/DBSCAN

There's an implementation in the 'fpc' package.

http://cran.r-project.org/web/packages/fpc/index.html

-Mose

On Sun, Jun 14, 2009 at 7:36 PM, Dylan
Beaudettedylan.beaude...@gmail.com wrote:
 On Sun, Jun 14, 2009 at 7:26 PM, Nathan S.
 Watson-Haighnathan.watson-ha...@csiro.au wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Dylan Beaudette wrote:
 On Sun, Jun 14, 2009 at 4:39 PM, Nathan S.
 Watson-Haighnathan.watson-ha...@csiro.au wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Is there a library which is capable of identifying distinct clusters of 
 size n
 from a series of XY coordinates?

 Failing this, I'd like to be able to to something like:
 Using a sliding window of size n along the x-axis I'd like to determine the
 distance between the center of the points in the window and the closest 
 point
 outside the window. I could then use a distance cutoff to help define my
 clusters of size n. However, how can I calculate this distance?

 Cheers,
 Nathan


 Here is a start, using PAM clustering:

 http://casoilresource.lawr.ucdavis.edu/drupal/node/340

 cheers,
 Dylan


 Hi,


 Thanks, that looks interesting. However I need a clustering algorithm which 
 has
 the following properties:

 1) The ability to define clusters of size n
 2) No need to specify a priory how many clusters there will be
 3) The ability to omit data from any cluster. I don't think this package can 
 do
 this.

 Time to do some reading on the various clustering algorithms, their
 assumptions, and their overall behaviour. Although I am not an expert,
 many of the constraints you are trying to impose on the clustering
 will require some kind of programming / decision on your end. It may
 help to re-formulate the problem into some kind of raster-operation,
 in which case GRASS GIS might be of interest to you.

 I suspect for something like this I'll have to define, a priory, how tight
 points within a cluster should be using some measure.


 Hmm... In this case you may need to use a model-based / or
 density-based approach. See mclust and spatstat packages. (???)

 Cheers,

 Dylan

 Any thoughts?
 Nathan

 - --
 - 
 Dr. Nathan S. Watson-Haigh
 OCE Post Doctoral Fellow
 CSIRO Livestock Industries
 Queensland Bioscience Precinct
 St Lucia, QLD 4067
 Australia

 Tel: +61 (0)7 3214 2922
 Fax: +61 (0)7 3214 2900
 Web: http://www.csiro.au/people/Nathan.Watson-Haigh.html
 - 

 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.9 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

 iEYEARECAAYFAko1sWMACgkQ9gTv6QYzVL7grwCZAQh72v33vPNJJgEFJEhfyNc3
 718AnA3k7wvvLEZ4NS1enW3Xp5WhO+qJ
 =1gyG
 -END PGP SIGNATURE-


 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.