Re: [R] Querying the path separator?

2011-06-28 Thread Berend Hasselman

Jonathan Greenberg wrote:
> 
> The problem is that I'm trying to create a path to use with a system()
> call, and the command window will not work with the forward slash,
> only with the standard backslash.  I do understand that within R it
> will work with either way, but not via the system call.  I'm trying to
> create a "generic" system() call that will work with an external
> executable that is available on both windows and unix machines.
> 

Would .Platform$file.sep help you?
I can't test this.

Berend

--
View this message in context: 
http://r.789695.n4.nabble.com/Querying-the-path-separator-tp3631806p3632161.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] R-Installation on Unix -- "Make: Don't know how to make #. Stop."

2011-06-28 Thread Prof Brian Ripley
(a) Most likely you need GNU make: what are you using?  (See the 'R 
Installation and Administration' manual.)  This does not look like 
normal GNU make (which does not call itself 'Make').


(b) R-devel is the list for such questions: see the posting guide.

On Tue, 28 Jun 2011, Zhou, Hong wrote:


Hi, all,

./configure was run successfully on my HP-UX ia64 server with exit=0, but when type make 
at prompt, get this error "Make: Don't know how to make #.  Stop."  Does anyone 
has any clues about this message? Thank you very much!
#make
Rmath.h is unchanged
`libRblas.sl' is up to date.
/app/R/R-2.13.0/lib/libRblas.sl is unchanged
`libbz2.a' is up to date.
`libpcre.a' is up to date.
`libz.a' is up to date.
../../../src/include/libintl.h is unchanged
../../../include/libintl.h is unchanged
`charsetalias.h' is up to date.
`libintl.a' is up to date.
`libtre.a' is up to date.
`liblzma.a' is up to date.
Make: Don't know how to make #.  Stop.
*** Error exit code 1
Stop.
Hong

[[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.



--
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] Querying the path separator?

2011-06-28 Thread Jonathan Greenberg
The problem is that I'm trying to create a path to use with a system()
call, and the command window will not work with the forward slash,
only with the standard backslash.  I do understand that within R it
will work with either way, but not via the system call.  I'm trying to
create a "generic" system() call that will work with an external
executable that is available on both windows and unix machines.

--j



On Tue, Jun 28, 2011 at 10:02 PM, Jeff Newmiller
 wrote:
> Windows will work with either separator.
> ---
> Jeff Newmiller The . . Go Live...
> DCN: Basics: ##.#. ##.#. Live Go...
> Live: OO#.. Dead: OO#.. Playing
> Research Engineer (Solar/Batteries O.O#. #.O#. with
> /Software/Embedded Controllers) .OO#. .OO#. rocks...1k
> ---
> Sent from my phone. Please excuse my brevity.
>
> Jonathan Greenberg  wrote:
>>
>> Thanks Henrik, but as the help for this function states:
>>
>> Note
>> The components are separated by / (not \) on Windows.
>>
>> , the slashes it uses are incorrect for use in a CMD window on a
>> Windows box (they need to be \ but file.path uses /).  I suppose I can
>> do a query as to whether the platform is Windows (in which case use \)
>> or other (in which case use /) -- there isn't a more "clever" way of
>> doing this?
>>
>> --j
>>
>> On Tue, Jun 28, 2011 at 7:10 PM, Henrik Bengtsson 
>> wrote:
>> > See file.path().
>> >
>> > /Henrik
>> >
>> > On Tue, Jun 28, 2011 at 6:59 PM, Jonathan Greenberg
>> >  wrote:
>> >> Hopefully this is a pretty easy fix -- I need to have R query the path
>> >> separator for some code I'm trying to write (it involves using a
>> >
>>  >
>> system() call) -- the call requires a path and a wildcard, e.g.:
>> >>
>> >> command="mycommand /path/to/*.files" in the case of unix or,
>> >> command="mycommand.exe C:\\path\\to\\*.files" on a windows box
>> >>
>> >> System.which is working correctly, so the "mycommand" vs
>> >> "mycommand.exe" part is working fine.  The issue is that the /path/to
>> >> should be set to getwd(), but this strips the trailing path separator.
>> >>  How do I go about querying the correct path separator for the system,
>> >> so I can include it in a paste command (via sep=)?  Thanks!
>> >>
>> >> --j
>> >>
>> >> --
>> >> Jonathan A. Greenberg, PhD
>> >> Assistant Project Scientist
>> >> Center for Spatial Technologies and Remote Sensing (CSTARS)
>> >> Department of Land, Air and Water Resources
>> >> University of California, Davis
>> >> One S
>>  hields
>> Avenue
>> >> Davis, CA 95616
>> >> Phone: 415-763-5476
>> >> AIM: jgrn307, MSN: jgrn...@hotmail.com, Gchat: jgrn307
>> >>
>> >>
>> 
>> >> 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.
>> >>
>> >
>>
>>
>>
>> --
>> Jonathan A. Greenberg, PhD
>> Assistant Project Scientist
>> Center for Spatial Technologies and Remote Sensing (CSTARS)
>> Department of Land, Air and Water Resources
>> University of California, Davis
>> One Shields Avenue
>> Davis, CA 95616
>> Phone: 415-763-5476
>> AIM: jgrn307, MSN: jgrn...@hotmail.com, Gchat: jgrn307
>>
>> 
>> 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.
>



-- 
Jonathan A. Greenberg, PhD
Assistant Project Scientist
Center for Spatial Technologies and Remote Sensing (CSTARS)
Department of Land, Air and Water Resources
University of California, Davis
One Shields Avenue
Davis, CA 95616
Phone: 415-763-5476
AIM: jgrn307, MSN: jgrn...@hotmail.com, Gchat: jgrn307

__
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] Querying the path separator?

2011-06-28 Thread Jeff Newmiller
Windows will work with either separator.
---
Jeff Newmiller The . . Go Live...
DCN: Basics: ##.#. ##.#. Live Go...
Live: OO#.. Dead: OO#.. Playing
Research Engineer (Solar/Batteries O.O#. #.O#. with
/Software/Embedded Controllers) .OO#. .OO#. rocks...1k
--- 
Sent from my phone. Please excuse my brevity.

Jonathan Greenberg  wrote:

Thanks Henrik, but as the help for this function states:

Note
The components are separated by / (not \) on Windows.

, the slashes it uses are incorrect for use in a CMD window on a
Windows box (they need to be \ but file.path uses /). I suppose I can
do a query as to whether the platform is Windows (in which case use \)
or other (in which case use /) -- there isn't a more "clever" way of
doing this?

--j

On Tue, Jun 28, 2011 at 7:10 PM, Henrik Bengtsson  wrote:
> See file.path().
>
> /Henrik
>
> On Tue, Jun 28, 2011 at 6:59 PM, Jonathan Greenberg
>  wrote:
>> Hopefully this is a pretty easy fix -- I need to have R query the path
>> separator for some code I'm trying to write (it involves using a
>> system() call) -- the call requires a path and a wildcard, e.g.:
>>
>> command="mycommand /path/to/*.files" in the case of unix or,
>> command="mycommand.exe C:\\path\\to\\*.files" on a windows box
>>
>> System.which is working correctly, so the "mycommand" vs
>> "mycommand.exe" part is working fine.  The issue is that the /path/to
>> should be set to getwd(), but this strips the trailing path separator.
>>  How do I go about querying the correct path separator for the system,
>> so I can include it in a paste command (via sep=)?  Thanks!
>>
>> --j
>>
>> --
>> Jonathan A. Greenberg, PhD
>> Assistant Project Scientist
>> Center for Spatial Technologies and Remote Sensing (CSTARS)
>> Department of Land, Air and Water Resources
>> University of California, Davis
>> One Shields Avenue
>> Davis, CA 95616
>> Phone: 415-763-5476
>> AIM: jgrn307, MSN: jgrn...@hotmail.com, Gchat: jgrn307
>>
>>_

>> 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.
>>
>



-- 
Jonathan A. Greenberg, PhD
Assistant Project Scientist
Center for Spatial Technologies and Remote Sensing (CSTARS)
Department of Land, Air and Water Resources
University of California, Davis
One Shields Avenue
Davis, CA 95616
Phone: 415-763-5476
AIM: jgrn307, MSN: jgrn...@hotmail.com, Gchat: jgrn307

_

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] Derivative of a function

2011-06-28 Thread Rolf Turner


(1) You really ought to do your own homework.

(2) What has this to do with R?

cheers,

Rolf Turner

On 29/06/11 14:03, Lisa wrote:

Dear all,

I just want to get the derivative of a function that looks like:

y = exp(x1*b) / (exp(x1*b) + exp(x2*b))

where y is a scalar, x1, x2, and b are vectors. I am going to take the
derivative of b with respect to y, but I cannot derive an expression in
which b is function of y. I know there is another way to get the similar
result, i.e., first take the derivative of y with respect to each element of
b, and then take its reciprocal. But it is not what I want. Could someone
please tell me how to solve this problem? Thank you in advance.

Lisa


--
View this message in context: 
http://r.789695.n4.nabble.com/Derivative-of-a-function-tp3631814p3631814.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.



__
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] Querying the path separator?

2011-06-28 Thread Jonathan Greenberg
Thanks Henrik, but as the help for this function states:

Note
The components are separated by / (not \) on Windows.

, the slashes it uses are incorrect for use in a CMD window on a
Windows box (they need to be \ but file.path uses /).  I suppose I can
do a query as to whether the platform is Windows (in which case use \)
or other (in which case use /) -- there isn't a more "clever" way of
doing this?

--j

On Tue, Jun 28, 2011 at 7:10 PM, Henrik Bengtsson  wrote:
> See file.path().
>
> /Henrik
>
> On Tue, Jun 28, 2011 at 6:59 PM, Jonathan Greenberg
>  wrote:
>> Hopefully this is a pretty easy fix -- I need to have R query the path
>> separator for some code I'm trying to write (it involves using a
>> system() call) -- the call requires a path and a wildcard, e.g.:
>>
>> command="mycommand /path/to/*.files" in the case of unix or,
>> command="mycommand.exe C:\\path\\to\\*.files" on a windows box
>>
>> System.which is working correctly, so the "mycommand" vs
>> "mycommand.exe" part is working fine.  The issue is that the /path/to
>> should be set to getwd(), but this strips the trailing path separator.
>>  How do I go about querying the correct path separator for the system,
>> so I can include it in a paste command (via sep=)?  Thanks!
>>
>> --j
>>
>> --
>> Jonathan A. Greenberg, PhD
>> Assistant Project Scientist
>> Center for Spatial Technologies and Remote Sensing (CSTARS)
>> Department of Land, Air and Water Resources
>> University of California, Davis
>> One Shields Avenue
>> Davis, CA 95616
>> Phone: 415-763-5476
>> AIM: jgrn307, MSN: jgrn...@hotmail.com, Gchat: jgrn307
>>
>> __
>> 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.
>>
>



-- 
Jonathan A. Greenberg, PhD
Assistant Project Scientist
Center for Spatial Technologies and Remote Sensing (CSTARS)
Department of Land, Air and Water Resources
University of California, Davis
One Shields Avenue
Davis, CA 95616
Phone: 415-763-5476
AIM: jgrn307, MSN: jgrn...@hotmail.com, Gchat: jgrn307

__
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] Derivative of a function

2011-06-28 Thread Lisa
Dear all,

I just want to get the derivative of a function that looks like:

y = exp(x1*b) / (exp(x1*b) + exp(x2*b))

where y is a scalar, x1, x2, and b are vectors. I am going to take the
derivative of b with respect to y, but I cannot derive an expression in
which b is function of y. I know there is another way to get the similar
result, i.e., first take the derivative of y with respect to each element of
b, and then take its reciprocal. But it is not what I want. Could someone
please tell me how to solve this problem? Thank you in advance. 

Lisa


--
View this message in context: 
http://r.789695.n4.nabble.com/Derivative-of-a-function-tp3631814p3631814.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] library(doBy) will not load

2011-06-28 Thread Tyler Rinker

Problem solved.  I lazily forgot to clean up my workspace with rm(list=ls()).  
A good reminder to do so after each exit.  Sorry for the wasted server space.
 

From: tyler_rin...@hotmail.com
To: r-help@r-project.org
Date: Tue, 28 Jun 2011 22:58:47 -0400
Subject: Re: [R] library(doBy) will not load

 
This is the error I get when I try to load snow.
 
> library(snow)
Error in as.character(t) : 't' is missing
Error in library(snow) : .First.lib failed for ‘snow’
 
 
From: tyler_rin...@hotmail.com
To: r-help@r-project.org
Date: Tue, 28 Jun 2011 22:47:06 -0400
Subject: [R] library(doBy) will not load
 
 
Greetings R Community,
 
One of my favorite packages won't load and I'm not sure why.  It loaded earlier 
today. The problem appears with the snow package, which doBy requires.  I tried 
reinstalling both packages again ,shutting [R] down, reinstalling [R] in the 
workspace (shortcut). Here's the weird thing.  The same exact library loads in 
another workspace using the same version of [R] with no problem.
 
OS:  Windows 7 
R version 2.14 (in development)
 
> library(doBy)
Loading required package: survival
Loading required package: splines
Loading required package: R2HTML
Loading required package: multcomp
Loading required package: mvtnorm
Loading required package: lme4
Loading required package: Matrix
Loading required package: lattice
Attaching package: ‘Matrix’
The following object(s) are masked from ‘package:base’:
det
 
Attaching package: ‘lme4’
The following object(s) are masked from ‘package:stats’:
AIC, BIC
Loading required package: snow
Error in as.character(t) : 't' is missing
Error: package ‘snow’ could not be loaded
> recodeVar
Error: object 'recodeVar' not found
 
Thank you in advance,
Tyler
  
[[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. 
[[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] library(doBy) will not load

2011-06-28 Thread Tyler Rinker

This is the error I get when I try to load snow.
 
> library(snow)
Error in as.character(t) : 't' is missing
Error in library(snow) : .First.lib failed for ‘snow’
 

From: tyler_rin...@hotmail.com
To: r-help@r-project.org
Date: Tue, 28 Jun 2011 22:47:06 -0400
Subject: [R] library(doBy) will not load

 
Greetings R Community,
 
One of my favorite packages won't load and I'm not sure why.  It loaded earlier 
today. The problem appears with the snow package, which doBy requires.  I tried 
reinstalling both packages again ,shutting [R] down, reinstalling [R] in the 
workspace (shortcut). Here's the weird thing.  The same exact library loads in 
another workspace using the same version of [R] with no problem.
 
OS:  Windows 7 
R version 2.14 (in development)
 
> library(doBy)
Loading required package: survival
Loading required package: splines
Loading required package: R2HTML
Loading required package: multcomp
Loading required package: mvtnorm
Loading required package: lme4
Loading required package: Matrix
Loading required package: lattice
Attaching package: ‘Matrix’
The following object(s) are masked from ‘package:base’:
det
 
Attaching package: ‘lme4’
The following object(s) are masked from ‘package:stats’:
AIC, BIC
Loading required package: snow
Error in as.character(t) : 't' is missing
Error: package ‘snow’ could not be loaded
> recodeVar
Error: object 'recodeVar' not found
 
Thank you in advance,
Tyler
  
[[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.


[R] library(doBy) will not load

2011-06-28 Thread Tyler Rinker

Greetings R Community,
 
One of my favorite packages won't load and I'm not sure why.  It loaded earlier 
today. The problem appears with the snow package, which doBy requires.  I tried 
reinstalling both packages again ,shutting [R] down, reinstalling [R] in the 
workspace (shortcut). Here's the weird thing.  The same exact library loads in 
another workspace using the same version of [R] with no problem.
 
OS:  Windows 7 
R version 2.14 (in development)
 
> library(doBy)
Loading required package: survival
Loading required package: splines
Loading required package: R2HTML
Loading required package: multcomp
Loading required package: mvtnorm
Loading required package: lme4
Loading required package: Matrix
Loading required package: lattice
Attaching package: ‘Matrix’
The following object(s) are masked from ‘package:base’:
det

Attaching package: ‘lme4’
The following object(s) are masked from ‘package:stats’:
AIC, BIC
Loading required package: snow
Error in as.character(t) : 't' is missing
Error: package ‘snow’ could not be loaded
> recodeVar
Error: object 'recodeVar' not found
 
Thank you in advance,
Tyler
  
[[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] Confidence interval from resampling

2011-06-28 Thread Rolf Turner

On 24/06/11 01:44, Adriana Bejarano wrote:

Dear R gurus,

I have the following code, but I still not know how to estimate and extract
confidence intervals (95%CI) from resampling.



Some sound advice --- still sound after all these years I believe --- in 
respect

of  boot strap confidence intervals, is to be found in

Theoretical comparison of bootstrap confidence intervals,
Peter Hall, Annals of Statistics vol. 16 no. 3 1988, pp. 927 -- 953.


cheers,

Rolf Turner

__
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 Weighted Least Square Model for a Binary Outcome

2011-06-28 Thread Daniel Malter
You can specify the weights=... argument in the lm() function as vector of
weights, one for each observation. Should that not do what your are trying
to do?

HTH,
Daniel

--
View this message in context: 
http://r.789695.n4.nabble.com/a-Weighted-Least-Square-Model-for-a-Binary-Outcome-tp3631551p3631834.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] Indexing to Insert values from a dataframe into a matrix

2011-06-28 Thread Daisy Englert Duursma
Thanks, that worked like a charm.

Daisy

On Wed, Jun 29, 2011 at 11:47 AM, David Winsemius
 wrote:
>
> On Jun 28, 2011, at 9:18 PM, Daisy Englert Duursma wrote:
>
>> Hello,
>>
>> I think this is a simple problem but I am not coming up with a simple
>> solution. I think it just an indexing problem.
>>
>> I can easily replace values in a matrix from a dataframe when the
>> dataframe has row and column numbers. In the example below I use row
>> and column names and  I can not get it to work
>>
>> #make a matrix where rows and columns are the lat and long for a
>> bounding box of Australia and all elements have the value of -9990
>>
>> bb<-matrix(c(rep(-,691*886)),nrow=691
>> ,ncol
>> =886,dimnames=list(seq(-10,-44.50,by=-0.05),seq(112,156.25,by=0.05)))
>>
>> #dfr with row names and col names and values to be replaced in the matrix
>>
>> dfr <- data.frame(cbind(x=seq(120,125,by=0.05), y=-25, var.1=1))
>>
>> #insert the values from the dfr into the matrix
>> bb[dfr$x,dfr$y]<-d$var.1
>
> Indexing with a two column matrix is possible, but those vectors are not
> legitimate indices even if you bundle them into a two column matrix.
> (dfr$y's are all -25, so at least the error report is informative).
>
> These will return indices:
> sapply(as.character(dfr$y), function(x) which(x== dimnames(bb)[[1]]))
> sapply(as.character(dfr$x), function(x) which(x== dimnames(bb)[[2]]))
>
> So try:
>> #insert the values from the dfr into the matrix
>> bb[matrix(c(sapply(as.character(dfr$y), function(x) which(x==
>> dimnames(bb)[[1]])),  sapply(as.character(dfr$x), function(x) which(x==
>> dimnames(bb)[[2]]))), ncol=2)] <- dfr[["var.1"]]
>
>
>>
>> Thanks for your help,
>> Daisy
>>
>> __
>> 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.
>
> David Winsemius, MD
> West Hartford, CT
>
>



--
Daisy Englert Duursma
Department of Biological Sciences
Room E8C156
Macquarie University, North Ryde, NSW 2109
Australia

Tel +61 2 9850 9256

__
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] Querying the path separator?

2011-06-28 Thread Henrik Bengtsson
See file.path().

/Henrik

On Tue, Jun 28, 2011 at 6:59 PM, Jonathan Greenberg
 wrote:
> Hopefully this is a pretty easy fix -- I need to have R query the path
> separator for some code I'm trying to write (it involves using a
> system() call) -- the call requires a path and a wildcard, e.g.:
>
> command="mycommand /path/to/*.files" in the case of unix or,
> command="mycommand.exe C:\\path\\to\\*.files" on a windows box
>
> System.which is working correctly, so the "mycommand" vs
> "mycommand.exe" part is working fine.  The issue is that the /path/to
> should be set to getwd(), but this strips the trailing path separator.
>  How do I go about querying the correct path separator for the system,
> so I can include it in a paste command (via sep=)?  Thanks!
>
> --j
>
> --
> Jonathan A. Greenberg, PhD
> Assistant Project Scientist
> Center for Spatial Technologies and Remote Sensing (CSTARS)
> Department of Land, Air and Water Resources
> University of California, Davis
> One Shields Avenue
> Davis, CA 95616
> Phone: 415-763-5476
> AIM: jgrn307, MSN: jgrn...@hotmail.com, Gchat: jgrn307
>
> __
> 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] Querying the path separator?

2011-06-28 Thread Jonathan Greenberg
Hopefully this is a pretty easy fix -- I need to have R query the path
separator for some code I'm trying to write (it involves using a
system() call) -- the call requires a path and a wildcard, e.g.:

command="mycommand /path/to/*.files" in the case of unix or,
command="mycommand.exe C:\\path\\to\\*.files" on a windows box

System.which is working correctly, so the "mycommand" vs
"mycommand.exe" part is working fine.  The issue is that the /path/to
should be set to getwd(), but this strips the trailing path separator.
 How do I go about querying the correct path separator for the system,
so I can include it in a paste command (via sep=)?  Thanks!

--j

-- 
Jonathan A. Greenberg, PhD
Assistant Project Scientist
Center for Spatial Technologies and Remote Sensing (CSTARS)
Department of Land, Air and Water Resources
University of California, Davis
One Shields Avenue
Davis, CA 95616
Phone: 415-763-5476
AIM: jgrn307, MSN: jgrn...@hotmail.com, Gchat: jgrn307

__
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] Indexing to insert values from a dataframe into a matrix

2011-06-28 Thread Jeff Newmiller
A) Relying on floating point numbers for predictable indexing is a recipe for 
failure. Convert your floating point numbers to integers before using them to 
index.

B) Row and column labels are strings, and you are giving numerics to the 
brackets. You would need to use as.character() on ddr$x and ddr$y in order to 
utilize labels for indexing.
---
Jeff Newmiller The . . Go Live...
DCN: Basics: ##.#. ##.#. Live Go...
Live: OO#.. Dead: OO#.. Playing
Research Engineer (Solar/Batteries O.O#. #.O#. with
/Software/Embedded Controllers) .OO#. .OO#. rocks...1k
--- 
Sent from my phone. Please excuse my brevity.

Daisy Englert Duursma  wrote:

Hello,

I think this is a simple problem but I am not coming up with a simple
solution. I think it just an indexing problem.

I can easily replace values in a matrix from a dataframe when the
dataframe has row and column numbers. In the example below I use row
and column names and  I can not get it to work

#make a matrix where rows and columns are the lat and long for a
bounding box of Australia and all elements have the value of -9990

bb<-matrix(c(rep(-,691*886)),nrow=691
,ncol=886,dimnames=list(seq(-10,-44.50,by=-0.05),seq(112,156.25,by=0.05)))

#dfr with row names and col names and values to be replaced in the matrix

dfr <- data.frame(cbind(x=seq(120,125,by=0.05), y=-25, var.1=1))

#insert the values from the dfr into the matrix
bb[dfr$x,dfr$y]<-d$var.1

Thanks for your help,
Daisy



-- 
Daisy Englert Duursma
Department of Biological Sciences
Room E8C156
Macquarie University, North Ryde, NSW 2109
Australia

Tel +61 2 9850 9256

_

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] Indexing to Insert values from a dataframe into a matrix

2011-06-28 Thread David Winsemius


On Jun 28, 2011, at 9:18 PM, Daisy Englert Duursma wrote:


Hello,

I think this is a simple problem but I am not coming up with a simple
solution. I think it just an indexing problem.

I can easily replace values in a matrix from a dataframe when the
dataframe has row and column numbers. In the example below I use row
and column names and  I can not get it to work

#make a matrix where rows and columns are the lat and long for a
bounding box of Australia and all elements have the value of -9990

bb<-matrix(c(rep(-,691*886)),nrow=691
,ncol
=886,dimnames=list(seq(-10,-44.50,by=-0.05),seq(112,156.25,by=0.05)))

#dfr with row names and col names and values to be replaced in the  
matrix


dfr <- data.frame(cbind(x=seq(120,125,by=0.05), y=-25, var.1=1))

#insert the values from the dfr into the matrix
bb[dfr$x,dfr$y]<-d$var.1


Indexing with a two column matrix is possible, but those vectors are  
not legitimate indices even if you bundle them into a two column  
matrix. (dfr$y's are all -25, so at least the error report is  
informative).


These will return indices:
sapply(as.character(dfr$y), function(x) which(x== dimnames(bb)[[1]]))
sapply(as.character(dfr$x), function(x) which(x== dimnames(bb)[[2]]))

So try:
> #insert the values from the dfr into the matrix
> bb[matrix(c(sapply(as.character(dfr$y), function(x) which(x==  
dimnames(bb)[[1]])),  sapply(as.character(dfr$x), function(x)  
which(x== dimnames(bb)[[2]]))), ncol=2)] <- dfr[["var.1"]]





Thanks for your help,
Daisy

__
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.


David Winsemius, MD
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.


[R] Indexing to insert values from a dataframe into a matrix

2011-06-28 Thread Daisy Englert Duursma
Hello,

I think this is a simple problem but I am not coming up with a simple
solution. I think it just an indexing problem.

I can easily replace values in a matrix from a dataframe when the
dataframe has row and column numbers. In the example below I use row
and column names and  I can not get it to work

#make a matrix where rows and columns are the lat and long for a
bounding box of Australia and all elements have the value of -9990

bb<-matrix(c(rep(-,691*886)),nrow=691
,ncol=886,dimnames=list(seq(-10,-44.50,by=-0.05),seq(112,156.25,by=0.05)))

#dfr with row names and col names and values to be replaced in the matrix

dfr <- data.frame(cbind(x=seq(120,125,by=0.05), y=-25, var.1=1))

#insert the values from the dfr into the matrix
bb[dfr$x,dfr$y]<-d$var.1

Thanks for your help,
Daisy



-- 
Daisy Englert Duursma
Department of Biological Sciences
Room E8C156
Macquarie University, North Ryde, NSW 2109
Australia

Tel +61 2 9850 9256

__
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] Indexing to Insert values from a dataframe into a matrix

2011-06-28 Thread Daisy Englert Duursma
Hello,

I think this is a simple problem but I am not coming up with a simple
solution. I think it just an indexing problem.

I can easily replace values in a matrix from a dataframe when the
dataframe has row and column numbers. In the example below I use row
and column names and  I can not get it to work

#make a matrix where rows and columns are the lat and long for a
bounding box of Australia and all elements have the value of -9990

bb<-matrix(c(rep(-,691*886)),nrow=691
,ncol=886,dimnames=list(seq(-10,-44.50,by=-0.05),seq(112,156.25,by=0.05)))

#dfr with row names and col names and values to be replaced in the matrix

dfr <- data.frame(cbind(x=seq(120,125,by=0.05), y=-25, var.1=1))

#insert the values from the dfr into the matrix
bb[dfr$x,dfr$y]<-d$var.1

Thanks for your help,
Daisy

__
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] Extract elements from objects in a list

2011-06-28 Thread Jeremy Miles
Excellent, thanks.

On 28 June 2011 16:36, jim holtman  wrote:
> forgot to sent the sapply solution:
>
>> sapply(x, '[', 3)
> Median Median Median Median Median Median Median Median Median Median
> Median Median Median Median Median Median
> 0.4769 0.4880 0.4916 0.4021 0.4474 0.4449 0.5169 0.5067 0.5189 0.4088
> 0.4887 0.5392 0.4964 0.4141 0.5155 0.4461
> Median Median Median Median Median Median Median Median Median Median
> Median Median Median Median Median Median
> 0.4918 0.4910 0.5432 0.4784 0.5482 0.6263 0.5420 0.4933 0.5534 0.5066
> 0.5900 0.4553 0.4859 0.5721 0.5442 0.5105
> Median Median Median Median Median Median Median Median Median Median
> Median Median Median Median Median Median
> 0.4580 0.5268 0.4833 0.5178 0.5210 0.5808 0.4720 0.5457 0.5910 0.5796
> 0.5329 0.5178 0.4674 0.4280 0.4061 0.5665
> Median Median Median Median Median Median Median Median Median Median
> Median Median Median Median Median Median
> 0.4963 0.5013 0.4791 0.5329 0.4770 0.5926 0.4709 0.6042 0.5020 0.4788
> 0.5261 0.5010 0.4394 0.5339 0.5655 0.5200
> Median Median Median Median Median Median Median Median Median Median
> Median Median Median Median Median Median
> 0.5586 0.5362 0.5719 0.4851 0.4831 0.5458 0.5331 0.5611 0.4336 0.4727
> 0.5497 0.4768 0.5305 0.5261 0.5667 0.5107
> Median Median Median Median Median Median Median Median Median Median
> Median Median Median Median Median Median
> 0.5209 0.5635 0.4789 0.5428 0.5372 0.5403 0.5086 0.5470 0.4219 0.4758
> 0.4824 0.5165 0.5035 0.4833 0.4754 0.5227
> Median Median Median Median
> 0.6169 0.4904 0.4773 0.4779
>
> On Tue, Jun 28, 2011 at 7:22 PM, Jeremy Miles  wrote:
>> Hi All,
>>
>> I want to extract elements of elements in a list.
>>
>> Here's an example of what I mean:
>>
>> If I create a list:
>>
>> x <- as.list(100)
>> for(loop in c(1:100)) {
>>        x[[loop]] <- summary(runif(100))
>>        }
>>
>>
>>> head(x)
>> [[1]]
>>   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.
>> 0.02271 0.25260 0.58130 0.52120 0.77270 0.99670
>>
>> [[2]]
>>    Min.  1st Qu.   Median     Mean  3rd Qu.     Max.
>> 0.006796 0.259700 0.528100 0.515500 0.781900 0.993100
>>
>> [[3]]
>>   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.
>> 0.00927 0.22800 0.40780 0.46410 0.69460 0.98780
>>
>> I want to extract (say) the medians as a vector.  This would be:
>> x[[1]][[3]]
>> x[[2]][[3]]
>> x[[3]][[3]]
>>
>> I thought there would be a way of doing this with something like
>> apply(), but I cannot work it out.  Is there a way of doing this
>> without a loop?  Thanks,
>>
>> Jeremy
>>
>> __
>> 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.
>>
>
>
>
> --
> Jim Holtman
> Data Munger Guru
>
> What is the problem that you are trying to solve?
>

__
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] Error: cannot allocate vector of size

2011-06-28 Thread jim holtman
Assuming that your column are numeric, you would need 4GB of memory
just to store one copy of the object.  If this is 5 years, then you
would need almost 1GB for a copy, but the processing probably will use
up twice as much as it is processing.  Try reading a month's worth and
see how much you use.  In problems like this, you creep up on it; you
just try to jump in all at once.  Do it in increments and watch the
usage.

On Tue, Jun 28, 2011 at 4:18 PM, xin123620  wrote:
> Thank you Jholtman.
> Now count is 46001902. I was trying to retrieve one-year data, but I still
> receive the following message:
> "Error: cannot allocate vector of size 64.0 Mb"
>
> --
> View this message in context: 
> http://r.789695.n4.nabble.com/Error-cannot-allocate-vector-of-size-tp3629384p3631354.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.
>



-- 
Jim Holtman
Data Munger Guru

What is the problem that you are trying to solve?

__
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] Extract elements from objects in a list

2011-06-28 Thread jim holtman
forgot to sent the sapply solution:

> sapply(x, '[', 3)
Median Median Median Median Median Median Median Median Median Median
Median Median Median Median Median Median
0.4769 0.4880 0.4916 0.4021 0.4474 0.4449 0.5169 0.5067 0.5189 0.4088
0.4887 0.5392 0.4964 0.4141 0.5155 0.4461
Median Median Median Median Median Median Median Median Median Median
Median Median Median Median Median Median
0.4918 0.4910 0.5432 0.4784 0.5482 0.6263 0.5420 0.4933 0.5534 0.5066
0.5900 0.4553 0.4859 0.5721 0.5442 0.5105
Median Median Median Median Median Median Median Median Median Median
Median Median Median Median Median Median
0.4580 0.5268 0.4833 0.5178 0.5210 0.5808 0.4720 0.5457 0.5910 0.5796
0.5329 0.5178 0.4674 0.4280 0.4061 0.5665
Median Median Median Median Median Median Median Median Median Median
Median Median Median Median Median Median
0.4963 0.5013 0.4791 0.5329 0.4770 0.5926 0.4709 0.6042 0.5020 0.4788
0.5261 0.5010 0.4394 0.5339 0.5655 0.5200
Median Median Median Median Median Median Median Median Median Median
Median Median Median Median Median Median
0.5586 0.5362 0.5719 0.4851 0.4831 0.5458 0.5331 0.5611 0.4336 0.4727
0.5497 0.4768 0.5305 0.5261 0.5667 0.5107
Median Median Median Median Median Median Median Median Median Median
Median Median Median Median Median Median
0.5209 0.5635 0.4789 0.5428 0.5372 0.5403 0.5086 0.5470 0.4219 0.4758
0.4824 0.5165 0.5035 0.4833 0.4754 0.5227
Median Median Median Median
0.6169 0.4904 0.4773 0.4779

On Tue, Jun 28, 2011 at 7:22 PM, Jeremy Miles  wrote:
> Hi All,
>
> I want to extract elements of elements in a list.
>
> Here's an example of what I mean:
>
> If I create a list:
>
> x <- as.list(100)
> for(loop in c(1:100)) {
>        x[[loop]] <- summary(runif(100))
>        }
>
>
>> head(x)
> [[1]]
>   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.
> 0.02271 0.25260 0.58130 0.52120 0.77270 0.99670
>
> [[2]]
>    Min.  1st Qu.   Median     Mean  3rd Qu.     Max.
> 0.006796 0.259700 0.528100 0.515500 0.781900 0.993100
>
> [[3]]
>   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.
> 0.00927 0.22800 0.40780 0.46410 0.69460 0.98780
>
> I want to extract (say) the medians as a vector.  This would be:
> x[[1]][[3]]
> x[[2]][[3]]
> x[[3]][[3]]
>
> I thought there would be a way of doing this with something like
> apply(), but I cannot work it out.  Is there a way of doing this
> without a loop?  Thanks,
>
> Jeremy
>
> __
> 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.
>



-- 
Jim Holtman
Data Munger Guru

What is the problem that you are trying to solve?

__
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] Extract elements from objects in a list

2011-06-28 Thread jim holtman
single brackets:

> x <- as.list(100)
> for(loop in c(1:100)) {
+ x[[loop]] <- summary(runif(100))
+ }
> x[[1]][1]
Min.
0.007595
> x[[1]][3]
Median
0.4769
>


On Tue, Jun 28, 2011 at 7:22 PM, Jeremy Miles  wrote:
> Hi All,
>
> I want to extract elements of elements in a list.
>
> Here's an example of what I mean:
>
> If I create a list:
>
> x <- as.list(100)
> for(loop in c(1:100)) {
>        x[[loop]] <- summary(runif(100))
>        }
>
>
>> head(x)
> [[1]]
>   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.
> 0.02271 0.25260 0.58130 0.52120 0.77270 0.99670
>
> [[2]]
>    Min.  1st Qu.   Median     Mean  3rd Qu.     Max.
> 0.006796 0.259700 0.528100 0.515500 0.781900 0.993100
>
> [[3]]
>   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.
> 0.00927 0.22800 0.40780 0.46410 0.69460 0.98780
>
> I want to extract (say) the medians as a vector.  This would be:
> x[[1]][[3]]
> x[[2]][[3]]
> x[[3]][[3]]
>
> I thought there would be a way of doing this with something like
> apply(), but I cannot work it out.  Is there a way of doing this
> without a loop?  Thanks,
>
> Jeremy
>
> __
> 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.
>



-- 
Jim Holtman
Data Munger Guru

What is the problem that you are trying to solve?

__
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] Extract elements from objects in a list

2011-06-28 Thread Bill.Venables
> x <- lapply(1:100, function(x) summary(runif(100)))

> head(x, 4)
[[1]]
   Min. 1st Qu.  MedianMean 3rd Qu.Max. 
0.02922 0.38330 0.58120 0.58230 0.83430 0.99870 

[[2]]
Min.  1st Qu.   Median Mean  3rd Qu. Max. 
0.004903 0.281400 0.478900 0.497100 0.729900 0.990700 

[[3]]
Min.  1st Qu.   Median Mean  3rd Qu. Max. 
0.002561 0.283100 0.567400 0.516500 0.736800 0.986700 

[[4]]
Min.  1st Qu.   Median Mean  3rd Qu. Max. 
0.004827 0.264000 0.499500 0.503200 0.732300 0.998500 

> sapply(x, "[", 3)[1:4]
Median Median Median Median 
0.5812 0.4789 0.5674 0.4995 
>  

-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On 
Behalf Of Jeremy Miles
Sent: Wednesday, 29 June 2011 9:23 AM
To: r-help
Subject: [R] Extract elements from objects in a list

Hi All,

I want to extract elements of elements in a list.

Here's an example of what I mean:

If I create a list:

x <- as.list(100)
for(loop in c(1:100)) {
x[[loop]] <- summary(runif(100))
}


> head(x)
[[1]]
   Min. 1st Qu.  MedianMean 3rd Qu.Max.
0.02271 0.25260 0.58130 0.52120 0.77270 0.99670

[[2]]
Min.  1st Qu.   Median Mean  3rd Qu. Max.
0.006796 0.259700 0.528100 0.515500 0.781900 0.993100

[[3]]
   Min. 1st Qu.  MedianMean 3rd Qu.Max.
0.00927 0.22800 0.40780 0.46410 0.69460 0.98780

I want to extract (say) the medians as a vector.  This would be:
x[[1]][[3]]
x[[2]][[3]]
x[[3]][[3]]

I thought there would be a way of doing this with something like
apply(), but I cannot work it out.  Is there a way of doing this
without a loop?  Thanks,

Jeremy

__
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] Extract elements from objects in a list

2011-06-28 Thread Jeremy Miles
Hi All,

I want to extract elements of elements in a list.

Here's an example of what I mean:

If I create a list:

x <- as.list(100)
for(loop in c(1:100)) {
x[[loop]] <- summary(runif(100))
}


> head(x)
[[1]]
   Min. 1st Qu.  MedianMean 3rd Qu.Max.
0.02271 0.25260 0.58130 0.52120 0.77270 0.99670

[[2]]
Min.  1st Qu.   Median Mean  3rd Qu. Max.
0.006796 0.259700 0.528100 0.515500 0.781900 0.993100

[[3]]
   Min. 1st Qu.  MedianMean 3rd Qu.Max.
0.00927 0.22800 0.40780 0.46410 0.69460 0.98780

I want to extract (say) the medians as a vector.  This would be:
x[[1]][[3]]
x[[2]][[3]]
x[[3]][[3]]

I thought there would be a way of doing this with something like
apply(), but I cannot work it out.  Is there a way of doing this
without a loop?  Thanks,

Jeremy

__
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] Running R from windows command prompt

2011-06-28 Thread Michael Sumner
On Wed, Jun 29, 2011 at 1:51 AM, Robert Baer  wrote:
> Subject: Re: [R] Running R from windows command prompt
>

> ---
> Actually, you can 'cut and paste' from at Windows Cmd prompt.  It is done by
> clicking the
> C: icon in the upper left of the command window, choosing edit, and 'copy'
> or 'paste'
> as desired.
>

Or shortcut to the Edit menu by right-click in the window.

It is copying out that is weirdest, and worth knowing I think:
Edit/Mark, then select the text and press Enter to copy it to the
clipboard.

Cheers, Mike.

> Rob
>
> HTH
> _
>
> Arun Kumar Saha, FRM
> QUANTITATIVE RISK AND HEDGE CONSULTING SPECIALIST
> Visit me at: http://in.linkedin.com/in/ArunFRM
>
> __
> 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.
>



-- 
Michael Sumner
Institute for Marine and Antarctic Studies, University of Tasmania
Hobart, Australia
e-mail: mdsum...@gmail.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] plotting survival curves with model parameters

2011-06-28 Thread David Winsemius


On Jun 28, 2011, at 6:26 PM, David Winsemius wrote:



On Jun 28, 2011, at 5:46 PM, Trey Batey wrote:


Hello.

I am trying to write an R function to plot the survival function (and
associated hazard and density) for a Siler competing hazards model.
This model is similar to the Gompertz-Makeham, with the addition of a
juvenile component that includes two parameters---one that describes
the initial infant mortality rate, and a negative exponential that
describes typical mortality decline over the juvenile period.  The
entire hazard is expressed as


h(x) = a1*exp(-b1*x)+a2+a3*exp(b3*x)


I've had success in plotting the curves using the following function:



I modified your function to have named parameters:



siler<-function(a1=0.1, b1=0.5,a2=0.001,a3=0.003,b3=0.05)  # model  
Siler parameters

{
  sil=function(t)
{   h.t<-a1*exp(-b1*t)+a2+a3*exp(b3*t)
  S.t<-exp(-a1/b1*(1-exp(-b1*t))-a2*t+a3/b3*(1-exp(b3*t)))
  d.t<-S.t*h.t

  #return(d.t)
  return(S.t)# returns the survival function
  #return(h.t)
}

  t=seq(0,100,0.01)
  plot(t,sil(t),ylim=c(0,1),type='l',main="Siler model of mortality:
Wood et al. (2002, Figure
7.4)",cex.main=0.9,cex.lab=0.8,cex.axis=0.75,ylab='S(t)',xlab='Age
(years)')# reproduces Figure 7.4 from Wood et al. (2002)

}

siler()
#

How can I modify the function so that I can plot curves using
published Siler parameters I have already compiled into a dataframe
(below)?

names<-c("Hadza","Ache")
a1<-c(0.351,0.157)
b1<-c(0.895,0.721)
a2<-c(0.011,0.013)
a3<-c(0.067,0.48)
b3<-c(0.125,0.103)



cbind outputs a matrix and the presence of character values means  
all your numbers are now character bad programming practice. Fix  
is here:


> sil.anthro[, 2:6] <- sapply(sil.anthro[, 2:6], function(x)  
as.numeric(as.character(x)) )

> str(sil.anthro)
'data.frame':   2 obs. of  6 variables:
$ names: Factor w/ 2 levels "Ache","Hadza": 2 1
$ a1   : num  0.351 0.157
$ b1   : num  0.895 0.721
$ a2   : num  0.011 0.013
$ a3   : num  6.7e-06 4.8e-05
$ b3   : num  0.125 0.103

> with( sil.anthro[1, -1], siler(a1=a1,b1=b1,a2=a2,a3=a3,b3=b3) )
> with( sil.anthro[2, -1], siler(a1=a1,b1=b1,a2=a2,a3=a3,b3=b3) )

Seems to work.

--
David.



For example, how can I modify the function above to produce a curve
for the a specific group (e.g., Hadza, Ache...) or multiple groups on
one graph?  Thanks.


Could use names as index
with( sil.anthro[sil.anthro$names=="Hadza", ],
   siler(a1=a1,b1=b1,a2=a2,a3=a3,b3=b3) )


And maybe even clearer would be:
> row.names(sil.anthro) <- sil.anthro$names
> with( sil.anthro["Hadza", ], siler(a1=a1,b1=b1,a2=a2,a3=a3,b3=b3) )

You probably should have done that originally as:

sil.anthro<-data.frame(a1=a1,b1=b1,a2=a2,a3=a3,b3=b3)
row.names(sil.anthro) <- names

(But even better woulbe to choose a 'name' other than 'names'.)




--
David Winsemius, MD
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.


David Winsemius, MD
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] plotting survival curves with model parameters

2011-06-28 Thread David Winsemius


On Jun 28, 2011, at 5:46 PM, Trey Batey wrote:


Hello.

I am trying to write an R function to plot the survival function (and
associated hazard and density) for a Siler competing hazards model.
This model is similar to the Gompertz-Makeham, with the addition of a
juvenile component that includes two parameters---one that describes
the initial infant mortality rate, and a negative exponential that
describes typical mortality decline over the juvenile period.  The
entire hazard is expressed as


h(x) = a1*exp(-b1*x)+a2+a3*exp(b3*x)


I've had success in plotting the curves using the following function:



I modified your function to have named parameters:



siler<-function(a1=0.1, b1=0.5,a2=0.001,a3=0.003,b3=0.05)  # model  
Siler parameters

 {
   sil=function(t)
 {   h.t<-a1*exp(-b1*t)+a2+a3*exp(b3*t)
   S.t<-exp(-a1/b1*(1-exp(-b1*t))-a2*t+a3/b3*(1-exp(b3*t)))
   d.t<-S.t*h.t

   #return(d.t)
   return(S.t)# returns the survival function
   #return(h.t)
 }

   t=seq(0,100,0.01)
   plot(t,sil(t),ylim=c(0,1),type='l',main="Siler model of mortality:
Wood et al. (2002, Figure
7.4)",cex.main=0.9,cex.lab=0.8,cex.axis=0.75,ylab='S(t)',xlab='Age
(years)')# reproduces Figure 7.4 from Wood et al. (2002)

 }

siler()
#

How can I modify the function so that I can plot curves using
published Siler parameters I have already compiled into a dataframe
(below)?

names<-c("Hadza","Ache")
a1<-c(0.351,0.157)
b1<-c(0.895,0.721)
a2<-c(0.011,0.013)
a3<-c(0.067,0.48)
b3<-c(0.125,0.103)
sil.anthro<-data.frame(cbind(names,a1,b1,a2,a3,b3))


cbind outputs a matrix and the presence of character values means all  
your numbers are now character bad programming practice. Fix is  
here:


> sil.anthro[, 2:6] <- sapply(sil.anthro[, 2:6], function(x)  
as.numeric(as.character(x)) )

> str(sil.anthro)
'data.frame':   2 obs. of  6 variables:
 $ names: Factor w/ 2 levels "Ache","Hadza": 2 1
 $ a1   : num  0.351 0.157
 $ b1   : num  0.895 0.721
 $ a2   : num  0.011 0.013
 $ a3   : num  6.7e-06 4.8e-05
 $ b3   : num  0.125 0.103

> with( sil.anthro[1, -1], siler(a1=a1,b1=b1,a2=a2,a3=a3,b3=b3) )
> with( sil.anthro[2, -1], siler(a1=a1,b1=b1,a2=a2,a3=a3,b3=b3) )

Seems to work.

--
David.



For example, how can I modify the function above to produce a curve
for the a specific group (e.g., Hadza, Ache...) or multiple groups on
one graph?  Thanks.


Could use names as index
with( sil.anthro[sil.anthro$names=="Hadza", ],
siler(a1=a1,b1=b1,a2=a2,a3=a3,b3=b3) )

--
David Winsemius, MD
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.


[R] plotting survival curves with model parameters

2011-06-28 Thread Trey Batey
Hello.

I am trying to write an R function to plot the survival function (and
associated hazard and density) for a Siler competing hazards model.
This model is similar to the Gompertz-Makeham, with the addition of a
juvenile component that includes two parameters---one that describes
the initial infant mortality rate, and a negative exponential that
describes typical mortality decline over the juvenile period.  The
entire hazard is expressed as


h(x) = a1*exp(-b1*x)+a2+a3*exp(b3*x)


I've had success in plotting the curves using the following function:


siler<-function(x=c(0.1,0.5,0.001,0.003,0.05))   # model Siler parameters
  {
sil=function(t)
  {
a1 = x[1]
b1 = x[2]
a2 = x[3]
a3 = x[4]
b3 = x[5]

h.t<-a1*exp(-b1*t)+a2+a3*exp(b3*t)
S.t<-exp(-a1/b1*(1-exp(-b1*t))-a2*t+a3/b3*(1-exp(b3*t)))
d.t<-S.t*h.t

#return(d.t)
return(S.t)# returns the survival function
#return(h.t)
  }

t=seq(0,100,0.01)
plot(t,sil(t),ylim=c(0,1),type='l',main="Siler model of mortality:
 Wood et al. (2002, Figure
7.4)",cex.main=0.9,cex.lab=0.8,cex.axis=0.75,ylab='S(t)',xlab='Age
(years)')# reproduces Figure 7.4 from Wood et al. (2002)

  }

siler()
#

How can I modify the function so that I can plot curves using
published Siler parameters I have already compiled into a dataframe
(below)?

names<-c("Hadza","Ache")
a1<-c(0.351,0.157)
b1<-c(0.895,0.721)
a2<-c(0.011,0.013)
a3<-c(0.067,0.48)
b3<-c(0.125,0.103)
sil.anthro<-data.frame(cbind(names,a1,b1,a2,a3,b3))

For example, how can I modify the function above to produce a curve
for the a specific group (e.g., Hadza, Ache...) or multiple groups on
one graph?  Thanks.

--Trey

__
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 Weighted Least Square Model for a Binary Outcome

2011-06-28 Thread Vivian Zhuang
Dear R Users,

I am new to the mailing list. I posted this message about two hours
ago but did not receive it through the list, so I am posting it again.
Sorry for duplicates.

I would like to use R to fit a Weighted Least Square model for a
binary outcome, say Y.  The model is the one widely used for a binary
dependent variable when the logistic model has not been proposed.

Does anyone know how to specify the weight as the square root of
1/(E(Y)(1-E(Y)) in lm() or any other regression functions?

I know that varPower() in the package of gls() can provide an optimal
alpha estimator for a weight with the form of $E(Y)^{-2\alpha}$, which
does not include the weight form I need. Please correct me if I am
wrong.

Thanks for any replies in advance!

Best Regards,
Vivian

__
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] connecting R and PostgreSQL

2011-06-28 Thread Steven Kennedy
I use RODBC and have got it to work fine on Windows, Linux and Mac.

There's some basic info here, and plenty of blog posts out there with
step by step instructions for the different OS's.

http://hosho.ees.hokudai.ac.jp/~kubo/Rdoc/library/RODBC/html/00Index.html



On Tue, Jun 28, 2011 at 11:53 PM, Gabor Grothendieck
 wrote:
> On Tue, Jun 28, 2011 at 8:15 AM,   wrote:
>> Dear R-helpers,
>>
>> I'm an absolute beginner using both R and PostgreSQL, but now I have to work 
>> with both programs. I need to connect R and my Postgres-database, but every 
>> attempt so far has failed (I tried using the RpgSQL package as well as 
>> RdbiPgSQL, the first, following this manual 
>> (http://code.google.com/p/rpostgresql/) didn't find any drivers for the 
>> database (step no. 1) whereas the second doesn't work with R version 2.13).
>>
>> Could someone please be so kind to either provide a step-by-step instruction 
>> on how to make this connection work or direct me to a manual?
>>
>
> For RpgSQL there is installation info if you click on the Installation
> link here:
>
> http://cran.r-project.org/web/packages/RpgSQL/index.html
>
> and the same info is in the INSTALL file in the package.
>
> --
> Statistics & Software Consulting
> GKX Group, GKX Associates Inc.
> tel: 1-877-GKX-GROUP
> email: ggrothendieck at gmail.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] Question about error message

2011-06-28 Thread Duncan Murdoch

On 11-06-28 4:22 PM, David Kaplan wrote:

Greetings,

I'm getting this error message using Joe Shafer's "NORM" package.

Error in storage.mode(x)<- "double" :
(list) object cannot be coerced to type 'double'

I'm not sure what this means.


It means just what it says, but fixing it is another issue.  I'd write 
to the maintainer first, with a simple reproducible example.


You can find the maintainer using

help(package="NORM")

(or the eventually obsolete library(help=NORM) ).

Duncan Murdoch





I get this message when running

   s<- prelim.norm(filename)

prelim.norm is used to develop some summary statistics, etc. before
implementing the EM algorithm for missing data.  Please note that this
is a data fusion exercise and there is considerable amounts of missing
data by design.

Thanks in advance,

David



__
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] Separator of data

2011-06-28 Thread Trying To learn again
MAny Thanks¡¡¡

2011/6/28 jim holtman 

> try this:
>
> > x <- read.fwf(textConnection("188556644
> + 225588666
> + 55555"), width = rep(1,9))
> >
> > x
>  V1 V2 V3 V4 V5 V6 V7 V8 V9
> 1  1  8  8  5  5  6  6  4  4
> 2  2  2  5  5  8  8  6  6  6
> 3  5  5  8  8  8  8  5  5  5
> >
>
>
>  On Tue, Jun 28, 2011 at 3:47 PM, Trying To learn again
>  wrote:
> >  Hi all,
> >
> > I have a matrix like this:
> >
> > 188556644
> > 225588666
> > 55555
> >
> > I try to read the table using read table but if I put sep="" I have seen
> it
> > expects a white space, is there a "sep" option to  read this matrix so
> > each single number is a position of the matrix
> >
> > You see this matrix would be an 3x9 matrix
> >
> > I tried other option but also didn´t worked.
> >
> >  If sep = "" (the default for read.table) the separator is ‘white space’,
> > that is one or more spaces, tabs, newlines or carriage returns.
> >
>  >[[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.
> >
> >
>
>
>
> --
> Jim Holtman
> Data Munger Guru
>
> What is the problem that you are trying to solve?
>

[[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] Error: cannot allocate vector of size

2011-06-28 Thread xin123620
Thank you Jholtman. 
Now count is 46001902. I was trying to retrieve one-year data, but I still
receive the following message:
"Error: cannot allocate vector of size 64.0 Mb"

--
View this message in context: 
http://r.789695.n4.nabble.com/Error-cannot-allocate-vector-of-size-tp3629384p3631354.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] create a factor variable from two numeric variables when order is irrelevant

2011-06-28 Thread David Winsemius


On Jun 28, 2011, at 4:53 PM, David Winsemius wrote:



On Jun 28, 2011, at 3:59 PM, Daniel Malter wrote:


Hi all,

I have two numeric variables that form combinations in a matched  
sample.
Let's say I have five levels of x and y. What I am seeking to  
create is a
factor variable that ignores the order of x and y, i.e., the factor  
should
indicate x=1, y=5, as the same factor as x=5, y=1. Obviously, this  
becomes
increasingly cumbersome to do by hand as the number of levels  
increases.


f<-1:5
x<-sample(f,100,replace=T)
y<-sample(f,100,replace=T)
d<-matrix(cbind(x,y),ncol=2)

#A working solution is to remove the order, multiply one column by  
a scaling
constant, add the second column, and create the factor for this  
numeric
value. However, I was wondering whether there is less awkward, more  
direct

way to do this.

i<-apply(t(apply(d,1,function(x) sort(x))),1,function(y)  
10*y[1]+y[2])

i<-factor(i)
i


I came up with the same solution, but implemented it a bit  
differently:


> d <- pmin(x,y)+5*pmax(x,y)

> sort(unique(d))
[1] 11 21 22 31 32 33 41 42 43 44 51 52 53 54 55

> d <- factor(pmin(x,y)+10*pmax(x,y))
> unique(d)
[1] 41 42 32 54 51 21 22 33 53 11 31 44 43 52 55
Levels: 11 21 22 31 32 33 41 42 43 44 51 52 53 54 55


If you wanted a less decimalized version you can paste:

d <- factor(paste(pmax(x,y),pmin(x,y),sep="."))
> unique(d)
 [1] 4.1 4.2 3.2 5.4 5.1 2.1 2.2 3.3 5.3 1.1 3.1 4.4 4.3 5.2 5.5
Levels: 1.1 2.1 2.2 3.1 3.2 3.3 4.1 4.2 4.3 4.4 5.1 5.2 5.3 5.4 5.5
> d[1]
[1] 4.1
Levels: 1.1 2.1 2.2 3.1 3.2 3.3 4.1 4.2 4.3 4.4 5.1 5.2 5.3 5.4 5.5




Seems that you might find the the BioC people doing something  
isomorphic to this with gene allele pairs using their fancy S4  
methods.


--



David Winsemius, MD
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] create a factor variable from two numeric variables when order is irrelevant

2011-06-28 Thread David Winsemius


On Jun 28, 2011, at 3:59 PM, Daniel Malter wrote:


Hi all,

I have two numeric variables that form combinations in a matched  
sample.
Let's say I have five levels of x and y. What I am seeking to create  
is a
factor variable that ignores the order of x and y, i.e., the factor  
should
indicate x=1, y=5, as the same factor as x=5, y=1. Obviously, this  
becomes
increasingly cumbersome to do by hand as the number of levels  
increases.


f<-1:5
x<-sample(f,100,replace=T)
y<-sample(f,100,replace=T)
d<-matrix(cbind(x,y),ncol=2)

#A working solution is to remove the order, multiply one column by a  
scaling
constant, add the second column, and create the factor for this  
numeric
value. However, I was wondering whether there is less awkward, more  
direct

way to do this.

i<-apply(t(apply(d,1,function(x) sort(x))),1,function(y) 10*y[1]+y[2])
i<-factor(i)
i


I came up with the same solution, but implemented it a bit differently:

> d <- pmin(x,y)+5*pmax(x,y)

> sort(unique(d))
 [1] 11 21 22 31 32 33 41 42 43 44 51 52 53 54 55

> d <- factor(pmin(x,y)+10*pmax(x,y))
> unique(d)
 [1] 41 42 32 54 51 21 22 33 53 11 31 44 43 52 55
Levels: 11 21 22 31 32 33 41 42 43 44 51 52 53 54 55


Seems that you might find the the BioC people doing something  
isomorphic to this with gene allele pairs using their fancy S4 methods.


--
David Winsemius, MD
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.


[R] Question about error message

2011-06-28 Thread David Kaplan
Greetings,

I'm getting this error message using Joe Shafer's "NORM" package.

Error in storage.mode(x) <- "double" :
   (list) object cannot be coerced to type 'double'

I'm not sure what this means.


I get this message when running

  s <- prelim.norm(filename)

prelim.norm is used to develop some summary statistics, etc. before 
implementing the EM algorithm for missing data.  Please note that this 
is a data fusion exercise and there is considerable amounts of missing 
data by design.

Thanks in advance,

David

-- 

===
David Kaplan, Ph.D.
Professor
Department of Educational Psychology
University of Wisconsin - Madison
Educational Sciences, Room, 1082B
1025 W. Johnson Street
Madison, WI 53706

email: dkap...@education.wisc.edu
homepage:
http://www.education.wisc.edu/edpsych/default.aspx?content=kaplan.html
Phone: 608-262-0836
===




[[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] Error: cannot allocate vector of size

2011-06-28 Thread jim holtman
select count(*) from yourData

On Tue, Jun 28, 2011 at 3:07 PM, xin123620  wrote:
> Thank you Jeff. You are absolutely right. I just edited the R and computer
> info in: R is 32 bit; computer is his computer is Windows XP, 32bit Intel(R)
> Core(TM) e8...@3.ghz, 2.99GHz, 2.95GB of RAM.
>
> The data I am trying to retrieve is through postgre from a university
> server. I checked the postgre for a while but still wouldn't find the number
> of total records. Would you give some hints please? Thank you very much.
>
> --
> View this message in context: 
> http://r.789695.n4.nabble.com/Error-cannot-allocate-vector-of-size-tp3629384p3631168.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.
>



-- 
Jim Holtman
Data Munger Guru

What is the problem that you are trying to solve?

__
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] Separator of data

2011-06-28 Thread jim holtman
try this:

> x <- read.fwf(textConnection("188556644
+ 225588666
+ 55555"), width = rep(1,9))
>
> x
  V1 V2 V3 V4 V5 V6 V7 V8 V9
1  1  8  8  5  5  6  6  4  4
2  2  2  5  5  8  8  6  6  6
3  5  5  8  8  8  8  5  5  5
>


On Tue, Jun 28, 2011 at 3:47 PM, Trying To learn again
 wrote:
>  Hi all,
>
> I have a matrix like this:
>
> 188556644
> 225588666
> 55555
>
> I try to read the table using read table but if I put sep="" I have seen it
> expects a white space, is there a "sep" option to  read this matrix so
> each single number is a position of the matrix
>
> You see this matrix would be an 3x9 matrix
>
> I tried other option but also didn´t worked.
>
>  If sep = "" (the default for read.table) the separator is ‘white space’,
> that is one or more spaces, tabs, newlines or carriage returns.
>
>        [[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.
>
>



-- 
Jim Holtman
Data Munger Guru

What is the problem that you are trying to solve?

__
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] create a factor variable from two numeric variables when order is irrelevant

2011-06-28 Thread Daniel Malter
Hi all,

I have two numeric variables that form combinations in a matched sample.
Let's say I have five levels of x and y. What I am seeking to create is a
factor variable that ignores the order of x and y, i.e., the factor should
indicate x=1, y=5, as the same factor as x=5, y=1. Obviously, this becomes
increasingly cumbersome to do by hand as the number of levels increases.

f<-1:5
x<-sample(f,100,replace=T)
y<-sample(f,100,replace=T)
d<-matrix(cbind(x,y),ncol=2)

#A working solution is to remove the order, multiply one column by a scaling
constant, add the second column, and create the factor for this numeric
value. However, I was wondering whether there is less awkward, more direct
way to do this.

i<-apply(t(apply(d,1,function(x) sort(x))),1,function(y) 10*y[1]+y[2])
i<-factor(i)
i

Thanks for your help,
Daniel




--
View this message in context: 
http://r.789695.n4.nabble.com/create-a-factor-variable-from-two-numeric-variables-when-order-is-irrelevant-tp3631318p3631318.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] Separator of data

2011-06-28 Thread David Winsemius


On Jun 28, 2011, at 3:56 PM, David Winsemius wrote:



On Jun 28, 2011, at 3:47 PM, Trying To learn again wrote:


Hi all,

I have a matrix like this:

188556644
225588666
55555

I try to read the table using read table but if I put sep="" I have  
seen it
expects a white space, is there a "sep" option to  read this matrix  
so

each single number is a position of the matrix


No. You want read.fwf ... which I thought was in the foreign package  
but it appears to be in base.


> nchar(188556644)
[1] 9
> Lines <- textConnection("188556644
+ 225588666
+ 55555")
> read.fwf(Lines, rep(1,9))
 V1 V2 V3 V4 V5 V6 V7 V8 V9
1  1  8  8  5  5  6  6  4  4
2  2  2  5  5  8  8  6  6  6
3  5  5  8  8  8  8  5  5  5


... and wrap data.matrix around that result if you really do want a  
matrix.







You see this matrix would be an 3x9 matrix





David Winsemius, MD
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] Separator of data

2011-06-28 Thread David Winsemius


On Jun 28, 2011, at 3:47 PM, Trying To learn again wrote:


Hi all,

I have a matrix like this:

188556644
225588666
55555

I try to read the table using read table but if I put sep="" I have  
seen it

expects a white space, is there a "sep" option to  read this matrix so
each single number is a position of the matrix


No. You want read.fwf ... which I thought was in the foreign package  
but it appears to be in base.


> nchar(188556644)
[1] 9
> Lines <- textConnection("188556644
+ 225588666
+ 55555")
> read.fwf(Lines, rep(1,9))
  V1 V2 V3 V4 V5 V6 V7 V8 V9
1  1  8  8  5  5  6  6  4  4
2  2  2  5  5  8  8  6  6  6
3  5  5  8  8  8  8  5  5  5



You see this matrix would be an 3x9 matrix

I tried other option but also didn´t worked.

If sep = "" (the default for read.table) the separator is ‘white  
space’,

that is one or more spaces, tabs, newlines or carriage returns.

[[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.


David Winsemius, MD
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] Separator of data

2011-06-28 Thread Ben Bolker
Trying To learn again  gmail.com> writes:
 
> 188556644
> 225588666
> 55555
> 
> I try to read the table using read table but if I put sep="" I have seen it
> expects a white space, is there a "sep" option to  read this matrix so
> each single number is a position of the matrix

  ?read.fwf, I think ...

__
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] Separator of data

2011-06-28 Thread Trying To learn again
 Hi all,

I have a matrix like this:

188556644
225588666
55555

I try to read the table using read table but if I put sep="" I have seen it
expects a white space, is there a "sep" option to  read this matrix so
each single number is a position of the matrix

You see this matrix would be an 3x9 matrix

I tried other option but also didn´t worked.

 If sep = "" (the default for read.table) the separator is ‘white space’,
that is one or more spaces, tabs, newlines or carriage returns.

[[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] parallel computing with 'foreach'

2011-06-28 Thread Stacey Wood
Hi all,
I would like to parallelize some R code and would like to use the 'foreach'
package with a foreach loop.  However, whenever I call a function from an
enabled package outside of MASS, I get an error message that a number of the
functions aren't recognized (even though the functions should be defined).
For example:

library(foreach)
library(doSMP)
library(survival)
# Create the simplest test data set
test1 <- list(time=c(4,3,1,1,2,2,3),
  status=c(1,1,1,0,1,1,0),
  x=c(0,2,1,1,1,0,0),
  sex=c(0,0,0,0,1,1,1))
# Fit a stratified model
coxph(Surv(time, status) ~ x + strata(sex), test1)

w <- startWorkers()
registerDoSMP(w)
foreach(i=1:3) %dopar% {
# Fit a stratified model
fit<-coxph(Surv(time, status) ~ x + strata(sex), test1)
summary(fit)$coef[i]
}
stopWorkers(w)
Error message:
Error in { : task 1 failed - "could not find function "coxph""


If I call library(survival) inside the foreach loop, everything runs
properly.  I don't think that I should have to call the package iteratively
inside the loop.  I would like to use a foreach loop inside code for my own
package, but this is a problem since I can't call my own package in the
source code for the package itself!  Any advice would be appreciated.

Thanks,
Stacey

[[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] Error: cannot allocate vector of size

2011-06-28 Thread xin123620
Thank you Jeff. You are absolutely right. I just edited the R and computer
info in: R is 32 bit; computer is his computer is Windows XP, 32bit Intel(R)
Core(TM) e8...@3.ghz, 2.99GHz, 2.95GB of RAM. 

The data I am trying to retrieve is through postgre from a university
server. I checked the postgre for a while but still wouldn't find the number
of total records. Would you give some hints please? Thank you very much. 

--
View this message in context: 
http://r.789695.n4.nabble.com/Error-cannot-allocate-vector-of-size-tp3629384p3631168.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] Loop through each subject

2011-06-28 Thread StellathePug
 > for (i in 1:(dat[(unique(dat$Subject)),)]

I don't think the order of the parentheses when you open the loop is
correct. You have four (s and only three )s. Plus the brackets (square
parentheses) seem so be out of order too. 


If you use RStudio to write your code, when you highlight a parenthesis, it
will highlight the corresponding closing one.

HTH,
Rita

 

--
View this message in context: 
http://r.789695.n4.nabble.com/Loop-through-each-subject-tp3631046p3631105.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.


[R] Testing the proportional odds assumption of an ordinal generalized estimating equations (GEE) regression model

2011-06-28 Thread Andreas Karlsson

Dear list members,
 
I am estimating an ordinal generalized estimating equations (GEE) regression 
model on repeated measurements data.
 
Is there any way (preferably in R) to test the proportional odds assumption of 
this model?
 
Thanks in advance.
 
Andreas
 
 
  
[[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] Weighted Least Square Model for a Binary Outcome

2011-06-28 Thread Vivian Zhuang
Dear R Users,

I would like to use R to fit a Weighted Least Square model for a
binary outcome, say Y.  The model is the one widely used for a binary
dependent variable when the logistic model has not been proposed.

Does anyone know how to specify the weight as the square root of
1/(E(Y)(1-E(Y)) in lm() or any other regression functions?

I know that varPower() in the package of gls() can provide an optimal
alpha estimator for a weight with the form of $E(Y)^{-2\alpha}$, which
does not include the weight form I need. Please correct me if I am
wrong.

Thanks for any replies in advance!

Best Regards,
Vivian

__
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] indexing with which, logical indexing, and missing values

2011-06-28 Thread Juliet Hannah
I have a data frame in which missing values exist, and I need to
recode the string "missing" to a missing value. For the example, let's
assume I cannot do this while reading it in. Even though this has been
discussed extensively, I'm still a little confused about when to index
with "which" and when to use logical indexing.

Below is what I have done. Is there a more R-appropriate way to do this? Thanks.


# create data with missing values

myData <- head(mtcars)
myData[c(1,2),'cyl'] <- "missing"
is.na(myData[3,'cyl']) <- TRUE
myData[c(1,2,5),'disp'] <- "missing"
myData


# loop through columns to replace "missing"

myColNames <- colnames(myData)

for (myCol in myColNames) {
   NA_index <- which(myData[,myCol] =="missing")

# which creates problems when no columns have "missing"

   if (length(NA_index) > 0) {
  is.na(myData[NA_index,myCol]) <- TRUE
   }
}

myData

__
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 print "<=" in plot title

2011-06-28 Thread array chip
Thank you again David for the thoughtful comments on plotmath. Really 
appreciated.

John



- Original Message 
From: David Winsemius 
To: array chip 
Cc: Peter Ehlers ; R 
Sent: Tue, June 28, 2011 12:20:49 PM
Subject: Re: [R] how to print "<=" in plot title


On Jun 28, 2011, at 2:52 PM, array chip wrote:

> Thank you David for the obvious fix and sorry for my lacking innovative 
spirit,
> :-)
> 
> Really, I know I haven't grasped the essence of plotting these math symbols in
> R.

A lot of people (including me) have had trouble understanding to to write 
proper 
plotmath code. Here's my 10 cent version of an intro...things that were not 
clear to me on first, second, or third reading of the help(plotmath) page. (I 
am 
not saying these things are not in the page, just that they were not clear to 
me 
after multiple efforts at digestion. Searching r-help archives for worked 
examples was the most productive learning strategy.)

The stuff on left side of the table in the plotmath help page represent the 
"special words and symbols" and they need to be separated with the proper 
operators, since spaces are ignored (as actually happens in R parsing as well 
but we are generally shielded form that fact). Words other than these specials 
can be entered without quotes since expressions are not evaluated.  The list of 
greek letters is not complete. Not all of the script greeks work.  The "*" and 
"~" operators are the usual way to separate plotmath sub-expressions with 
either 
no-space or space displayed respectively. Commas are also special in separating 
individual expression values, so don't use them unless you want a multiple 
expression value (or need them inside a plotmath 'paste' or 'list'). You 
generally do not want multiple values of expression vector when constructing 
'main' or 'sub' arguments, but may need them when constructing labels for plot 
axes.  Only use quotes when they are really needed. You need to construct the 
arguments so that infix operations have flanking operands and notice that the 
plotmath paste function has no sep argument.


> 
> John
> 
> 
> 
> - Original Message 
> From: David Winsemius 
> To: array chip 
> Cc: Peter Ehlers ; R 
> Sent: Tue, June 28, 2011 11:50:02 AM
> Subject: Re: [R] how to print "<=" in plot title
> 
> 
> On Jun 28, 2011, at 2:42 PM, array chip wrote:
> 
>> David,
>> 
>> I tried your suggestion, still not working:
>> 
>> x<-3
>> plot(1:10)
>> title(bquote(bold(x) <= bold(as.character(.(x)) )))
>> 
>> 
>> It prints x<=as.character(3) as title
> 
> Kids these days! No innovative spirit. Why in my day... they would be
> jumping with the obvious fix to an elder's error.
> 
> x<-3
> plot(1:10)
> title( bquote(bold(x) <= bold(.(as.character(x)) )))
> 
> --David.
>> 
>> Thanks
>> 
>> John
>> 
>> 
>> 
>> - Original Message 
>> From: David Winsemius 
>> To: array chip 
>> Cc: Peter Ehlers ; R 
>> Sent: Tue, June 28, 2011 11:30:23 AM
>> Subject: Re: [R] how to print "<=" in plot title
>> 
>> 
>> On Jun 28, 2011, at 2:19 PM, array chip wrote:
>> 
>>> Thank you David and Bert.
>>> 
>>> x<-3plot(1:10)
>>> title(bquote( x <= .(x) ))
>>> 
>>> would do what I want. But I also want the title printed in bold
>>> font. so I
>>> tried
>>> 
>>> x<-3
>>> plot(1:10)
>>> title(bquote(bold(x <= .(x)) ))
>>> 
>>> But this did not print the "less than equal to" symbol and the
>>> number 3 (from
>>> variable x) in bold. Anyway to solve that?
>> 
>> Nope. The Symbol font has no bold type face. Bolding of numbers
>> _can_ be done
>> inside bquote with bold(as.character(.(x)) )
>> 
>> --David
>>> 
>>> Thanks again!
>>> 
>>> John
>>> 
>>> 
>>> 
>>> 
>>> - Original Message 
>>> From: David Winsemius 
>>> To: Peter Ehlers 
>>> Cc: array chip ; R 
>>> Sent: Tue, June 28, 2011 11:04:07 AM
>>> Subject: Re: [R] how to print "<=" in plot title
>>> 
>>> 
>>> On Jun 28, 2011, at 1:52 PM, Peter Ehlers wrote:
>>> 
 On 2011-06-28 10:25, array chip wrote:
> Hi, how can I print "<=" (I mean the symbol of just one
> character) in the
>>> main
> title of a plot?
> 
> for example:
> 
> plot(1:10, main=paste("x<=", x))
> 
> where variable x is some number generated on the fly.
 
 x <- 2.718
 plot(0, 0)
 title(bquote( x %<=% .(x) ))
>>> 
>>> I think John wants the mathematical symbol. As was pointed out in a
>>> question
>>> last week, the `<=` plotmath symbol needs to be flanked by operands.
>>> Non-printing operands can be created with the phantom function:
>>> 
>>> title(main=expression(phantom("")<=phantom("")) )
>>> 
>>> Contrary to Gunters's comment, this is probably going to work on
>>> all the three
>>> major OS platforms. It depends only on whether there is a Symbol
>>> font mapped
>> to
>>> the output device.
 
 ?plotmath
>>> 
>>> Yes. The details are there.
>>> 
 
 Peter Ehlers
 
>>> 
>>> 
>>> David Winsemius, MD
>>> West Hartford, CT
>> 
>> David Winsemius, MD
>> West Hartford, CT
> 
>

Re: [R] Loop through each subject

2011-06-28 Thread David Winsemius


On Jun 28, 2011, at 2:51 PM, Edward Patzelt wrote:

Huh, not sure I understand your feedback.  There is only 1 file that  
is 1
large dataframe.  I want to execute the commands on each subject in  
the
dataframe and ouput their respective files with the subject # and  
file type

appended (10_green.txt).


You named that file, paste(dat$Subject[[1]] plus a constant string. I  
assumed you meant to name a new file for each subject. And it still  
appears you wanted that. Your code won't give it to you because you  
are not using an argument to paste that is local to the inner loop. dat 
$Subject[[1]] will always be the same result.


Try instead something like:   paste(i, "red.txt", sep="_")

Or perhaps:  paste(colr[1,"Subject"], "red.txt", sep="_") # since colr  
and colg will vary.


I also incorrectly parsed the paste function thinking that the  
append="red.txt" and "green.txt" were arguments to write.table's  
append argument. You can discard those comments from consideration.


Is a tab a legitimate character in your OS naming convention? Seems  
error-prone to me, but what do I know?


--
david




How would I do this loop index?
- Show quoted text -

On Tue, Jun 28, 2011 at 1:27 PM, David Winsemius >wrote:




On Jun 28, 2011, at 1:44 PM, Edward Patzelt wrote:

R help -


I am attempting to write a script that has multiple subjects in 1  
data

file.
Each subject has multiple rows with columns as variables.  Here is  
my

code,
I am having problem executing it on each unique subject id (dat 
$Subject).




One problem that I see is that you are calling all of your files  
the same
thing (i.e. overwriting earlier results. Why aren't you using the  
loop index

in the naming process?

(And aeppnd is a logical argument in write.table.)

?write.table

--
David.



getwd()

setwd("/Users/edwardpatzelt/**Desktop/Neuroimaging/MERIT/**SRRT/ 
merge")



dat <- read.table("test2.txt", header = TRUE, na.strings = NA,
stringsAsFactors = FALSE, sep = "\t")


for(i in 1:length(dat))

{

for (i in 1:)dat[(unique(dat$Subject)),)**]

{

 colg <- dat[grep("Green", dat$CueProbe),]

colg <- data.frame(colg$SRRTCue.**OnsetTime/1000,
(colg$SRRTFix2.OnsetTime-
colg$SRRTCue.OnsetTime)/1000, (ifelse((colg$SRRTProbe.ACC == 1 |
colg$Probe==
"+"), 1, 0)))

colr <- dat[grep("Red", dat$CueProbe),]

colr <- data.frame(colr$SRRTCue.**OnsetTime/1000,
(colr$SRRTFix2.OnsetTime-
colr$SRRTCue.OnsetTime)/1000, (ifelse((colr$SRRTProbe.ACC == 1 |
colr$Probe==
"+"), 1, 0)))

  write.table(colg, file  = paste(dat$Subject[[1]], sep = "\t",  
append =

"green.txt"), col.names = FALSE, row.names = FALSE)

write.table(colr, file  = paste(dat$Subject[[1]], sep = "\t",  
append =

"red.txt"), col.names = FALSE, row.names = FALSE)

  }

}






--
Edward H. Patzelt
Research Assistant – TRiCAM Lab
University of Minnesota – Psychology/Psychiatry
VA Medical Center
Office: S355 Elliot Hall - Twin Cities Campus
Phone: 612-626-0072  Email: patze...@umn.edu

Please consider the environment before printing this email
www.psych.umn.edu/research/**tricam


  [[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.



David Winsemius, MD
West Hartford, CT





--
Edward H. Patzelt
Research Assistant – TRiCAM Lab
University of Minnesota – Psychology/Psychiatry
VA Medical Center
Office: S355 Elliot Hall - Twin Cities Campus
Phone: 612-626-0072  Email: patze...@umn.edu

Please consider the environment before printing this email
www.psych.umn.edu/research/tricam

[[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.


David Winsemius, MD
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] R-Installation on Unix -- "Make: Don't know how to make #. Stop."

2011-06-28 Thread Ben Bolker
Zhou, Hong  email.chop.edu> writes:

> ./configure was run successfully on my HP-UX ia64 server with exit=0, 
> but when type make at prompt, get this
> error "Make: Don't know how to make #.  Stop."  Does anyone has 
> any clues about this message? Thank you very much!
> #make
> Rmath.h is unchanged
> `libRblas.sl' is up to date.
> /app/R/R-2.13.0/lib/libRblas.sl is unchanged
> `libbz2.a' is up to date.
> `libpcre.a' is up to date.
> `libz.a' is up to date.
> ../../../src/include/libintl.h is unchanged
> ../../../include/libintl.h is unchanged
> `charsetalias.h' is up to date.
> `libintl.a' is up to date.
> `libtre.a' is up to date.
> `liblzma.a' is up to date.
> Make: Don't know how to make #.  Stop.
> *** Error exit code 1
> Stop.

  I don't know, but this might be more appropriately posted to
the R-devel list.

It doesn't seem that anyone has asked on the R-devel list for
quite a while ...

http://finzi.psych.upenn.edu/cgi-bin/namazu.cgi?  [UNBREAK THIS LINE]
query=hp-ux+ia64&max=100&result=normal&sort=score&idxname=R-devel

https://stat.ethz.ch/pipermail/r-help/2010-January/224757.html

__
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 print "<=" in plot title

2011-06-28 Thread David Winsemius


On Jun 28, 2011, at 2:52 PM, array chip wrote:

Thank you David for the obvious fix and sorry for my lacking  
innovative spirit,

:-)

Really, I know I haven't grasped the essence of plotting these math  
symbols in

R.


A lot of people (including me) have had trouble understanding to to  
write proper plotmath code. Here's my 10 cent version of an  
intro...things that were not clear to me on first, second, or third  
reading of the help(plotmath) page. (I am not saying these things are  
not in the page, just that they were not clear to me after multiple  
efforts at digestion. Searching r-help archives for worked examples  
was the most productive learning strategy.)


The stuff on left side of the table in the plotmath help page  
represent the "special words and symbols" and they need to be  
separated with the proper operators, since spaces are ignored (as  
actually happens in R parsing as well but we are generally shielded  
form that fact). Words other than these specials can be entered  
without quotes since expressions are not evaluated.  The list of greek  
letters is not complete. Not all of the script greeks work.  The "*"  
and "~" operators are the usual way to separate plotmath sub- 
expressions with either no-space or space displayed respectively.  
Commas are also special in separating individual expression values, so  
don't use them unless you want a multiple expression value (or need  
them inside a plotmath 'paste' or 'list'). You generally do not want  
multiple values of expression vector when constructing 'main' or 'sub'  
arguments, but may need them when constructing labels for plot axes.   
Only use quotes when they are really needed. You need to construct the  
arguments so that infix operations have flanking operands and notice  
that the plotmath paste function has no sep argument.





John



- Original Message 
From: David Winsemius 
To: array chip 
Cc: Peter Ehlers ; R 
Sent: Tue, June 28, 2011 11:50:02 AM
Subject: Re: [R] how to print "<=" in plot title


On Jun 28, 2011, at 2:42 PM, array chip wrote:


David,

I tried your suggestion, still not working:

x<-3
plot(1:10)
title(bquote(bold(x) <= bold(as.character(.(x)) )))


It prints x<=as.character(3) as title


Kids these days! No innovative spirit. Why in my day... they would be
jumping with the obvious fix to an elder's error.

x<-3
plot(1:10)
title( bquote(bold(x) <= bold(.(as.character(x)) )))

--
David.


Thanks

John



- Original Message 
From: David Winsemius 
To: array chip 
Cc: Peter Ehlers ; R 
Sent: Tue, June 28, 2011 11:30:23 AM
Subject: Re: [R] how to print "<=" in plot title


On Jun 28, 2011, at 2:19 PM, array chip wrote:


Thank you David and Bert.

x<-3plot(1:10)
title(bquote( x <= .(x) ))

would do what I want. But I also want the title printed in bold
font. so I
tried

x<-3
plot(1:10)
title(bquote(bold(x <= .(x)) ))

But this did not print the "less than equal to" symbol and the
number 3 (from
variable x) in bold. Anyway to solve that?


Nope. The Symbol font has no bold type face. Bolding of numbers
_can_ be done
inside bquote with bold(as.character(.(x)) )

--David


Thanks again!

John




- Original Message 
From: David Winsemius 
To: Peter Ehlers 
Cc: array chip ; R 
Sent: Tue, June 28, 2011 11:04:07 AM
Subject: Re: [R] how to print "<=" in plot title


On Jun 28, 2011, at 1:52 PM, Peter Ehlers wrote:


On 2011-06-28 10:25, array chip wrote:

Hi, how can I print "<=" (I mean the symbol of just one
character) in the

main

title of a plot?

for example:

plot(1:10, main=paste("x<=", x))

where variable x is some number generated on the fly.


x <- 2.718
plot(0, 0)
title(bquote( x %<=% .(x) ))


I think John wants the mathematical symbol. As was pointed out in a
question
last week, the `<=` plotmath symbol needs to be flanked by operands.
Non-printing operands can be created with the phantom function:

title(main=expression(phantom("")<=phantom("")) )

Contrary to Gunters's comment, this is probably going to work on
all the three
major OS platforms. It depends only on whether there is a Symbol
font mapped

to

the output device.


?plotmath


Yes. The details are there.



Peter Ehlers




David Winsemius, MD
West Hartford, CT


David Winsemius, MD
West Hartford, CT


David Winsemius, MD
West Hartford, CT


David Winsemius, MD
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] means and error bars on xyplot for binary data

2011-06-28 Thread Peter Ehlers

On 2011-06-28 00:12, Louis Plough wrote:

Hi,
I have binary (0,1) data for a trait as my response variable, and
a dependent variable, genotype, with three classes (AA, AB, BB).

I would like to plot this data so that across the three genoytpes, even
though the points are all either 0 or 1, i want them to stack up or be seen
using 'jitter'.  So far I have been able to do this using xyplot {lattice}
(code below) but could not get the points to jitter or stack up on boxplot
or bwplot {lattice}.

  I would also like to add to the xyplot object, the mean of the values at
each of these classes  which will vary depending on how many data points are
at 0 and 1 for a given genotype.  I would also like to put error (i.e.
standard error) bars around these estimates.

I have tried using the points() function to put the mean at each of the
genotype classes, but the point ends up off the figure. Any ideas how to get
this going?

here is some example code.


gtype<-c("AA","AB","BB")

x<-sample(gtype,20,replace=TRUE)
y<-sample(c(0,1),20,replace=TRUE)
bin.data<-data.frame(x,y)
xyplot(y~x, jitter.y=TRUE, jitter.x=TRUE,factor=.6, data=bin.data)

Then If I wanted to add the means to the plot, I would do this, which will
print the mean points on a box plot, but not an xyplot:

means1<- tapply(bin.data$y,bin.data$x,mean)
points(means1,col="red",pch=18)

Is there a way to get the means, and even error bars on the same xyplot?


I don't know why you want to do what you're doing, but it's
pretty easy with lattice (or with ggplot2). But do use
stripplot instead of xyplot. Define an appropriate panel
function to add the mean points and error bars:

  library(lattice)
  library(Hmisc) ## for error bars, using panel.xYplot

  mn <- with(bin.data, tapply(y, x, mean))
  M <- Cbind(mn, lower = mn - .1, upper = mn + .1) ## NB: capital 'C'

  stripplot(jitter(y, factor =.6) ~ x,
data = bin.data,
ylab = "",
panel = function(...) {
  panel.stripplot(..., jitter=TRUE, factor=1.2, pch=1, cex=2)
  panel.xYplot(seq_along(mn), M, pch=16, cex=2, col="red")
}
  )

Peter Ehlers



Thanks for any help in advance,
Louis

[[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] how to print "<=" in plot title

2011-06-28 Thread array chip
Thank you David for the obvious fix and sorry for my lacking innovative spirit, 
:-)

Really, I know I haven't grasped the essence of plotting these math symbols in 
R.

John



- Original Message 
From: David Winsemius 
To: array chip 
Cc: Peter Ehlers ; R 
Sent: Tue, June 28, 2011 11:50:02 AM
Subject: Re: [R] how to print "<=" in plot title


On Jun 28, 2011, at 2:42 PM, array chip wrote:

> David,
>
> I tried your suggestion, still not working:
>
> x<-3
> plot(1:10)
> title(bquote(bold(x) <= bold(as.character(.(x)) )))
>
>
> It prints x<=as.character(3) as title

Kids these days! No innovative spirit. Why in my day... they would be  
jumping with the obvious fix to an elder's error.

x<-3
plot(1:10)
title( bquote(bold(x) <= bold(.(as.character(x)) )))

-- 
David.
>
> Thanks
>
> John
>
>
>
> - Original Message 
> From: David Winsemius 
> To: array chip 
> Cc: Peter Ehlers ; R 
> Sent: Tue, June 28, 2011 11:30:23 AM
> Subject: Re: [R] how to print "<=" in plot title
>
>
> On Jun 28, 2011, at 2:19 PM, array chip wrote:
>
>> Thank you David and Bert.
>>
>> x<-3plot(1:10)
>> title(bquote( x <= .(x) ))
>>
>> would do what I want. But I also want the title printed in bold  
>> font. so I
>> tried
>>
>> x<-3
>> plot(1:10)
>> title(bquote(bold(x <= .(x)) ))
>>
>> But this did not print the "less than equal to" symbol and the  
>> number 3 (from
>> variable x) in bold. Anyway to solve that?
>
> Nope. The Symbol font has no bold type face. Bolding of numbers  
> _can_ be done
> inside bquote with bold(as.character(.(x)) )
>
> --David
>>
>> Thanks again!
>>
>> John
>>
>>
>>
>>
>> - Original Message 
>> From: David Winsemius 
>> To: Peter Ehlers 
>> Cc: array chip ; R 
>> Sent: Tue, June 28, 2011 11:04:07 AM
>> Subject: Re: [R] how to print "<=" in plot title
>>
>>
>> On Jun 28, 2011, at 1:52 PM, Peter Ehlers wrote:
>>
>>> On 2011-06-28 10:25, array chip wrote:
 Hi, how can I print "<=" (I mean the symbol of just one  
 character) in the
>> main
 title of a plot?

 for example:

 plot(1:10, main=paste("x<=", x))

 where variable x is some number generated on the fly.
>>>
>>> x <- 2.718
>>> plot(0, 0)
>>> title(bquote( x %<=% .(x) ))
>>
>> I think John wants the mathematical symbol. As was pointed out in a  
>> question
>> last week, the `<=` plotmath symbol needs to be flanked by operands.
>> Non-printing operands can be created with the phantom function:
>>
>> title(main=expression(phantom("")<=phantom("")) )
>>
>> Contrary to Gunters's comment, this is probably going to work on  
>> all the three
>> major OS platforms. It depends only on whether there is a Symbol  
>> font mapped
> to
>> the output device.
>>>
>>> ?plotmath
>>
>> Yes. The details are there.
>>
>>>
>>> Peter Ehlers
>>>
>>
>>
>> David Winsemius, MD
>> West Hartford, CT
>
> David Winsemius, MD
> West Hartford, CT

David Winsemius, MD
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] Loop through each subject

2011-06-28 Thread Edward Patzelt
Huh, not sure I understand your feedback.  There is only 1 file that is 1
large dataframe.  I want to execute the commands on each subject in the
dataframe and ouput their respective files with the subject # and file type
appended (10_green.txt).

How would I do this loop index?
- Show quoted text -

On Tue, Jun 28, 2011 at 1:27 PM, David Winsemius wrote:

>
> On Jun 28, 2011, at 1:44 PM, Edward Patzelt wrote:
>
>  R help -
>>
>> I am attempting to write a script that has multiple subjects in 1 data
>> file.
>> Each subject has multiple rows with columns as variables.  Here is my
>> code,
>> I am having problem executing it on each unique subject id (dat$Subject).
>>
>
> One problem that I see is that you are calling all of your files the same
> thing (i.e. overwriting earlier results. Why aren't you using the loop index
> in the naming process?
>
> (And aeppnd is a logical argument in write.table.)
>
> ?write.table
>
> --
> David.
>
>>
>>  getwd()
>>
>> setwd("/Users/edwardpatzelt/**Desktop/Neuroimaging/MERIT/**SRRT/merge")
>>
>>
>> dat <- read.table("test2.txt", header = TRUE, na.strings = NA,
>> stringsAsFactors = FALSE, sep = "\t")
>>
>>
>> for(i in 1:length(dat))
>>
>> {
>>
>> for (i in 1:)dat[(unique(dat$Subject)),)**]
>>
>> {
>>
>>   colg <- dat[grep("Green", dat$CueProbe),]
>>
>>  colg <- data.frame(colg$SRRTCue.**OnsetTime/1000,
>> (colg$SRRTFix2.OnsetTime-
>> colg$SRRTCue.OnsetTime)/1000, (ifelse((colg$SRRTProbe.ACC == 1 |
>> colg$Probe==
>> "+"), 1, 0)))
>>
>>  colr <- dat[grep("Red", dat$CueProbe),]
>>
>>  colr <- data.frame(colr$SRRTCue.**OnsetTime/1000,
>> (colr$SRRTFix2.OnsetTime-
>> colr$SRRTCue.OnsetTime)/1000, (ifelse((colr$SRRTProbe.ACC == 1 |
>> colr$Probe==
>> "+"), 1, 0)))
>>
>>write.table(colg, file  = paste(dat$Subject[[1]], sep = "\t", append =
>> "green.txt"), col.names = FALSE, row.names = FALSE)
>>
>>  write.table(colr, file  = paste(dat$Subject[[1]], sep = "\t", append =
>> "red.txt"), col.names = FALSE, row.names = FALSE)
>>
>>}
>>
>>  }
>>
>>
>>
>>
>>
>>
>> --
>> Edward H. Patzelt
>> Research Assistant – TRiCAM Lab
>> University of Minnesota – Psychology/Psychiatry
>> VA Medical Center
>> Office: S355 Elliot Hall - Twin Cities Campus
>> Phone: 612-626-0072  Email: patze...@umn.edu
>>
>> Please consider the environment before printing this email
>> www.psych.umn.edu/research/**tricam
>>
>>[[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.
>>
>
> David Winsemius, MD
> West Hartford, CT
>
>


-- 
Edward H. Patzelt
Research Assistant – TRiCAM Lab
University of Minnesota – Psychology/Psychiatry
VA Medical Center
Office: S355 Elliot Hall - Twin Cities Campus
Phone: 612-626-0072  Email: patze...@umn.edu

Please consider the environment before printing this email
www.psych.umn.edu/research/tricam

[[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] how to print "<=" in plot title

2011-06-28 Thread David Winsemius


On Jun 28, 2011, at 2:42 PM, array chip wrote:


David,

I tried your suggestion, still not working:

x<-3
plot(1:10)
title(bquote(bold(x) <= bold(as.character(.(x)) )))


It prints x<=as.character(3) as title


Kids these days! No innovative spirit. Why in my day... they would be  
jumping with the obvious fix to an elder's error.


x<-3
plot(1:10)
title( bquote(bold(x) <= bold(.(as.character(x)) )))

--
David.


Thanks

John



- Original Message 
From: David Winsemius 
To: array chip 
Cc: Peter Ehlers ; R 
Sent: Tue, June 28, 2011 11:30:23 AM
Subject: Re: [R] how to print "<=" in plot title


On Jun 28, 2011, at 2:19 PM, array chip wrote:


Thank you David and Bert.

x<-3plot(1:10)
title(bquote( x <= .(x) ))

would do what I want. But I also want the title printed in bold  
font. so I

tried

x<-3
plot(1:10)
title(bquote(bold(x <= .(x)) ))

But this did not print the "less than equal to" symbol and the  
number 3 (from

variable x) in bold. Anyway to solve that?


Nope. The Symbol font has no bold type face. Bolding of numbers  
_can_ be done

inside bquote with bold(as.character(.(x)) )

--David


Thanks again!

John




- Original Message 
From: David Winsemius 
To: Peter Ehlers 
Cc: array chip ; R 
Sent: Tue, June 28, 2011 11:04:07 AM
Subject: Re: [R] how to print "<=" in plot title


On Jun 28, 2011, at 1:52 PM, Peter Ehlers wrote:


On 2011-06-28 10:25, array chip wrote:
Hi, how can I print "<=" (I mean the symbol of just one  
character) in the

main

title of a plot?

for example:

plot(1:10, main=paste("x<=", x))

where variable x is some number generated on the fly.


x <- 2.718
plot(0, 0)
title(bquote( x %<=% .(x) ))


I think John wants the mathematical symbol. As was pointed out in a  
question

last week, the `<=` plotmath symbol needs to be flanked by operands.
Non-printing operands can be created with the phantom function:

title(main=expression(phantom("")<=phantom("")) )

Contrary to Gunters's comment, this is probably going to work on  
all the three
major OS platforms. It depends only on whether there is a Symbol  
font mapped

to

the output device.


?plotmath


Yes. The details are there.



Peter Ehlers




David Winsemius, MD
West Hartford, CT


David Winsemius, MD
West Hartford, CT


David Winsemius, MD
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] cumulative incidence plot vs survival plot

2011-06-28 Thread array chip
Thank you Alan again!  Hope you could also share your thought on my another 
email about the coding of  censoring before death..

Thanks again!

John



- Original Message 
From: alanm (Alan Mitchell) 
To: array chip ; David Winsemius 

Cc: r-help@r-project.org
Sent: Tue, June 28, 2011 11:40:52 AM
Subject: RE: [R] cumulative incidence plot vs survival plot

>So in cuminc() function, the argument "fstatus" should be coded like:
0=censored, 1=event of interest, 2=event of competing risk. Then the
function will calculate CI for each of the 2 types of events >(event of
interest and event of competing risk), am I correct?
Correct.

>What about running regular Cox regression for recurrence? any problem
there? for example, need to take into competing risk as well or regular
Cox regression is still fine?
This is a little trickier.  I would strongly suggest reading up on this
before doing any analyses.  There are a couple of different ways to do
this, but the crr function in cmprsk will perform a competing risks
regression.


Alan Mitchell, MSc
Ph: (206) 839-1708
al...@crab.org

__
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 print "<=" in plot title

2011-06-28 Thread array chip
David,

I tried your suggestion, still not working:

x<-3
plot(1:10)
title(bquote(bold(x) <= bold(as.character(.(x)) )))


It prints x<=as.character(3) as title

Thanks

John



- Original Message 
From: David Winsemius 
To: array chip 
Cc: Peter Ehlers ; R 
Sent: Tue, June 28, 2011 11:30:23 AM
Subject: Re: [R] how to print "<=" in plot title


On Jun 28, 2011, at 2:19 PM, array chip wrote:

> Thank you David and Bert.
> 
> x<-3plot(1:10)
> title(bquote( x <= .(x) ))
> 
> would do what I want. But I also want the title printed in bold font. so I 
>tried
> 
> x<-3
> plot(1:10)
> title(bquote(bold(x <= .(x)) ))
> 
> But this did not print the "less than equal to" symbol and the number 3 (from
> variable x) in bold. Anyway to solve that?

Nope. The Symbol font has no bold type face. Bolding of numbers _can_ be done 
inside bquote with bold(as.character(.(x)) )

--David
> 
> Thanks again!
> 
> John
> 
> 
> 
> 
> - Original Message 
> From: David Winsemius 
> To: Peter Ehlers 
> Cc: array chip ; R 
> Sent: Tue, June 28, 2011 11:04:07 AM
> Subject: Re: [R] how to print "<=" in plot title
> 
> 
> On Jun 28, 2011, at 1:52 PM, Peter Ehlers wrote:
> 
>> On 2011-06-28 10:25, array chip wrote:
>>> Hi, how can I print "<=" (I mean the symbol of just one character) in the
> main
>>> title of a plot?
>>> 
>>> for example:
>>> 
>>> plot(1:10, main=paste("x<=", x))
>>> 
>>> where variable x is some number generated on the fly.
>> 
>> x <- 2.718
>> plot(0, 0)
>> title(bquote( x %<=% .(x) ))
> 
> I think John wants the mathematical symbol. As was pointed out in a question
> last week, the `<=` plotmath symbol needs to be flanked by operands.
> Non-printing operands can be created with the phantom function:
> 
> title(main=expression(phantom("")<=phantom("")) )
> 
> Contrary to Gunters's comment, this is probably going to work on all the three
> major OS platforms. It depends only on whether there is a Symbol font mapped 
to
> the output device.
>> 
>> ?plotmath
> 
> Yes. The details are there.
> 
>> 
>> Peter Ehlers
>> 
> 
> 
> David Winsemius, MD
> West Hartford, CT

David Winsemius, MD
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] coxph() - unexpected result using Crawley's seedlings data (The R Book)

2011-06-28 Thread Ben Bolker
Jacob Brogren  brogren.nu> writes:

> 
> All,
> 
> I rerun once again and managed to reproduce the results from the text book. 
> Made no changes to the code. Could
> it be some problem with convergence?

  It is possible, but *extremely* unlikely, to get non-deterministic
results from R (i.e. running the same code twice from an identical
state and getting different answers [run from a clean R session to be
absolutely sure]) -- this only happens if there is a deep, C-level bug
in the internals of the code, which is unlikely in a piece of core
functionality like coxph().  It is slightly more likely, but still
unlikely, that running the code changes the state of the R session in
a subtle way that makes it run differently the second time in a row.
By far the most likely situation is that you have made some minor
change in the state (i.e. you redefined some variable) that allows
the code to reproduce the results in the book.  (I know I've done this
many times, even when I was initially fairly certain that I hadn't
changed anything.)

  In defense of Crawley: he's written a book that is very useful to
a lot of R users, even if advanced R users sometimes find it a bit
sloppy in places. I agree that he hasn't contributed much back
to the community (except for helping a large population
of beginning users to learn how to use R, which is non-trivial),
but I don't think he has gone out of his way to claim any kind of
official status (other than calling his book "The R Book").

  Ben Bolker

__
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] cumulative incidence plot vs survival plot

2011-06-28 Thread alanm (Alan Mitchell)
>So in cuminc() function, the argument "fstatus" should be coded like:
0=censored, 1=event of interest, 2=event of competing risk. Then the
function will calculate CI for each of the 2 types of events >(event of
interest and event of competing risk), am I correct?
Correct.

>What about running regular Cox regression for recurrence? any problem
there? for example, need to take into competing risk as well or regular
Cox regression is still fine?
This is a little trickier.  I would strongly suggest reading up on this
before doing any analyses.  There are a couple of different ways to do
this, but the crr function in cmprsk will perform a competing risks
regression.


Alan Mitchell, MSc
Ph: (206) 839-1708
al...@crab.org

__
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] Error in library (nls)

2011-06-28 Thread Ben Bolker
matotope  gmail.com> writes:

> I installed the 2.8.0 version and it seems to be working fine now.

  Hard to see from a brief glance at the code why it would not work
in 2.13.0 as well, but glad you got the problem solved.  If you will
need to maintain and extend this code in the future it may be worth
figuring out what breaks between 2.8.0 and 2.13.0 and fixing it,
as it is often difficult to get advice on the list about old versions
of R (as releases are bi-annual, 2.8.0 should be about 2.5 years old,
which is antiquated by R community standards ...)

  Ben Bolker

__
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] Axes labels, greek letters and spaces

2011-06-28 Thread David Winsemius

The * operator can be used for a non-space separation.

expression(Chlorophyll*italic(a)~mu*g~cm^-2)

--  
David.


On Jun 28, 2011, at 2:21 PM, Sam Albers wrote:


Hello all,

I can't seem to figure how to use a greek character in expression() in
plot() labels without adding a space. So for example below when  
plotting

this out

x<-1:10
plot(x,x^2, xlab=expression(Chlorophyll~italic(a)~mu~g~cm^-2))

the axis label read as  μ g cm^-2 because I have space there with a  
tilda.


But if I remove the tilda then my units are mug cm^-2.

Can anyone recommend a way that I can modify the axis label to look  
for like

this: μg cm^-2

Thanks in advance!

Sam.


David Winsemius, MD
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] how to print "<=" in plot title

2011-06-28 Thread David Winsemius


On Jun 28, 2011, at 2:19 PM, array chip wrote:


Thank you David and Bert.

x<-3plot(1:10)
title(bquote( x <= .(x) ))

would do what I want. But I also want the title printed in bold  
font. so I tried


x<-3
plot(1:10)
title(bquote(bold(x <= .(x)) ))

But this did not print the "less than equal to" symbol and the  
number 3 (from

variable x) in bold. Anyway to solve that?


Nope. The Symbol font has no bold type face. Bolding of numbers _can_  
be done inside bquote with bold(as.character(.(x)) )


--
David


Thanks again!

John




- Original Message 
From: David Winsemius 
To: Peter Ehlers 
Cc: array chip ; R 
Sent: Tue, June 28, 2011 11:04:07 AM
Subject: Re: [R] how to print "<=" in plot title


On Jun 28, 2011, at 1:52 PM, Peter Ehlers wrote:


On 2011-06-28 10:25, array chip wrote:
Hi, how can I print "<=" (I mean the symbol of just one character)  
in the

main

title of a plot?

for example:

plot(1:10, main=paste("x<=", x))

where variable x is some number generated on the fly.


x <- 2.718
plot(0, 0)
title(bquote( x %<=% .(x) ))


I think John wants the mathematical symbol. As was pointed out in a  
question

last week, the `<=` plotmath symbol needs to be flanked by operands.
Non-printing operands can be created with the phantom function:

title(main=expression(phantom("")<=phantom("")) )

Contrary to Gunters's comment, this is probably going to work on all  
the three
major OS platforms. It depends only on whether there is a Symbol  
font mapped to

the output device.


?plotmath


Yes. The details are there.



Peter Ehlers




David Winsemius, MD
West Hartford, CT


David Winsemius, MD
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] chull increase number of points

2011-06-28 Thread Ben Bolker
  nevill.uk.net> writes:

> I am using the chull function to create a convex hull of a series of about
> 20,000 data points. 

  You already posted this statement (not a question).  One more try?  (You
might as well read the posting guide while you're at it -- please refrain
from sending your e-mail in HTML format if you can avoid it.)


  Ben Bolker

__
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] Loop through each subject

2011-06-28 Thread David Winsemius


On Jun 28, 2011, at 1:44 PM, Edward Patzelt wrote:


R help -

I am attempting to write a script that has multiple subjects in 1  
data file.
Each subject has multiple rows with columns as variables.  Here is  
my code,
I am having problem executing it on each unique subject id (dat 
$Subject).


One problem that I see is that you are calling all of your files the  
same thing (i.e. overwriting earlier results. Why aren't you using the  
loop index in the naming process?


(And aeppnd is a logical argument in write.table.)

?write.table

--
David.


  getwd()

setwd("/Users/edwardpatzelt/Desktop/Neuroimaging/MERIT/SRRT/merge")


dat <- read.table("test2.txt", header = TRUE, na.strings = NA,
stringsAsFactors = FALSE, sep = "\t")


for(i in 1:length(dat))

{

for (i in 1:)dat[(unique(dat$Subject)),)]

{

   colg <- dat[grep("Green", dat$CueProbe),]

  colg <- data.frame(colg$SRRTCue.OnsetTime/1000, (colg 
$SRRTFix2.OnsetTime-
colg$SRRTCue.OnsetTime)/1000, (ifelse((colg$SRRTProbe.ACC == 1 | colg 
$Probe==

"+"), 1, 0)))

  colr <- dat[grep("Red", dat$CueProbe),]

  colr <- data.frame(colr$SRRTCue.OnsetTime/1000, (colr 
$SRRTFix2.OnsetTime-
colr$SRRTCue.OnsetTime)/1000, (ifelse((colr$SRRTProbe.ACC == 1 | colr 
$Probe==

"+"), 1, 0)))

write.table(colg, file  = paste(dat$Subject[[1]], sep = "\t",  
append =

"green.txt"), col.names = FALSE, row.names = FALSE)

 write.table(colr, file  = paste(dat$Subject[[1]], sep = "\t",  
append =

"red.txt"), col.names = FALSE, row.names = FALSE)

}

 }






--
Edward H. Patzelt
Research Assistant – TRiCAM Lab
University of Minnesota – Psychology/Psychiatry
VA Medical Center
Office: S355 Elliot Hall - Twin Cities Campus
Phone: 612-626-0072  Email: patze...@umn.edu

Please consider the environment before printing this email
www.psych.umn.edu/research/tricam

[[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.


David Winsemius, MD
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.


[R] Axes labels, greek letters and spaces

2011-06-28 Thread Sam Albers
Hello all,

I can't seem to figure how to use a greek character in expression() in
plot() labels without adding a space. So for example below when plotting
this out

x<-1:10
plot(x,x^2, xlab=expression(Chlorophyll~italic(a)~mu~g~cm^-2))

the axis label read as  μ g cm^-2 because I have space there with a tilda.

But if I remove the tilda then my units are mug cm^-2.

Can anyone recommend a way that I can modify the axis label to look for like
this: μg cm^-2

Thanks in advance!

Sam

[[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] how to print "<=" in plot title

2011-06-28 Thread array chip
Thank you David and Bert. 

x<-3plot(1:10)
title(bquote( x <= .(x) ))

would do what I want. But I also want the title printed in bold font. so I tried

x<-3
plot(1:10)
title(bquote(bold(x <= .(x)) ))

But this did not print the "less than equal to" symbol and the number 3 (from 
variable x) in bold. Anyway to solve that?

Thanks again!

John




- Original Message 
From: David Winsemius 
To: Peter Ehlers 
Cc: array chip ; R 
Sent: Tue, June 28, 2011 11:04:07 AM
Subject: Re: [R] how to print "<=" in plot title


On Jun 28, 2011, at 1:52 PM, Peter Ehlers wrote:

> On 2011-06-28 10:25, array chip wrote:
>> Hi, how can I print "<=" (I mean the symbol of just one character) in the 
main
>> title of a plot?
>> 
>> for example:
>> 
>> plot(1:10, main=paste("x<=", x))
>> 
>> where variable x is some number generated on the fly.
> 
>  x <- 2.718
>  plot(0, 0)
>  title(bquote( x %<=% .(x) ))

I think John wants the mathematical symbol. As was pointed out in a question 
last week, the `<=` plotmath symbol needs to be flanked by operands. 
Non-printing operands can be created with the phantom function:

title(main=expression(phantom("")<=phantom("")) )

Contrary to Gunters's comment, this is probably going to work on all the three 
major OS platforms. It depends only on whether there is a Symbol font mapped to 
the output device.
> 
> ?plotmath

Yes. The details are there.

> 
> Peter Ehlers
> 


David Winsemius, MD
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.


[R] Loop through each subject

2011-06-28 Thread Edward Patzelt
R help -

I am attempting to write a script that has multiple subjects in 1 data file.
 Each subject has multiple rows with columns as variables.  Here is my code,
I am having problem executing it on each unique subject id (dat$Subject).

   getwd()

setwd("/Users/edwardpatzelt/Desktop/Neuroimaging/MERIT/SRRT/merge")


dat <- read.table("test2.txt", header = TRUE, na.strings = NA,
stringsAsFactors = FALSE, sep = "\t")


for(i in 1:length(dat))

 {

 for (i in 1:)dat[(unique(dat$Subject)),)]

 {

colg <- dat[grep("Green", dat$CueProbe),]

   colg <- data.frame(colg$SRRTCue.OnsetTime/1000, (colg$SRRTFix2.OnsetTime-
colg$SRRTCue.OnsetTime)/1000, (ifelse((colg$SRRTProbe.ACC == 1 | colg$Probe==
"+"), 1, 0)))

   colr <- dat[grep("Red", dat$CueProbe),]

   colr <- data.frame(colr$SRRTCue.OnsetTime/1000, (colr$SRRTFix2.OnsetTime-
colr$SRRTCue.OnsetTime)/1000, (ifelse((colr$SRRTProbe.ACC == 1 | colr$Probe==
"+"), 1, 0)))

 write.table(colg, file  = paste(dat$Subject[[1]], sep = "\t", append =
"green.txt"), col.names = FALSE, row.names = FALSE)

  write.table(colr, file  = paste(dat$Subject[[1]], sep = "\t", append =
"red.txt"), col.names = FALSE, row.names = FALSE)

 }

  }






-- 
Edward H. Patzelt
Research Assistant – TRiCAM Lab
University of Minnesota – Psychology/Psychiatry
VA Medical Center
Office: S355 Elliot Hall - Twin Cities Campus
Phone: 612-626-0072  Email: patze...@umn.edu

Please consider the environment before printing this email
www.psych.umn.edu/research/tricam

[[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] R-Installation on Unix -- "Make: Don't know how to make #. Stop."

2011-06-28 Thread Zhou, Hong
Hi, all,

./configure was run successfully on my HP-UX ia64 server with exit=0, but when 
type make at prompt, get this error "Make: Don't know how to make #.  Stop."  
Does anyone has any clues about this message? Thank you very much!
#make
Rmath.h is unchanged
`libRblas.sl' is up to date.
/app/R/R-2.13.0/lib/libRblas.sl is unchanged
`libbz2.a' is up to date.
`libpcre.a' is up to date.
`libz.a' is up to date.
../../../src/include/libintl.h is unchanged
../../../include/libintl.h is unchanged
`charsetalias.h' is up to date.
`libintl.a' is up to date.
`libtre.a' is up to date.
`liblzma.a' is up to date.
Make: Don't know how to make #.  Stop.
*** Error exit code 1
Stop.
Hong

[[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] How do I output all the R-squares of an SUR? summary(fitSUR$eq[[1:4]])$r.squared does not work

2011-06-28 Thread StellathePug
> sapply(fitSUR$eq, function(x) summary(x)$r.squared)
> You can abbreviate that to:
> sapply(summary(fitSUR)$eq, "[[", "r.squared")

This is fantastic! Thanks so much. 

I had a hunch that it would be something related to the apply family but I
am still not very good at using it. Thank you immensely for the two
examples, they made my day!!!

Rita

--
View this message in context: 
http://r.789695.n4.nabble.com/How-do-I-output-all-the-R-squares-of-an-SUR-summary-fitSUR-eq-1-4-r-squared-does-not-work-tp3630601p3630900.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.


[R] Function unfold package RcmdrPlugin.survival

2011-06-28 Thread Rapha
Dear all,

I am using the function ‘unfold’ from the ‘RcmdrPlugin.survival’ to convert
my time-varying covariates dataset from wide to long. I managed to have it
working for my data.

However, the problem I have is that the observations after an event, won’t
be dropped from the dataset. For example, see the dataframe below: the event
occurs at 1.2 (event.time=1), but the 1.3 to 1.6 will remain in the dataset.
I did not find in the 'unfold' function an option to drop them, but I was
probably not looking well. 

>From the Rossi dataset example, I saw that observations following event were
dropped, and I understood this might be because the values of the
time-varying covariates are NA, after the event.
In my case, all time-varying covariates still have values, even after the
event, because they were extracted from a very large number of environmental
raster files; so I guess the function ‘unfold’ sees them as observations
being at risk again.

Do you know/is there any way, to get rid of these remaining observations
(1.3 to 1.6)?


start stop event.time id_cell month rvf_bin lake month_rain month_veg
1.1 010   1 2   1  2.5 2321
1.2 121   1 2   1  2.5 5666
1.3 230   1 2   1  2.5  311
1.4 340   1 2   1  2.5 1221
1.5 450   1 2   1  2.5 1120
1.6 560   1 2   1  2.5 2135
2.1 010   2NA   0  2.5 1222

Many thanks for your advice,

Best regards,

Rapha

--
View this message in context: 
http://r.789695.n4.nabble.com/Function-unfold-package-RcmdrPlugin-survival-tp3630809p3630809.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.


[R] renaming multiple columns + interpolating temperature series

2011-06-28 Thread tomtomme
Greetings R Users, 
I´m new to R but at least managed to read in multiple files:

filenames <- list.files(path=getwd())  
numfiles <- length(filenames) 
for (all_temp in c(1:numfiles)) {
  filenames[all_temp] <- paste(filenames[all_temp],sep="")
 
assign(gsub("[.]ASC$","temp",filenames[all_temp]),read.delim2(filenames[all_temp],
fileEncoding="ISO-8859-15", skip = 4))
  }

Now I want to change the column names on the fly within the above loop. How?
I only found out for one file:

  colnames(w01_10temp) <- c("date", "time", "temp", "na")

I want then to lineary interpolate "date", "time" and "temp" from the
original 5 to 1 second interval for all the files, like:

old:
date timetemp   na
1   22.05.1116:00:0023.653  NA
2   22.05.1116:00:0523.541  NA
...

new:
date timetemp   na
1   22.05.1116:00:0023.653  NA
2   22.05.1116:00:0123.631  NA
3   22.05.1116:00:0223.609  NA
 ...

I already found out about the zoo package, but could not really figure out
how to use it correctly...
Thanks for any help.

--
View this message in context: 
http://r.789695.n4.nabble.com/renaming-multiple-columns-interpolating-temperature-series-tp3630927p3630927.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] Need help on nnet

2011-06-28 Thread arun
Hi Georg,

I am new to R and I am curious if there is a simple way to do the feature
selection you described:

"feature selection is essentially an exhaustive approach which tries
every possible subset of your predictors, trains a network and sees what
the prediction error is. The subset which is best (lowest error) is then
chosen in the end. It normally (as a side-effect) also gives you something
like an importance ranking of the variables when using backward or forward
feature selection. But be careful of interactions between variables. "

Is it an option with nnet or should I use leaps in conjunction with nnet ?

Thanks,
Arun



--
View this message in context: 
http://r.789695.n4.nabble.com/Need-help-on-nnet-tp3081744p3630984.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] Specify ID variable in daisy{cluster}

2011-06-28 Thread adlynch
Hi David -
I wanted to thank you for your response!  This was exactly what I needed.
Sincerely,
Alicia

On Fri, Jun 17, 2011 at 3:33 PM, David L Carlson [via R]
 wrote:
> You need to use hhid as the rownames for housing.cluster rather than
> including it as a variable in the data.frame:
>
> housing.cluster <-data.frame(htypec1, afforcr1, resyrc1, crowdcc1, chprbos1)
> rownames(housing.cluster) <- hhid
>
> Then it will not be included in the cluster analysis but will be used to
> label the dendrogram.
>
> -Original Message-
> From: [hidden email] [mailto:[hidden email]] On
> Behalf Of adlynch
> Sent: Thursday, June 16, 2011 12:35 PM
> To: [hidden email]
> Subject: [R] Specify ID variable in daisy{cluster}
>
> Hi All - I am using the daisy function from the cluster library to create a
> dissimilarity matrix.  I'm going to use that matrix to run a cluster
> analysis.  My participants are identified with the variable, hhid.  However,
> when I try to keep hhid in the dataset that I use to create the
> dissimilarity matrix, daisy uses it to create the matrix rather than
> ignoring it as an ID variable.  I need to have the ID variable so I can
> later on identify which cluster each participant was classified as.  Any
> thoughts would be much appreciated!
>
> housing.cluster <-data.frame(hhid, htypec1, afforcr1, resyrc1, crowdcc1,
> chprbos1)
> housingdiss <- daisy(housing.cluster, metric="gower")
>
>
> --
> View this message in context:
> http://r.789695.n4.nabble.com/Specify-ID-variable-in-daisy-cluster-tp3603136
> p3603136.html
> Sent from the R help mailing list archive at Nabble.com.
>
> __
> [hidden email] 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.
>
> __
> [hidden email] 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.
>
>
> 
> If you reply to this email, your message will be added to the discussion
> below:
> http://r.789695.n4.nabble.com/Specify-ID-variable-in-daisy-cluster-tp3603136p3606287.html
> To unsubscribe from Specify ID variable in daisy{cluster}, click here.



-- 
Alicia Doyle Lynch, Ph.D.
Boston College, Lynch School of Education
Department of Counseling, Developmental, and Educational Psychology
Chestnut Hill, MA 02467
Phone: (617) 552-4534
e-mail: doyl...@bc.edu


--
View this message in context: 
http://r.789695.n4.nabble.com/Specify-ID-variable-in-daisy-cluster-tp3603136p3630875.html
Sent from the R help mailing list archive at Nabble.com.
[[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] cumulative incidence plot vs survival plot

2011-06-28 Thread alanm (Alan Mitchell)
John,

Since death precludes recurrence, censoring deaths would violate the KM
estimator assumption that additional follow-up would eventually lead to
an event.  If your goal is to estimate the probability of recurrence,
then you want CI with deaths as a competing risk.  The cuminc function
in the cmprsk package is a great place to start.  

Gooley has a great paper on the difference between CI and 1-KM (See
Statistics in Medicine, 18, 695-706 (1999)).  

HTH,

Alan Mitchell, MSc
Biostatistician
al...@crab.org

-Original Message-
From: array chip [mailto:arrayprof...@yahoo.com] 
Sent: Monday, June 27, 2011 2:04 PM
To: David Winsemius
Cc: r-help@r-project.org
Subject: Re: [R] cumulative incidence plot vs survival plot

Hi David,

Thanks for responding, and plain text ...(didn't realized I was in rich
text).

The endpoint is disease recurrence, I was producing a regular KM plot of
recurrence-free probability. Then someone recommend using cumulative
incidence is preferred because death was censored in the dataset. I did
a little googling, I found CI was used often in the context of competing
risk. I am totally new to competing risk and trying to understand what
competing risk means and why CI is preferred than KM survival in this
context. If you could share your thoughts helping me to understand,
greatly appreciated.

Searched archive, found people talking about cmprsk package for
estimating and plotting CI. would that be the same as the code you
suggested: plot(time,
cumsum(dead))

Thanks very much!

John





From: David Winsemius 

Cc: r-help@r-project.org
Sent: Mon, June 27, 2011 1:45:35 PM
Subject: Re: [R] cumulative incidence plot vs survival plot


On Jun 27, 2011, at 4:31 PM, array chip wrote:

> Hi, I am wondering if anyone can explain to me if cumulative incidence

> (CI) is just "1 minus kaplan-Meier survival"?

First tell us what you think CI is defined as. I suspect it is not the
same. The 

KM estimator is cumulative product of (alive-n(dead))/alive so is the
product of 

interval survival probabilities. I doubt that your definition of CI has
a similar denominator.


> Under what circumstance, you should use
> cumulative incidence vs KM survival? If the relationship is just CI =
> 1-survival, then what difference it makes to use one vs. the other?
> 
> And in R how I can draw a cumulative incidence plot.

plot(time, cumsum(dead)) ...?

> I know I can make a
> Kaplan-Meier survival plot using plot(survfit()), for example:
> 
> fit<-survfit(Surv(time,status)~group,data=data)
> plot(fit, col=1:2)
> 
> How to draw CI plot then?

As above. Specify what you are seeking.

There is a well-defined relationship between S(t) and the cumulative
hazard. 
Maybe you should do a little study of those terms in texts regarding
survival 
analysis.

> Thanks very much!
> 
> John
> [[alternative HTML version deleted]]

Isn't it time you learned to post in plain text?

--
David Winsemius, MD
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] how to print "<=" in plot title

2011-06-28 Thread Bert Gunter
For the record, I was wrong -- using plotmath's "less than or equal"
does NOT require platform info. However, I was unsure if you meant
that it was some kind of an arrow you wanted to render, a clear
misinterpretation on my part.

-- Bert

On Tue, Jun 28, 2011 at 10:57 AM, array chip  wrote:
> Thank Peter! How do I make the title in bold font?
>
> John
>
>
>
> - Original Message 
> From: Peter Ehlers 
> To: array chip 
> Cc: R 
> Sent: Tue, June 28, 2011 10:52:07 AM
> Subject: Re: [R] how to print "<=" in plot title
>
> On 2011-06-28 10:25, array chip wrote:
>> Hi, how can I print "<=" (I mean the symbol of just one character) in the 
>> main
>> title of a plot?
>>
>> for example:
>>
>> plot(1:10, main=paste("x<=", x))
>>
>> where variable x is some number generated on the fly.
>
>   x <- 2.718
>   plot(0, 0)
>   title(bquote( x %<=% .(x) ))
>
> ?plotmath
>
> Peter Ehlers
>
>>
>> Thanks
>>
>> John
>>
>> __
>> 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.
>



-- 
"Men by nature long to get on to the ultimate truths, and will often
be impatient with elementary studies or fight shy of them. If it were
possible to reach the ultimate truths without the elementary studies
usually prefixed to them, these would not be preparatory studies but
superfluous diversions."

-- Maimonides (1135-1204)

Bert Gunter
Genentech Nonclinical Biostatistics

__
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 print "<=" in plot title

2011-06-28 Thread David Winsemius


On Jun 28, 2011, at 1:52 PM, Peter Ehlers wrote:


On 2011-06-28 10:25, array chip wrote:
Hi, how can I print "<=" (I mean the symbol of just one character)  
in the main

title of a plot?

for example:

plot(1:10, main=paste("x<=", x))

where variable x is some number generated on the fly.


 x <- 2.718
 plot(0, 0)
 title(bquote( x %<=% .(x) ))


I think John wants the mathematical symbol. As was pointed out in a  
question last week, the `<=` plotmath symbol needs to be flanked by  
operands. Non-printing operands can be created with the phantom  
function:


title(main=expression(phantom("")<=phantom("")) )

Contrary to Gunters's comment, this is probably going to work on all  
the three major OS platforms. It depends only on whether there is a  
Symbol font mapped to the output device.


?plotmath


Yes. The details are there.



Peter Ehlers




David Winsemius, MD
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] testInstalledPackages

2011-06-28 Thread Cody Hamilton
Hello Duncan,

testci.R is a test function for the survival package.  I compared the .Rout and 
.Rout.save files by eyeball (I'm on a Windows 7 machine, so I can't use the 
diff function).  The only differences I found were in the file headers.

This is the header from the .Rout file:


R version 2.13.0 (2011-04-13)
Copyright (C) 2011 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i386-pc-mingw32/i386 (32-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.


Here is the header from the .Rout.save file:


R version 2.9.0 (2009-04-17)
Copyright (C) 2009 The R Foundation for Statistical Computing
ISBN 3-900051-07-0

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

As you can see, the header for the .Rout.save file is shorter resulting in a 
difference in length of three lines.  This appears to be nothing serious to 
worry about, but the the testInstalledPackages function will be run by our IT 
team (who has no experience with R) as part of the IQ testing, and I am worried 
that they may be concerned by the 'files differ in numbers of lines:' message.  
Is there anything I can do to avoid the message?

Regards,
   -Cody


--- On Tue, 6/28/11, Duncan Murdoch  wrote:

> From: Duncan Murdoch 
> Subject: Re: [R] testInstalledPackages
> To: "Cody Hamilton" 
> Cc: r-help@r-project.org
> Date: Tuesday, June 28, 2011, 1:01 AM
> On 27/06/2011 5:56 PM, Cody Hamilton
> wrote:
> > Dear group,
> >
> > When running the installation test:
> >
> > testInstalledPackages("both",outDir='c:/Test')
> >
> > I got the following message:
> >
> > Running ‘testci.R’
> > comparing ‘testci.Rout’ to ‘testci.Rout.save’
> ...
> > files differ in number of lines:
> >
> > Please note the test does not result in 'OK' as do the
> other tests.  Is this a concern?
> 
> Yes, you should look at the two files to determine why the
> length has 
> changed.
> 
> Duncan Murdoch
> 
> >
> > Regards,
> >     -Cody Hamilton
> >
> > __
> > 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 print "<=" in plot title

2011-06-28 Thread array chip
Thank Peter! How do I make the title in bold font?

John



- Original Message 
From: Peter Ehlers 
To: array chip 
Cc: R 
Sent: Tue, June 28, 2011 10:52:07 AM
Subject: Re: [R] how to print "<=" in plot title

On 2011-06-28 10:25, array chip wrote:
> Hi, how can I print "<=" (I mean the symbol of just one character) in the main
> title of a plot?
>
> for example:
>
> plot(1:10, main=paste("x<=", x))
>
> where variable x is some number generated on the fly.

   x <- 2.718
   plot(0, 0)
   title(bquote( x %<=% .(x) ))

?plotmath

Peter Ehlers

>
> Thanks
>
> John
>
> __
> 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 print "<=" in plot title

2011-06-28 Thread Peter Ehlers

On 2011-06-28 10:25, array chip wrote:

Hi, how can I print "<=" (I mean the symbol of just one character) in the main
title of a plot?

for example:

plot(1:10, main=paste("x<=", x))

where variable x is some number generated on the fly.


  x <- 2.718
  plot(0, 0)
  title(bquote( x %<=% .(x) ))

?plotmath

Peter Ehlers



Thanks

John

__
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 print "<=" in plot title

2011-06-28 Thread array chip
Thanks Bert. here is info:

R version 2.12.2 (2011-02-25)
Platform: i386-pc-mingw32/i386 (32-bit)

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United 
States.1252LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C   LC_TIME=English_United States.1252   
 


attached base packages:
[1] splines   stats graphics  grDevices datasets  utils methods   
base 


other attached packages:
[1] rms_3.3-0   Hmisc_3.8-3 cmprsk_2.2-2survival_2.36-5 
rcom_2.2-3.1rscproxy_1.3-1 


loaded via a namespace (and not attached):
[1] cluster_1.13.3  grid_2.12.2 lattice_0.19-17 tools_2.12.2 





- Original Message 
From: Bert Gunter 
To: array chip 
Cc: R 
Sent: Tue, June 28, 2011 10:32:29 AM
Subject: Re: [R] how to print "<=" in plot title

This is highly system dependent: what "character" do you intend to use
for this 2 character representation? Hence, you need to follow the
posting guide and give the "at a minimum" system info. ?sessionInfo

-- Bert

On Tue, Jun 28, 2011 at 10:25 AM, array chip  wrote:
> Hi, how can I print "<=" (I mean the symbol of just one character) in the main
> title of a plot?
>
> for example:
>
> plot(1:10, main=paste("x <=", x))
>
> where variable x is some number generated on the fly.
>
> Thanks
>
> John
>
> __
> 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.
>



-- 
"Men by nature long to get on to the ultimate truths, and will often
be impatient with elementary studies or fight shy of them. If it were
possible to reach the ultimate truths without the elementary studies
usually prefixed to them, these would not be preparatory studies but
superfluous diversions."

-- Maimonides (1135-1204)

Bert Gunter
Genentech Nonclinical Biostatistics

__
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] cumulative incidence plot vs survival plot

2011-06-28 Thread array chip
Alan,

Let's say that I code censoring as "0", recurrence as "1" for fstat and 
death/competing risk as "2". If a patient did not have recurrence and lost 
follow-up at 2 years in terms of recurrence monitoring, but he also died at 5 
years. How should I code this patient? I think I still code this patient as 0 
(censoring) because lost-of-followup occurred before death, am I correct?

Thanks very much!

John





- Original Message 
From: alanm (Alan Mitchell) 
To: array chip ; David Winsemius 

Cc: r-help@r-project.org
Sent: Tue, June 28, 2011 9:20:22 AM
Subject: RE: [R] cumulative incidence plot vs survival plot

John,

Since death precludes recurrence, censoring deaths would violate the KM
estimator assumption that additional follow-up would eventually lead to
an event.  If your goal is to estimate the probability of recurrence,
then you want CI with deaths as a competing risk.  The cuminc function
in the cmprsk package is a great place to start.  

Gooley has a great paper on the difference between CI and 1-KM (See
Statistics in Medicine, 18, 695-706 (1999)).  

HTH,

Alan Mitchell, MSc
Biostatistician
al...@crab.org

-Original Message-
From: array chip [mailto:arrayprof...@yahoo.com] 
Sent: Monday, June 27, 2011 2:04 PM
To: David Winsemius
Cc: r-help@r-project.org
Subject: Re: [R] cumulative incidence plot vs survival plot

Hi David,

Thanks for responding, and plain text ...(didn't realized I was in rich
text).

The endpoint is disease recurrence, I was producing a regular KM plot of
recurrence-free probability. Then someone recommend using cumulative
incidence is preferred because death was censored in the dataset. I did
a little googling, I found CI was used often in the context of competing
risk. I am totally new to competing risk and trying to understand what
competing risk means and why CI is preferred than KM survival in this
context. If you could share your thoughts helping me to understand,
greatly appreciated.

Searched archive, found people talking about cmprsk package for
estimating and plotting CI. would that be the same as the code you
suggested: plot(time,
cumsum(dead))

Thanks very much!

John





From: David Winsemius 

Cc: r-help@r-project.org
Sent: Mon, June 27, 2011 1:45:35 PM
Subject: Re: [R] cumulative incidence plot vs survival plot


On Jun 27, 2011, at 4:31 PM, array chip wrote:

> Hi, I am wondering if anyone can explain to me if cumulative incidence

> (CI) is just "1 minus kaplan-Meier survival"?

First tell us what you think CI is defined as. I suspect it is not the
same. The 

KM estimator is cumulative product of (alive-n(dead))/alive so is the
product of 

interval survival probabilities. I doubt that your definition of CI has
a similar denominator.


> Under what circumstance, you should use
> cumulative incidence vs KM survival? If the relationship is just CI =
> 1-survival, then what difference it makes to use one vs. the other?
> 
> And in R how I can draw a cumulative incidence plot.

plot(time, cumsum(dead)) ...?

> I know I can make a
> Kaplan-Meier survival plot using plot(survfit()), for example:
> 
> fit<-survfit(Surv(time,status)~group,data=data)
> plot(fit, col=1:2)
> 
> How to draw CI plot then?

As above. Specify what you are seeking.

There is a well-defined relationship between S(t) and the cumulative
hazard. 
Maybe you should do a little study of those terms in texts regarding
survival 
analysis.

> Thanks very much!
> 
> John
> [[alternative HTML version deleted]]

Isn't it time you learned to post in plain text?

--
David Winsemius, MD
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] extracting data

2011-06-28 Thread Peter Ehlers

On 2011-06-28 09:54, Ana Kolar wrote:

Hi Sarah,

Thank you for your response. Here is a toy example:


library(MatchIt)
data(lalonde)

A<-lalonde
f<-treat ~ age + I(age^2) + educ + I(educ^2) + black + hispan +
 married + nodegree + re74 + I(re74^2) + re75 + I(re75^2)
m<-"nearest"
m.out.base<- matchit(formula=f, data=A, method=m)

B<- match.data(m.out.base)

An<- nrow(A)
Bn<- nrow(B)

Cn<- An - Bn
C<- ??


Can't you just use

 idx <- setdiff(rownames(A), rownames(B))
 C <- A[idx, ]

Peter Ehlers








From: Sarah Goslee
To: Ana Kolar
Cc: R
Sent: Tuesday, 28 June 2011, 18:44
Subject: Re: [R] extracting data

Hi Ana,

On Tue, Jun 28, 2011 at 12:28 PM, Ana Kolar  wrote:

Let's say I have an original data set which is called A and data extracted from 
this original data set, called B. Based on these A and B data set I would like 
to get data set C which includes all the remaining data from the data set A 
after we exclude data of the data set B.

Any idea how to do this?


Yes. Several.

But to know which one to suggest, I need to know more about your data.

How about a toy example, so the list members can see your index
variables, etc? Or how you created the subset B, and why you can't
just use the opposite of that procedure?

Sarah
--
Sarah Goslee
http://www.functionaldiversity.org




[[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] how to print "<=" in plot title

2011-06-28 Thread Bert Gunter
This is highly system dependent: what "character" do you intend to use
for this 2 character representation? Hence, you need to follow the
posting guide and give the "at a minimum" system info. ?sessionInfo

-- Bert

On Tue, Jun 28, 2011 at 10:25 AM, array chip  wrote:
> Hi, how can I print "<=" (I mean the symbol of just one character) in the main
> title of a plot?
>
> for example:
>
> plot(1:10, main=paste("x <=", x))
>
> where variable x is some number generated on the fly.
>
> Thanks
>
> John
>
> __
> 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.
>



-- 
"Men by nature long to get on to the ultimate truths, and will often
be impatient with elementary studies or fight shy of them. If it were
possible to reach the ultimate truths without the elementary studies
usually prefixed to them, these would not be preparatory studies but
superfluous diversions."

-- Maimonides (1135-1204)

Bert Gunter
Genentech Nonclinical Biostatistics

__
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 print "<=" in plot title

2011-06-28 Thread array chip
Hi, how can I print "<=" (I mean the symbol of just one character) in the main 
title of a plot?

for example:

plot(1:10, main=paste("x <=", x))

where variable x is some number generated on the fly.

Thanks

John

__
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] Saved EPS does not match screen when using bquote(.(i))

2011-06-28 Thread John Kruschke
Many thanks to Uwe Ligges, Peter Ehlers, and Dennis Murphy for suggesting
work-arounds for this bug. Because the suggestions are work-arounds, rather
than actually correcting the bug, I have opted simply to copy and paste the
plotting commands a few times with the subscripts specified as constants
instead of as evaluated variables (and to use the easy and familiar savePlot
command for EPS output). For future cases that have more iterations through
a loop, I may resort to the suggested workarounds. Thanks again.

John K. Kruschke, Professor


On Thu, Jun 23, 2011 at 12:27 PM, Peter Ehlers  wrote:

>
> I think that there may be a problem with the way
> bquote(), for() and savePlot() play together in
> the OP's example (multiple plots on a windows device;
> bquote using the loop index).
>
> Here's a version using replayPlot():
>
> ## show mu with subscripts 4 and 9:
>  x11()
>  par(mfrow = c(2,1))
>  for (i in c(4, 9)) {
>plot(0, 0, main = bquote(mu[.(i)]))
>  }
>
> ## now record and replay:
>  z <- recordPlot()
>  replayPlot(z)
> ## both subscripts are now 9
>
>
> Simple workarounds are:
>
> 1. As Uwe and Dennis show, for saving to file,
> use the appropriate device.
>
> 2. For recalling plots (e.g. with recording turned on),
> a) use substitute() instead of bquote() or
> b) insert something like
>   i <- i
> before the plot() call.
>
> sessionInfo()
> R version 2.13.0 Patched (2011-05-24 r55981)
> Platform: i386-pc-mingw32/i386 (32-bit)
>
> locale:
> [1] LC_COLLATE=English_Canada.1252  LC_CTYPE=English_Canada.1252
> [3] LC_MONETARY=English_Canada.**1252 LC_NUMERIC=C
> [5] LC_TIME=English_Canada.1252
>
> attached base packages:
> [1] stats graphics  grDevices utils datasets  methods   base
>
> Peter Ehlers
>
>
>
> On 2011-06-22 22:14, Dennis Murphy wrote:
>
>> Hi:
>>
>> As Uwe suggested...
>>
>> pdf('testgraph.pdf')
>> layout( matrix( 1:2 , nrow=2 ) )
>> for ( i in 1:2 ) {
>>   plot( 0 , 0 , xlab=bquote(mu[.(i)]) )
>>  }
>> dev.off()
>>
>> postscript('testgraph.ps')
>> layout( matrix( 1:2 , nrow=2 ) )
>> for ( i in 1:2 ) {
>>   plot( 0 , 0 , xlab=bquote(mu[.(i)]) )
>>  }
>> dev.off()
>>
>> png('testgraph.png')
>> layout( matrix( 1:2 , nrow=2 ) )
>> for ( i in 1:2 ) {
>>   plot( 0 , 0 , xlab=bquote(mu[.(i)]) )
>>  }
>> dev.off()
>>
>> The three graphs look the same (although the PS graph is rotated to
>> landscape while the other two are portrait). The main point is that
>> mu_1 and mu_2 show up correctly in the two panels in all three graphs
>> (at least on my viewers).
>>
>> The following thread from last January describes some of the problems
>> that certain viewers have with Greek letters, which appear to be
>> viewer and platform dependent:
>>
>> http://r-project.markmail.org/**search/?q=pdf%20incorrect#**
>> query:pdf%20incorrect+page:2+**mid:egmb6utulrxgcznw+state:**results
>>
>> I'm guessing that I've seen about a half dozen or so similar posts in
>> this forum over the past year and a half, so you can check the list
>> archives for related problems.
>>
>> HTH,
>> Dennis
>>
>> On Wed, Jun 22, 2011 at 8:07 PM, John 
>> Kruschke>
>>  wrote:
>>
>>> Here's a fairly minimal-case example in which the saved EPS does not
>>> match
>>> the screen. The error comes when using bquote(.(i)) instead of bquote(1),
>>> as
>>> demonstrated by the two minimally different cases below. Very strange.
>>> Any
>>> clues as to why?
>>>
>>> # begin ---
>>>
>>> # Version A. X axis labels have subscripts as constants. EPS is correct.
>>> windows()
>>> layout( matrix( 1:2 , nrow=2 ) )
>>> plot( 0 , 0 , xlab=bquote(mu[1]) )
>>> plot( 0 , 0 , xlab=bquote(mu[2]) )
>>> savePlot( file="SavePlotTestA.eps" , type="eps" ) # Axis labels are
>>> correct
>>> in EPS.
>>>
>>> # Version B. X axis labels have subscripts as variable index. EPS is
>>> wrong!
>>> windows()
>>> layout( matrix( 1:2 , nrow=2 ) )
>>> for ( i in 1:2 ) {
>>>  plot( 0 , 0 , xlab=bquote(mu[.(i)]) )
>>> }
>>> savePlot( file="SavePlotTestB.eps" , type="eps" ) # X-AXIS OF PLOT 1 IS
>>> WRONG IN EPS.
>>>
>>> #-- end -
>>>
>>> Thanks!
>>>
>>> John K. Kruschke, Professor
>>> 
>>> >
>>>
>>>
>>> 2011/6/22 Uwe 
>>> Ligges
>>> >
>>>
>>>

 On 22.06.2011 13:50, John Kruschke wrote:

  The error happens when using the savePlot() command, like this:
> savePlot( file="TestSavePlot.eps" , type="eps" )
> savePlot( file="TestSavePlot.jpg" , type="jpg" )
>
>
 Well, plot directly into a device, for postscript:

 postscript("estSavePlot.eps", additionalArguments .)
 plot(1:10)
 dev.off()

 Uwe Ligges


  The images in the two saved files are not the same, with the JPG being

> corr

Re: [R] cumulative incidence plot vs survival plot

2011-06-28 Thread array chip
Thank you Alan! Now I sort of understand what it means by competing risk! So in 
cuminc() function, the argument "fstatus" should be coded like: 0=censored, 
1=event of interest, 2=event of competing risk. Then the function will 
calculate 
CI for each of the 2 types of events (event of interest and event of competing 
risk), am I correct?

What about running regular Cox regression for recurrence? any problem there? 
for 
example, need to take into competing risk as well or regular Cox regression is 
still fine?

Thanks!

John



- Original Message 
From: alanm (Alan Mitchell) 
To: array chip ; David Winsemius 

Cc: r-help@r-project.org
Sent: Tue, June 28, 2011 9:20:22 AM
Subject: RE: [R] cumulative incidence plot vs survival plot

John,

Since death precludes recurrence, censoring deaths would violate the KM
estimator assumption that additional follow-up would eventually lead to
an event.  If your goal is to estimate the probability of recurrence,
then you want CI with deaths as a competing risk.  The cuminc function
in the cmprsk package is a great place to start.  

Gooley has a great paper on the difference between CI and 1-KM (See
Statistics in Medicine, 18, 695-706 (1999)).  

HTH,

Alan Mitchell, MSc
Biostatistician
al...@crab.org

-Original Message-
From: array chip [mailto:arrayprof...@yahoo.com] 
Sent: Monday, June 27, 2011 2:04 PM
To: David Winsemius
Cc: r-help@r-project.org
Subject: Re: [R] cumulative incidence plot vs survival plot

Hi David,

Thanks for responding, and plain text ...(didn't realized I was in rich
text).

The endpoint is disease recurrence, I was producing a regular KM plot of
recurrence-free probability. Then someone recommend using cumulative
incidence is preferred because death was censored in the dataset. I did
a little googling, I found CI was used often in the context of competing
risk. I am totally new to competing risk and trying to understand what
competing risk means and why CI is preferred than KM survival in this
context. If you could share your thoughts helping me to understand,
greatly appreciated.

Searched archive, found people talking about cmprsk package for
estimating and plotting CI. would that be the same as the code you
suggested: plot(time,
cumsum(dead))

Thanks very much!

John





From: David Winsemius 

Cc: r-help@r-project.org
Sent: Mon, June 27, 2011 1:45:35 PM
Subject: Re: [R] cumulative incidence plot vs survival plot


On Jun 27, 2011, at 4:31 PM, array chip wrote:

> Hi, I am wondering if anyone can explain to me if cumulative incidence

> (CI) is just "1 minus kaplan-Meier survival"?

First tell us what you think CI is defined as. I suspect it is not the
same. The 

KM estimator is cumulative product of (alive-n(dead))/alive so is the
product of 

interval survival probabilities. I doubt that your definition of CI has
a similar denominator.


> Under what circumstance, you should use
> cumulative incidence vs KM survival? If the relationship is just CI =
> 1-survival, then what difference it makes to use one vs. the other?
> 
> And in R how I can draw a cumulative incidence plot.

plot(time, cumsum(dead)) ...?

> I know I can make a
> Kaplan-Meier survival plot using plot(survfit()), for example:
> 
> fit<-survfit(Surv(time,status)~group,data=data)
> plot(fit, col=1:2)
> 
> How to draw CI plot then?

As above. Specify what you are seeking.

There is a well-defined relationship between S(t) and the cumulative
hazard. 
Maybe you should do a little study of those terms in texts regarding
survival 
analysis.

> Thanks very much!
> 
> John
> [[alternative HTML version deleted]]

Isn't it time you learned to post in plain text?

--
David Winsemius, MD
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] extracting data

2011-06-28 Thread Ana Kolar
Hi Sarah,

Thank you for your response. Here is a toy example:


library(MatchIt)
data(lalonde)

A<-lalonde
f<-treat ~ age + I(age^2) + educ + I(educ^2) + black + hispan +
    married + nodegree + re74 + I(re74^2) + re75 + I(re75^2)
m<-"nearest"
m.out.base <- matchit(formula=f, data=A, method=m)

B <- match.data(m.out.base)

An <- nrow(A)
Bn <- nrow(B)

Cn <- An - Bn
C <- ??




>
>From: Sarah Goslee 
>To: Ana Kolar 
>Cc: R 
>Sent: Tuesday, 28 June 2011, 18:44
>Subject: Re: [R] extracting data
>
>Hi Ana,
>
>On Tue, Jun 28, 2011 at 12:28 PM, Ana Kolar  wrote:
>> Let's say I have an original data set which is called A and data extracted 
>> from this original data set, called B. Based on these A and B data set I 
>> would like to get data set C which includes all the remaining data from the 
>> data set A after we exclude data of the data set B.
>>
>> Any idea how to do this?
>
>Yes. Several.
>
>But to know which one to suggest, I need to know more about your data.
>
>How about a toy example, so the list members can see your index
>variables, etc? Or how you created the subset B, and why you can't
>just use the opposite of that procedure?
>
>Sarah
>-- 
>Sarah Goslee
>http://www.functionaldiversity.org
>
>
>
[[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] extracting data

2011-06-28 Thread Sarah Goslee
Hi Ana,

On Tue, Jun 28, 2011 at 12:28 PM, Ana Kolar  wrote:
> Let's say I have an original data set which is called A and data extracted 
> from this original data set, called B. Based on these A and B data set I 
> would like to get data set C which includes all the remaining data from the 
> data set A after we exclude data of the data set B.
>
> Any idea how to do this?

Yes. Several.

But to know which one to suggest, I need to know more about your data.

How about a toy example, so the list members can see your index
variables, etc? Or how you created the subset B, and why you can't
just use the opposite of that procedure?

Sarah
-- 
Sarah Goslee
http://www.functionaldiversity.org

__
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] extracting data

2011-06-28 Thread Ana Kolar
Let's say I have an original data set which is called A and data extracted from 
this original data set, called B. Based on these A and B data set I would like 
to get data set C which includes all the remaining data from the data set A 
after we exclude data of the data set B.

Any idea how to do this?
[[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] How do I output all the R-squares of an SUR? summary(fitSUR$eq[[1:4]])$r.squared does not work

2011-06-28 Thread Achim Zeileis

On Tue, 28 Jun 2011, StellathePug wrote:


Greetings R Users,
I have a system of equations for which I would like to output all the
R-squares. Assume there are four equations in my system, the only way I
found to output all the R-squares is by calling them out one by one as this:

summary(fitSUR$eq[[1]])$r.squared
summary(fitSUR$eq[[2]])$r.squared
summary(fitSUR$eq[[3]])$r.squared
summary(fitSUR$eq[[4]])$r.squared


You can abbreviate that to:

  sapply(fitSUR$eq, function(x) summary(x)$r.squared)

Instead of calling summary(fitSUR$eq[[1]]), you can also look at 
summary(fitSUR)$eq[[1]] which leads to identical output. Hence you could 
also do


  sapply(summary(fitSUR)$eq, "[[", "r.squared")

depending on which you find more intuitive.

hth,
Z


But isn't there a way of making this automatic, for example, something more
along the way of

summary(fitSUR$eq[[1:4]])$r.squared ?

The above does not work, by the way.

I have attached below my sample program. Thanks!
Rita


 SAMPLE PROGRAM 

YX<-as.data.frame(matrix(rnorm(280),ncol=14, nrow=20))   ##
generate variables
names(YX) <-c(paste("Y", 1:4, sep=""), paste("X", 1:10, sep="")) ##
assign variables' names

library(systemfit)

## EQUATIONS:
EQ1 <- Y1 ~ X1 + X2 + X4 + X7 + X10  ## equation 1 formula
EQ2 <- Y2 ~ X2 + X3 + X5 + X8 + X10  ## equation 2 formula
EQ3 <- Y3 ~ X5 + X6 + X7 + X9## equation 3 formula
EQ4 <- Y4 ~ X1 + X3 + X4 + X6 + X9   ## equation 4 formula

eqSystem <-list(form1 = EQ1, form2 = EQ2, form3 = EQ3, form4 = EQ4)

fitSUR <- systemfit(eqSystem, method ="SUR", data=YX)


## How do I out put all the R-squares of the system without having to type a
single line for each?

summary(fitSUR$eq[[1]])$r.squared
summary(fitSUR$eq[[2]])$r.squared
summary(fitSUR$eq[[3]])$r.squared
summary(fitSUR$eq[[4]])$r.squared

summary(fitSUR$eq[[1]])$adj.r.squared
summary(fitSUR$eq[[2]])$adj.r.squared
summary(fitSUR$eq[[3]])$adj.r.squared
summary(fitSUR$eq[[4]])$adj.r.squared

--
View this message in context: 
http://r.789695.n4.nabble.com/How-do-I-output-all-the-R-squares-of-an-SUR-summary-fitSUR-eq-1-4-r-squared-does-not-work-tp3630601p3630601.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.



__
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 do I output all the R-squares of an SUR? summary(fitSUR$eq[[1:4]])$r.squared does not work

2011-06-28 Thread StellathePug
Greetings R Users,
I have a system of equations for which I would like to output all the
R-squares. Assume there are four equations in my system, the only way I
found to output all the R-squares is by calling them out one by one as this:

summary(fitSUR$eq[[1]])$r.squared
summary(fitSUR$eq[[2]])$r.squared
summary(fitSUR$eq[[3]])$r.squared
summary(fitSUR$eq[[4]])$r.squared

But isn't there a way of making this automatic, for example, something more
along the way of 

summary(fitSUR$eq[[1:4]])$r.squared ?

The above does not work, by the way.

I have attached below my sample program. Thanks!
Rita


 SAMPLE PROGRAM 

YX<-as.data.frame(matrix(rnorm(280),ncol=14, nrow=20))   ##
generate variables
names(YX) <-c(paste("Y", 1:4, sep=""), paste("X", 1:10, sep="")) ##
assign variables' names

library(systemfit)

## EQUATIONS:
EQ1 <- Y1 ~ X1 + X2 + X4 + X7 + X10  ## equation 1 formula
EQ2 <- Y2 ~ X2 + X3 + X5 + X8 + X10  ## equation 2 formula
EQ3 <- Y3 ~ X5 + X6 + X7 + X9## equation 3 formula
EQ4 <- Y4 ~ X1 + X3 + X4 + X6 + X9   ## equation 4 formula

eqSystem <-list(form1 = EQ1, form2 = EQ2, form3 = EQ3, form4 = EQ4)

fitSUR <- systemfit(eqSystem, method ="SUR", data=YX)


## How do I out put all the R-squares of the system without having to type a
single line for each?

summary(fitSUR$eq[[1]])$r.squared
summary(fitSUR$eq[[2]])$r.squared
summary(fitSUR$eq[[3]])$r.squared
summary(fitSUR$eq[[4]])$r.squared

summary(fitSUR$eq[[1]])$adj.r.squared
summary(fitSUR$eq[[2]])$adj.r.squared
summary(fitSUR$eq[[3]])$adj.r.squared
summary(fitSUR$eq[[4]])$adj.r.squared

--
View this message in context: 
http://r.789695.n4.nabble.com/How-do-I-output-all-the-R-squares-of-an-SUR-summary-fitSUR-eq-1-4-r-squared-does-not-work-tp3630601p3630601.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] Running R from windows command prompt

2011-06-28 Thread Robert Baer

Subject: Re: [R] Running R from windows command prompt

Hi Siddharth, many experts already answered your query, however I
would like to share how I run R in command prompt:

1. open command prompt
2. change working directory: cd C:\\R-2.13.0\bin\i386
(put the entire path here, however many people might find this step
weird, you can have better management setting window's path variable
appropriately)
3. type R.exe

You can use R within command prompt with same efficiency. However most
awkward thing I find in this process is you can never copy-paste any
code. So everything you need to type there manually!
---
Actually, you can 'cut and paste' from at Windows Cmd prompt.  It is done by 
clicking the
C: icon in the upper left of the command window, choosing edit, and 'copy' 
or 'paste'

as desired.

Rob

HTH
_

Arun Kumar Saha, FRM
QUANTITATIVE RISK AND HEDGE CONSULTING SPECIALIST
Visit me at: http://in.linkedin.com/in/ArunFRM

__
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 masked function is a masked function by any other name

2011-06-28 Thread Juan Carlos Borrás
Ops!
Thank-you Duncan for clarifying the 2 vs. 3 colon difference and a
couple of other things.
Working like a charm now.
Cheers,
jcb!

> If you are using ::: (three colons), then you may be looking into the
> unexported functions in log4r.  The only normal way to see unexported
> functions is to use three colons.
>
> Duncan Murdoch
>

__
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] Running R from windows command prompt

2011-06-28 Thread Arun Kumar Saha
Hi Siddharth, many experts already answered your query, however I
would like to share how I run R in command prompt:

1. open command prompt
2. change working directory: cd C:\\R-2.13.0\bin\i386
(put the entire path here, however many people might find this step
weird, you can have better management setting window's path variable
appropriately)
3. type R.exe

You can use R within command prompt with same efficiency. However most
awkward thing I find in this process is you can never copy-paste any
code. So everything you need to type there manually!

HTH
_

Arun Kumar Saha, FRM
QUANTITATIVE RISK AND HEDGE CONSULTING SPECIALIST
Visit me at: http://in.linkedin.com/in/ArunFRM

__
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] coxph() - unexpected result using Crawley's seedlings data (The R Book)

2011-06-28 Thread Jacob Brogren
All,

I rerun once again and managed to reproduce the results from the text book. 
Made no changes to the code. Could it be some problem with convergence?

Anyhow, now it works!

Cheers

Jacob

ps. I find "The R Book" very useful ds.

28 jun 2011 kl. 15.48 skrev Robert A LaBudde:

> Did you create the 'status' variable the way indicated on p. 797?
> 
> Frequently with Surv() it pays to use syntax such as Surv(death, status==1) 
> to make a clear logical statement of what is an event (status==1) vs. 
> censored.
> 
> PS. Next time include head(seedlings) and str(seedlings) to make clear what 
> you are using as data.
> 
> 
> At 06:51 AM 6/28/2011, Jacob Brogren wrote:
>> Hi,
>> 
>> I ran the example on pp. 799-800 from Machael Crawley's "The R Book" using 
>> package survival v. 2.36-5, R 2.13.0 and RStudio 0.94.83. The model is a 
>> Cox's Proportional Hazards model. The result was quite different compared to 
>> the R Book. I have compared my code to the code in the book but can not find 
>> any differences in the function call. My results are attached as well as a 
>> link to the results presented in the book (link to Google Books).
>> 
>> When running the examples on pp. 797-799 I can't detect any differences in 
>> results so I don't think there are errors in the data set or in the creation 
>> of the status variable.
>> 
>> -
>> Original from the R Book:
>> http://books.google.com/books?id=8D4HVx0apZQC&lpg=PA799&ots=rQgd_8ofeS&dq=r%20coxph%20crawley&pg=PA799#v=onepage&q&f=false
>> 
>> -
>> My result:
>> > summary(model1)
>> Call:
>> coxph(formula = Surv(death, status) ~ strata(cohort) * gapsize,
>>data = seedlings)
>> 
>>  n= 60, number of events= 60
>> 
>>coef exp(coef)  se(coef)  z 
>> Pr(>|z|)
>> gapsize-0.001893  0.998109  0.593372 -0.003  
>>   0.997
>> gapsize:strata(cohort)cohort=September  0.717407  2.049112  0.860807  0.833  
>>   0.405
>> 
>>   exp(coef) exp(-coef) lower .95 upper 
>> .95
>> gapsize   0.9981  1.002 0.3120 3.193
>> gapsize:strata(cohort)cohort=September2.0491  0.488 0.379211.074
>> 
>> Rsquare= 0.022   (max possible= 0.993 )
>> Likelihood ratio test= 1.35  on 2 df,   p=0.5097
>> Wald test= 1.32  on 2 df,   p=0.5178
>> Score (logrank) test = 1.33  on 2 df,   p=0.514
>> 
>> Anyone have an idea why this is occurring?
>> 
>> Kind Regards
>> 
>> Jacob
>> __
>> 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.
> 
> 
> Robert A. LaBudde, PhD, PAS, Dpl. ACAFS  e-mail: r...@lcfltd.com
> Least Cost Formulations, Ltd.URL: http://lcfltd.com/
> 824 Timberlake Drive Tel: 757-467-0954
> Virginia Beach, VA 23464-3239Fax: 757-467-2947
> 
> "Vere scire est per causas scire"
> 
> 

__
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 with corrgram function

2011-06-28 Thread Eik Vettorazzi
yes it is.
and a correlation of 0 isn't exactly white (#FF) either.
have a look at the panel.pie function.

the crucial part is

ncol <- 14
pal <- col.corrgram(ncol)
col.ind <- round(ncol * (corr + 1)/2)

so an correlation near -1 maps to an index 0, which isn't a proper index
in R.
Alter these lines to
 ncol <- 15 #so 0 becomes "#FF"
 pal <- col.corrgram(ncol)
 col.ind <- round((ncol-1) * (corr + 1)/2)+1

hth.


Am 28.06.2011 13:11, schrieb Niels Janssen:
> Dear list,
> 
> I have a problem with the "corrgram" function. It does not seem to
> "color" large negative correlations, while the same correlation, if
> positive, provides no problems. Is this a bug?
> 
> require(corrgram)   
> a = seq(1,100)
> b = -jitter(seq(1,100), 80)
> cor(a,b) # r about -.96
> c=as.data.frame(cbind(a,b))
> corrgram(c, order=NULL, lower.panel=panel.pie,upper.panel=NULL,
> text.panel=panel.txt) # no color
> 
> c$b = -1*c$b # flip direction of correlation
> cor(c$a, c$b) # r now about +.96
> corrgram(c, order=NULL, lower.panel=panel.pie,upper.panel=NULL,
> text.panel=panel.txt) #no problem with color.
> 
> Thanks!
> 
> __
> 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.

-- 
Eik Vettorazzi

Department of Medical Biometry and Epidemiology
University Medical Center Hamburg-Eppendorf

Martinistr. 52
20246 Hamburg

T ++49/40/7410-58243
F ++49/40/7410-57790

__
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] What does class "call" mean? How do I make class "formula" into a "call"?

2011-06-28 Thread Rita Carreira


Thank you Bert and Prof. Ripley for your feedback. I did read the language 
documentation and it was not entirely clear to me, but I'm one of those people 
that has to read and digest something before it clicks. However, I did realize 
that the issue with "call"and "formula" was not the real reason why my program 
did not work. The real reason was much more trivial: I put the arguments inside 
the systemfit function out of order. Eventually, I figured it out. The good 
thing about this is that I learned about the existence of the R language 
documentation. 
Thank you again both!
Rita
=
"If you think education is expensive, try ignorance."--Derek Bok



> Date: Sat, 25 Jun 2011 05:59:40 +0100
> From: rip...@stats.ox.ac.uk
> To: gunter.ber...@gene.com
> CC: ritacarre...@hotmail.com
> Subject: Re: [R] What does class "call" mean? How do I make class "formula" 
> into a "call"?
>
> This is really a misleading subject: it is already a call! From
> ?class
>
> Many R objects have a ‘class’ attribute, a character vector giving
> the names of the classes from which the object _inherits_. If the
> object does not have a class attribute, it has an implicit class,
> ‘"matrix"’, ‘"array"’ or the result of ‘mode(x)’ (except that
> integer vectors have implicit class ‘"integer"’).
>
> So, simply remove the class if you want the mode: but anything which
> needs to know this is call will be looking at the mode and not the
> class.
>
> > zz <- ~x
> > class(zz)
> [1] "formula"
> > mode(zz)
> [1] "call"
>
> And see ?mode and ?call. Formulae and calls which are not formulae
> are completely different: you cannot coerce one to the other.
>
>
> On Fri, 24 Jun 2011, Bert Gunter wrote:
>
> > Well, this is kind of complicated. The first place you should go for
> > help is not this list, but the R docs. Specfically ?call. This
> > assumes familiarity with R's (S3) class system and language structure,
> > however.. For this, I suggest ?UseMethod and consulting the R Language
> > Definition Manual.
> >
> > Perhaps some brave soul on this list will attempt a short explanation
> > in reply. But I am not (s)he.
> >
> > Cheers,
> > Bert
> >
> > Oh -- as for specific suggestions, I think you need to do what the
> > posting guide asks and provide a minimal reproducible example to give
> > people a clearer idea of what's going on.
> >
> > On Fri, Jun 24, 2011 at 2:58 PM, Rita Carreira  
> > wrote:
> >>
> >> I have a list called "tabs" that I would like to have the same
> >> structure as my list "eqSystem." The two look like they have the
> >> same format but they are different because when I look at their
> >> attributes, class(eqSystem[[1]]) is "call" but class(tabs[[1]]) is
> >> "formula". I want to have class(tabs[[1]]) as a call too. So what
> >> does "call" mean? And how do I make an object of type "formula" be
> >> of type "call"?
> >> Thank you so much!!!--Rita
> >>> class(tabs)
> >> [1] "list"
> >>> class(tabs[1])
> >> [1] "list"
> >>> class(tabs[[1]])
> >> [1] "formula"> class(eqSystem)
> >> [1] "list"
> >>> class(eqSystem[1])
> >> [1] "list"
> >>> class(eqSystem[[1]])
> >> [1] "call"
> >>
> >>
> >> Rita
> >> =
> >> "If you think education is expensive, try ignorance."--Derek Bok
> >>
> >> __
> >> 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.
> >>
> >
> >
> >
> > --
> > "Men by nature long to get on to the ultimate truths, and will often
> > be impatient with elementary studies or fight shy of them. If it were
> > possible to reach the ultimate truths without the elementary studies
> > usually prefixed to them, these would not be preparatory studies but
> > superfluous diversions."
> >
> > -- Maimonides (1135-1204)
> >
> > Bert Gunter
> > Genentech Nonclinical Biostatistics
> >
> > __
> > 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.
> >
>
> --
> 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, UK Fax: +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.


  1   2   >