[R] How to extract folowing data?

2008-07-14 Thread Megh Dal
Hi, 
following data is taken from 
http://www.economagic.com/em-cgi/data.exe/var/west-texas-crude-long. Problem 
with this data is when you copy it from this site you would get something like 
that :

 1946 063331.27
 1946 079991.27
 1946 087771.52
 1946 096661.52

They should be interpret in following way :

1946 063331.27 this means : on 1946, June price was 1.27. Can anyone please 
suggest me the easiest way with R to get extracted the entire series?

Regards,

__
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] Off topic: Tcl/Tk outside R.

2008-07-14 Thread Peter Dalgaard

Rolf Turner wrote:


I'm trying to learn about the tcltk package and its uses.  Floundering
around a bit ... Have discovered Peter Dalgaard's articles in R-News,
which should help.  Also James Wettenhall's suite of examples look like
they might be enlightening, even though the indications are that they are
Windoze oriented.

Be that as it were, I decided to fool around a bit with Tcl/Tk *outside*
of R to see if I could get the hang of just what Tcl/Tk actually is.
(As I said I am floundering; I can't seem to get a conceptual grip on
what it's all about.)  I discovered a Tcl/Tk ``Cookbook'' by Sastry
and Sastry that looked promising.  URL:

http://www.dci.clrc.ac.uk/Publications/Cookbook/

Tried the first couple of (ultra-simple) examples and they seemed to 
work.

(Amazing, for me.)

Then I tried the example on creating an executable file for invoking
the Tcl/Tk commands.  The instructions said to create a file
``button.tcl'' with a first line

#!/usr/bin/wish

and succeeding lines

button .b -text "Press Me" -command exit
pack .b

I did this, did a chmod to make the file executable, and then typed

button.tcl

at the command line prompt.  I got the error messages

tcsh: button: Command not found.
tcsh: pack: Command not found.

So the code at the beginning of the script telling the machine
to use the ``wi'' shell (rather than tcsh) is being ignored.
Why?

The Tcl/Tk executables really are in /usr/bin.

If I invoke ``wish'' interactively, and then type in the ``succeeding 
lines''
interactively the ``Press Me'' button pops up as it should.  (And goes 
away

when I click on it.)

Also if I type ``wish button.tcl'' then it seems to work; i.e. the button
pops up and goes away when clicked.

Can anyone give me a hint as to why it doesn't work when the the 
executable

script is invoked directly (from tcsh)?  Other than the fact that I'm
using a Mac :-) .

[Invoking unname -a gives ``Darwin TURNER-ROLF.local 8.11.1 Darwin Kernel
Version 8.11.1: Wed Oct 10 18:23:28 PDT 2007; 
root:xnu-792.25.20~1/RELEASE_I386 i386 i386''.]


The Tcl/Tk software, from what I can glean, appears to be version 8.4 
(???).


Thanks for any insights.
Odd... That _does_ actually work for me, so I guess the issue is 
Mac-specific. One thought:
Tcl is like R;  a core language where you load packages in order to do 
any real work and wish is just Tcl with the Tk package preloaded. I.e., 
the following also works for me


$ cat rolf.wish
#!/usr/bin/tclsh
package require Tk
button .b -text "Press Me" -command exit
pack .b

--
  O__   Peter Dalgaard Øster Farimagsgade 5, Entr.B
 c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K
(*) \(*) -- University of Copenhagen   Denmark  Ph:  (+45) 35327918
~~ - ([EMAIL PROTECTED])  FAX: (+45) 35327907

__
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] false discovery rate !

2008-07-14 Thread john seers (IFR)
 

Hi Ezhil

Quite possibly. 

Look at this simple example based on what you describe:

> p.adjust(c(0.0002, 0.41, 0.4, 0.42,0.43))
[1] 0.001 1.000 1.000 1.000 1.000
 
Does this fit what you are seeing?

Regards


JS


---
Web sites:

www.ifr.ac.uk   
www.foodandhealthnetwork.com

-Original Message-
From: A Ezhil [mailto:[EMAIL PROTECTED] 
Sent: 10 July 2008 16:23
To: r-help@r-project.org; john seers (IFR)
Subject: RE: [R] false discovery rate !

Dear John,

My P values are not same and the smallest P value = 0.0002. My P value
distribution is not that great (see the attached file), most of them are
> 0.4. Do you think this is the reason for getting same FDR vlaues?

Thanks again,
Ezhil 


--- On Thu, 7/10/08, john seers (IFR) <[EMAIL PROTECTED]> wrote:

> From: john seers (IFR) <[EMAIL PROTECTED]>
> Subject: RE: [R] false discovery rate !
> To: [EMAIL PROTECTED], r-help@r-project.org
> Date: Thursday, July 10, 2008, 8:27 PM Hi
> 
> Are all your input p values the same? If so your output FDR values 
> would be the same.
> 
> Or are all your p-values relatively large? Then (nearly) all your FDR 
> values might be 1.
> 
> Why don't you put a small example up of what you did?
> Then we could see
> what method you used etc.
> 
> Regards
> 
> 
> JS
> 
> 
> 
>  
> ---
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]
> On Behalf Of A Ezhil
> Sent: 10 July 2008 15:41
> To: r-help@r-project.org
> Subject: [R] false discovery rate !
> 
> Dear All,
> 
> It is not a typical R question (though I use R for this) but I thought

> someone will help me. For the list of P values, I have calculated FDR 
> using p.adjust() in R (bioconductor). But my FDR values are same for 
> all the P values. When do we get same FDR values? Does the smallest P 
> values should less than 1/N? (where N is the number of P values)
> 
> Thanks in advance.
> 
> Kind regards,
> Ezhil
> 
> __
> 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] source code for R-dev packages

2008-07-14 Thread Prof Brian Ripley

On Mon, 14 Jul 2008, Mark Kimpel wrote:


Where is the link on www.r-project.org or CRAN to download source code for
development versions of packages? This is straightforward for BioConductor
packages but I can't seem to find it for R packages.


It is a Bioconductor concept.  It conflates two ideas -- versions of 
packages for the development version of R, and development versions of 
packages (possibly for current R).  Many package authors do not make 
public their development work, but some can be found on the R-packages SVN 
repository and on the Rforges.


Most CRAN packages run under the R-devel 
version of R.  For those that do not and need incompatible changes have 
versions in, e.g., 2.8.0/Other (currently empty).


As far as I am aware, all CRAN packages that fail under R-devel 
(see the on-line 'daily' checks) are failing because of stricter error 
checking which has revealed bugs present also under 2.7.x.




Mark

--
Mark W. Kimpel MD ** Neuroinformatics ** Dept. of Psychiatry
Indiana University School of Medicine

15032 Hunter Court, Westfield, IN 46074

(317) 490-5129 Work, & Mobile & VoiceMail
(317) 663-0513 Home (no voice mail please)

**

[[alternative HTML version deleted]]


PLEASE: how many years do you need to post before reading what the posting 
guide says about this?




__
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,  [EMAIL PROTECTED]
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.


[R] Question regarding lmer vs glmmPQL vs glmm.admb model on a negative binomial distributed dependent variable

2008-07-14 Thread eugen pircalabelu
Hi R-users,
 
I intend to apply a mixed model on a set of longitudinal data, with a negative 
binomial distributed dependent variable, and after following the discussions on 
R help list I saw that more experienced people recommended using lmer (from 
lme4 pack), glmmPQL (from MASS) or glmm.admb (from glmmADMB pack)  
 
My first problem: yesterday this syntax was ok, now I get this weird message (I 
got it before when I was using my own set of data)
 
>    data(epil2)
>    
>glmm.admb(y~Base*trt+Age+Visit,random=~Visit,group="subject",data=epil2,family="nbinom")
'C:/Documents' is not recognized as an internal or external command,
operable program or batch file.
Error in glmm.admb(y ~ Base * trt + Age + Visit, random = ~Visit, group = 
"subject",  : 
  The function maximizer failed
In addition: Warning messages:
1: In file.remove(std_file) :
  cannot remove file 'nbmm.std', reason 'No such file or directory'
2: In shell(paste(.path.package("glmmADMB"), "/admb/", file_name, ".exe",  :
  'C:/Documents and Settings/eugen.pircalabelu/My 
Documents/R/win-library/2.7/glmmADMB/admb/nbmm.exe -maxfn 500 ' execution 
failed with error code 1
 
Second problem: when running these two commands on the data set epil2 from 
glmmADMB package, I get very different results (I see that lmer gives SE twice 
as big as those returned glmmPQL) and I was wondering which algorithm is best 
suited for a highly skewed dependent variable (running these two commands on my 
data set the diffrence in SE estimation still remains, and I want to use a 
correct algorithm for my data set) .
 
Thank you very much and have a great day ahead!   
 
Eugen Pircalabelu


  
[[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] Installing RWinEdt

2008-07-14 Thread Uwe Ligges



[EMAIL PROTECTED] wrote:

I checked and reapplied full access to the whole WinEdt directory. I am not the 
administrator but I am a member of the administrators group. This couple with 
the fact the I have given full control to the WinEdt directory suggests that 
the problem is elsewhere. But this is not the first time that I have run into 
permission problems with Windows 2008 server.


You need to right-click R and explicitly say to start is with 
Administrator privileges.


Uwe



Kevin

 Uwe Ligges <[EMAIL PROTECTED]> wrote: 


[EMAIL PROTECTED] wrote:

>From the R console I invoke:

install.packages("RWinEdt")

and get:

Warning in install.packages("RWinEdt") :
  argument 'lib' is missing: using 'F:\Users\Kevin\Documents/R/win-library/2.7'
--- Please select a CRAN mirror for use in this session ---
trying URL 
'http://streaming.stat.iastate.edu/CRAN/bin/windows/contrib/2.7/RWinEdt_1.8-0.zip'
Content type 'application/zip' length 361598 bytes (353 Kb)
opened URL
downloaded 353 Kb

package 'RWinEdt' successfully unpacked and MD5 sums checked

The downloaded packages are in
F:\Users\Kevin\AppData\Local\Temp\RtmpOIlW0F\downloaded_packages
updating HTML package descriptions

So it seems to have worked. But when I use the 'library' command I get:


library("RWinEdt")

Error in file(file, "r") : cannot open the connection
In addition: Warning message:
In file(file, "r") :
  cannot open file 'F:\Program Files (x86)\WinEdt Team\WinEdt\R.ver': No such 
file or directory
Error : .onAttach failed in 'attachNamespace'
Error: package/namespace load failed for 'RWinEdt'

Any ideas on how I can install this package?
With administrator privileges, since it needs to write some files into 
the WinEdt directory.


Best wishes,
Uwe Ligges



Thank you.

Kevin

__
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] Using Internals via their compiled sources

2008-07-14 Thread rnoob

Hello,
I wish to use the compiled version of a particular function( mean(x) to be
exact ) and I can't use the source files as I am told by my boss I am to
assume that users will not have the source files available to them. So this
is my question: how do I find out which lib which particular source file is
placed into? I have tried
R.dll,Rblas.dll,Rlapack.dll,stats.dll,methods.dll,Rzlib.dll and a host of
others. I tried using "rcmd shlib myfile.c .dll" but I still get
file not found errors.

If it helps mean(x) is found in names.c which leads to do_summary which
leads to summary.c and all of these require various .h files.


Thanks,
TJ
-- 
View this message in context: 
http://www.nabble.com/Using-Internals-via-their-compiled-sources-tp18437781p18437781.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] Loop problem

2008-07-14 Thread fernanda lopez
Dear all,
 I want to
write   ck<-cbind(rep(pk[1,1],4),rep(pk[1,2],4),rep(pk[1,3],4))   state ment
in a loop . How can I write it ?





> pk
   [,1]  [,2]   [,3]
[1,] -1.1354816 0.9808877 -0.9446314
[2,]  0.7787378 0.4536944  0.3204882
[3,] -1.7274907 1.5112011  1.4481839
[4,]  1.0629145 0.5976109 -0.5277638



> pk<-matrix(rnorm(12),nrow=4,ncol=3)
> pk
   [,1]  [,2]   [,3]
[1,] -1.1354816 0.9808877 -0.9446314
[2,]  0.7787378 0.4536944  0.3204882
[3,] -1.7274907 1.5112011  1.4481839
[4,]  1.0629145 0.5976109 -0.5277638

> ck<-cbind(rep(pk[1,1],4),rep(pk[1,2],4),rep(pk[1,3],4))
> ck
  [,1]  [,2]   [,3]
[1,] -1.135482 0.9808877 -0.9446314
[2,] -1.135482 0.9808877 -0.9446314
[3,] -1.135482 0.9808877 -0.9446314
[4,] -1.135482 0.9808877 -0.9446314


Thanks for your help

Fernanda Lopez
Netherlands

[[alternative HTML version deleted]]

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


[R] rm(l*)

2008-07-14 Thread Oehler, Friderike (AGPP)
Dear Rusers,

how can I designate various objects the names of which start (or end) with
the same letter to remove them all together?

For instance:
> ls()
"a","b","c","l1","l2","x"
> rm(list=ls("l*"))
> ls()
"a","b","c",""x"

Is there some parallel to the MySQL query: where col1 like "l%"

Thanks a lot in advance,
Friderike


[[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] Loop problem

2008-07-14 Thread Dimitris Rizopoulos

try this:

pk <- matrix(rnorm(12), 4, 3)
matrix(rep(pk[1, ], each = 4), 4)


I hope it helps.

Best,
Dimitris


Dimitris Rizopoulos
Biostatistical Centre
School of Public Health
Catholic University of Leuven

Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/(0)16/336899
Fax: +32/(0)16/337015
Web: http://med.kuleuven.be/biostat/
http://www.student.kuleuven.be/~m0390867/dimitris.htm


- Original Message - 
From: "fernanda lopez" <[EMAIL PROTECTED]>

To: <[EMAIL PROTECTED]>
Sent: Monday, July 14, 2008 10:33 AM
Subject: [R] Loop problem



Dear all,
I want to
write   ck<-cbind(rep(pk[1,1],4),rep(pk[1,2],4),rep(pk[1,3],4)) 
state ment

in a loop . How can I write it ?






pk

  [,1]  [,2]   [,3]
[1,] -1.1354816 0.9808877 -0.9446314
[2,]  0.7787378 0.4536944  0.3204882
[3,] -1.7274907 1.5112011  1.4481839
[4,]  1.0629145 0.5976109 -0.5277638




pk<-matrix(rnorm(12),nrow=4,ncol=3)
pk

  [,1]  [,2]   [,3]
[1,] -1.1354816 0.9808877 -0.9446314
[2,]  0.7787378 0.4536944  0.3204882
[3,] -1.7274907 1.5112011  1.4481839
[4,]  1.0629145 0.5976109 -0.5277638


ck<-cbind(rep(pk[1,1],4),rep(pk[1,2],4),rep(pk[1,3],4))
ck

 [,1]  [,2]   [,3]
[1,] -1.135482 0.9808877 -0.9446314
[2,] -1.135482 0.9808877 -0.9446314
[3,] -1.135482 0.9808877 -0.9446314
[4,] -1.135482 0.9808877 -0.9446314


Thanks for your help

Fernanda Lopez
Netherlands

[[alternative HTML version deleted]]

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

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




Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm

__
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] rm(l*)

2008-07-14 Thread Gabor Csardi
Maybe there is a simpler way, but this works fine:

> l1 <- 1
> l2 <-2
> m <-10
> ls()
[1] "l1" "l2" "m" 
> rm(list=grep("^l.*", ls(), value=TRUE))
> ls()
[1] "m"
> 

You can supply a regular expression to grep.

Gabor

On Mon, Jul 14, 2008 at 10:45:13AM +0200, Oehler, Friderike (AGPP) wrote:
> Dear Rusers,
> 
> how can I designate various objects the names of which start (or end) with
> the same letter to remove them all together?
> 
> For instance:
> > ls()
> "a","b","c","l1","l2","x"
> > rm(list=ls("l*"))
> > ls()
> "a","b","c",""x"
> 
> Is there some parallel to the MySQL query: where col1 like "l%"
> 
> Thanks a lot in advance,
> Friderike
> 
> 
>   [[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.

-- 
Csardi Gabor <[EMAIL PROTECTED]>UNIL DGM

__
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] Strptime/ date time classes

2008-07-14 Thread Caroline Keef

is.na(strptime("19810329012000",format="%Y%m%d%H%M%S"))
[1] TRUE

The problem was to do with daylight saving time.  I need to specify a time zone 
as this time doesn't exist in my operating system's current time zone.  I still 
think this is odd behaviour though!  When you look at the missing object it 
doesn't look missing at all.  

Caroline

_
Find the best and worst places on the planet

[[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] Loop problem

2008-07-14 Thread Daniel Malter

Hi, do you mean this?

pk<-matrix(rnorm(12),nrow=4,ncol=3)
ck1<-cbind(rep(pk[,1],4),rep(pk[,2],4),rep(pk[,3],4)) ## or
ck2<-cbind(rep(pk[,1],each=4),rep(pk[,2],each=4),rep(pk[,3],each=4))

pk
ck1
ck2

best,
Daniel 




fernanda lopez wrote:
> 
> Dear all,
>  I want to
> write   ck<-cbind(rep(pk[1,1],4),rep(pk[1,2],4),rep(pk[1,3],4))   state
> ment
> in a loop . How can I write it ?
> 
> 
> 
> 
> 
>> pk
>[,1]  [,2]   [,3]
> [1,] -1.1354816 0.9808877 -0.9446314
> [2,]  0.7787378 0.4536944  0.3204882
> [3,] -1.7274907 1.5112011  1.4481839
> [4,]  1.0629145 0.5976109 -0.5277638
> 
> 
> 
>> pk<-matrix(rnorm(12),nrow=4,ncol=3)
>> pk
>[,1]  [,2]   [,3]
> [1,] -1.1354816 0.9808877 -0.9446314
> [2,]  0.7787378 0.4536944  0.3204882
> [3,] -1.7274907 1.5112011  1.4481839
> [4,]  1.0629145 0.5976109 -0.5277638
> 
>> ck<-cbind(rep(pk[1,1],4),rep(pk[1,2],4),rep(pk[1,3],4))
>> ck
>   [,1]  [,2]   [,3]
> [1,] -1.135482 0.9808877 -0.9446314
> [2,] -1.135482 0.9808877 -0.9446314
> [3,] -1.135482 0.9808877 -0.9446314
> [4,] -1.135482 0.9808877 -0.9446314
> 
> 
> Thanks for your help
> 
> Fernanda Lopez
> Netherlands
> 
>   [[alternative HTML version deleted]]
> 
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Loop-problem-tp18439649p18439918.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] rm(l*)

2008-07-14 Thread Prof Brian Ripley

On Mon, 14 Jul 2008, Gabor Csardi wrote:


Maybe there is a simpler way, but this works fine:


l1 <- 1
l2 <-2
m <-10
ls()

[1] "l1" "l2" "m"

rm(list=grep("^l.*", ls(), value=TRUE))
ls()

[1] "m"




You can supply a regular expression to grep.


And as the 'pattern' argument of ls().  So following the ls() help page

rm(list=ls(pattern=glob2rx("l*")))



Gabor

On Mon, Jul 14, 2008 at 10:45:13AM +0200, Oehler, Friderike (AGPP) wrote:

Dear Rusers,

how can I designate various objects the names of which start (or end) with
the same letter to remove them all together?

For instance:

ls()

"a","b","c","l1","l2","x"

rm(list=ls("l*"))
ls()

"a","b","c",""x"

Is there some parallel to the MySQL query: where col1 like "l%"

Thanks a lot in advance,
Friderike


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


--
Csardi Gabor <[EMAIL PROTECTED]>UNIL DGM

__
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,  [EMAIL PROTECTED]
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.


[R] nlme, lme( ) convergence and selection of effects

2008-07-14 Thread Thiago Cortez Costa
Hi all,

 

I've been trying to fit a mixed effects model and I've been having problems.

 

=>My aim: 

to know whether states atributes, political parties and individual atributes
affect the electoral results of men and women candidates.

I use candidates as replications for states and for political parties. 

 

=>Response: Percentage of valid votes casted to each individual.
(alternative response: electoral result (binomial: elected, non-elected)).

 

=>Function used to fit model: lme from nlme package.

 

=>Data Organization:

Data is unbalanced. 4946 observations. Each row in the data frame has info
on the individual candidates (educational level, marital status, sex, age,
party, etc) and on the states in which they run for election (literacy
rates, district magnitude, number of voters, urban population rates, sex
ratio, etc). Individual atributes vary within state and party%in%state.
State atributes vary between states. Though political parties are present
across states, I have reasons to believe that they behave differently in
each state.

 

Example:

State ID   Literacy%#Voters/#Candidates
SexRatio  Individual ID  SexAge
EducationalLevel Party Etc.

AC  84.5   8241.92
102.56  1 M   42
Undergraduate   PT   ...

AC  84.5   8241.92
102.56  2 F 35
Undergraduate   PL   ...

AC  84.5   8241.92
102.56  3 M   55
Undergraduate   PMDB   ...

DF  96.6   15593.38
89.64 4M   40
PostGraduate  PSDB ...

DF  96.6   15593.38
89.64 5F 39
Undergraduate   PSOL

RJ   96.0   15363.96
88.42 6M   63
Undergraduate   PT

RJ   96.0   15363.96
88.42 7M   52
Undergraduate   PMDB   ...

 

=>Questions:

 

1)  I've found that the random effects of the 'state' level have a very
low standard deviation.

 

>depfed.lme3<- lme(Votes~Sex, data=depfed.frm, random=~1|State/Party)

>summary (depfed.lme3)

(...)Random effects:

 Formula: ~1 | State

 (Intercept)

StdDev: 0.0001089504

 

This suggests that there is no significant advantage on using 'state' alone
as a grouping factor, I suppose. On the other hand, there is considerable
variation in the effects of parties inside states:

 

(...)Formula: ~1 | Party %in% State

(Intercept) Residual

StdDev:   0.9904834 1.002779

 

Is it possible to prevent R from calculating the random effects at the State
level and still calculate the effects of Parties inside States? It would
save degrees of freedom.

 

2)  When I try to insert variables as random terms, the estimation
doesn't converge.

 

Ex: > depfed.lme4 <- lme(Votes~Sex, data=depfed.frm,
random=~Sex|State/Party)

   >Erro em lme.formula(Votes ~ Sex, data = depfed.frm, random = ~Sex |
: 

   >nlminb problem, convergence error code = 1  message = iteration
limit reached without convergence (9)

 

   > depfed.lme4 <- lme(Votes~Age, data=depfed.frm,
random=~Sex|State/Party)

   >Erro em lme.formula(Votes ~ Age, data = depfed.frm, random = ~Sex |
: 

   >nlminb problem, convergence error code = 1 message = iteration limit
reached without convergence (9)

 

Am I doing anything wrong? How can I overcome this problem? Any
solutions using nlme or other packages are welcome. 

 

3)  I guess I should use State atributes as fixed effects and candidates
atributes both as fixed and random effects, any suggestion on this matter is
also welcome.

 

Thank you guys for your attention

 

Thiago Cortez

Rio de Janeiro, Brazil

 

 

 


[[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] "Reasonable doubt" - was "Re: shapiro wilk normality test"

2008-07-14 Thread S Ellison


>>> Ted Harding <[EMAIL PROTECTED]> 14/07/2008 00:16 >>>
>said:
>What constitutes "reasonable doubt" can become a very interesting
>question, but there are some crimes for which it has a definite
>statistical interpretation

Warning for potential courtgoers: "reasonable doubt" NEVER has a direct
statistical interpretation in a UK court. "Beyond reasonable doubt" is a
state of mind in the jury or the presiding magistrates. While a
statistical test may indicate the strength of some part of the relevant
evidence, and thereby reduce the remaining doubt in the minds of the
jury/magistrates, UK law requires that the jury (or magistrate) to judge
whether doubts are reasonable or not on common-sense and not on
statistical grounds.

The two can be very different, because the doubt in the minds of the
jury must take into account such factors as whether the sample can be
shown to be associated with the defendant; whether the test equipment
was properly calibrated and functioning correctly at the time of the
analysis; whether the sample could have been tampered with or affected
since being taken; whether the blood alcohol was at that level at the
time of driving (and indeed whether the defendant was driving at all);
whether the defendant's second defence test sample result was also over
the limit; whether the arresting officer had it in for the defendant and
so on. 

So a more accurate interpretation of ted's example would be that after
the positive analysis and statistical test result, there was strong or
very strong evidence (you'd need at least 3sigma to say even that much
actually, and the UK convention is exceedence by at least 6mg/100ml)
that the sample as tested showed contained an amount of alcohol over the
legl limit. With suitable supporting evidence, the strength of that
evidence would, for a 'reasonable man' (ie the proverbial man on the
Clapham omnibus),  leave no reasonable doubt of the defendant's guilt.
But the 'reasonable doubt' test is not in itself statistical.

In terms of the 'absence of evidence<>evidence of absence' debate, of
course, it's not so relevant. The law generally requires evidence of
_presence_ - although there's some contaminant legislation that causes
problems by requiring demonstrated absence. 

Steve Ellison
Lab of the Government Chemist


***
This email and any attachments are confidential. Any use...{{dropped:8}}

__
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 correlate nominal variables?

2008-07-14 Thread Timo Stolz
Dear R-Users,

I need functions to calculate Yule's Y or Cramérs Index, in order to
correlate variables that are nominally scaled?

Am I wrong? Are such functions existing?

Sincerely,
Timo

__
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] Frequency-Table on Group Level - Multi Level Analysis

2008-07-14 Thread Kunzler, Andreas
Hello everybody,

I've a multi-level structured data.frame.  

I = Individual Level (factor)
G = Group Level (factor)
SW= Software (factor)

I G SW
1 1 A
2 1 A
3 2 B

Im looking for a frequncy-talbe of the used software on the group level.
In this case the result has to be:
A = 0.5
B = 0.5

Is there an easy way to do things like this or do I have to read myself
into Multi-Level Analysis?

Thank you

Frequencey

__
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] Tissue specific genes by ANOVA?

2008-07-14 Thread icebreake

Hello,

unfortunately I have I big problem I can't solve.

I have to analyse if a gene is tissue specific. For example for the gene xyz
I have following expression values:

HeartLiver   Brain
8.998497   10.013561   12.277407
9.743556   10.137574   11.033957

For every tissue I have two values from two different experiments.

Now I want to test if Heart is significant higher than Liver and Brain, or
Liver is significant higher than Heart an Brain, ...

I read about the pairwise.t.test, but I dont't want to test Heart against
Liver and Heart against Brain, ...

Is there any possibility to do that? ANOVA? Duncan? Constrasts?

Please help

-- 
View this message in context: 
http://www.nabble.com/Tissue-specific-genes-by-ANOVA--tp18441289p18441289.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] eval.wih.vis

2008-07-14 Thread mysimbaa

Hello,
I have an error since I run my R code. This error is :
Fehler in eval.with.vis(expr, envir, enclos) : 
> 

My code is:

#CONDITION1 : check if the right logfile is chosen
c1=log(z[,3],n)
if (c1==FALSE) { 
plot(0:1,0:1,type = "n", axes=FALSE,xlab="",ylab="")
text(0.4,0.8,adj=0,paste("FEHLER"),col="red")
text(0.4,0.6,adj=0,paste("Falsche Logfile gewählt"))
stop()} else
{...}

z[,3] is a vector of n values. And log is a function which returns
TRUE/FALSE
#Detection whether the Right Logfile was chosen
log<-function(col,Len){
vLog=ifelse(sum(col)>(5000*Len),TRUE,FALSE)}


I think the error comes from stop(), but not sure.
Can anyone help to avoid this error?

Thanks.
Adel



-- 
View this message in context: 
http://www.nabble.com/eval.wih.vis-tp18439974p18439974.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] How to load stats4 package

2008-07-14 Thread Surendra champanerkar
Dear users
i m not able to find stats4 package to calculate mle
plz give me link for sttats4 package if possible


-- 
Shubham
Surendra

[[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 extract folowing data?

2008-07-14 Thread Ben Tupper


On Jul 14, 2008, at 3:03 AM, Megh Dal wrote:


Hi,
following data is taken from http://www.economagic.com/em-cgi/ 
data.exe/var/west-texas-crude-long. Problem with this data is when  
you copy it from this site you would get something like that :


 1946 063331.27
 1946 079991.27
 1946 087771.52
 1946 096661.52

They should be interpret in following way :

1946 063331.27 this means : on 1946, June price was 1.27. Can  
anyone please suggest me the easiest way with R to get extracted  
the entire series?






Hi,

You can extract the year, month and price with the following:

> s = c("1946 063331.27", "1946 079991.27")
> nc = nchar(s)
> y = substr(s, 1,4)
> m = substr(s, 6,7)
> p = substr(s,nc-3,nc)
> y
[1] "1946" "1946"
> m
[1] "06" "07"
> p
[1] "1.27" "1.27"

But you will want to pay attention to what happens when the price  
requires more digits.


Cheers,
Ben

P.S. Wow!  A 20% increase in the cost of oil in one month! Will  
wonders never cease?



Ben Tupper
[EMAIL PROTECTED]

I GoodSearch for Ashwood Waldorf School.

Raise money for your favorite charity or school just by searching the  
Internet with GoodSearch - www.goodsearch.com - powered by Yahoo!


__
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] options() question for displaying numbers in the GUI

2008-07-14 Thread tolga . i . uzuner
Dear R Users,

I would like the R GUI to display numbers with comma separators, i.e.

1,000,000.00

instead of

100

Is there a flag in option() for this behaviour. A google/RSiteSearch has 
not revealed anything but perhaps I have missed it.

Thanks in advance,
Tolga

Generally, this communication is for informational purposes only
and it is not intended as an offer or solicitation for the purchase
or sale of any financial instrument or as an official confirmation
of any transaction. In the event you are receiving the offering
materials attached below related to your interest in hedge funds or
private equity, this communication may be intended as an offer or
solicitation for the purchase or sale of such fund(s).  All market
prices, data and other information are not warranted as to
completeness or accuracy and are subject to change without notice.
Any comments or statements made herein do not necessarily reflect
those of JPMorgan Chase & Co., its subsidiaries and affiliates.

This transmission may contain information that is privileged,
confidential, legally privileged, and/or exempt from disclosure
under applicable law. If you are not the intended recipient, you
are hereby notified that any disclosure, copying, distribution, or
use of the information contained herein (including any reliance
thereon) is STRICTLY PROHIBITED. Although this transmission and any
attachments are believed to be free of any virus or other defect
that might affect any computer system into which it is received and
opened, it is the responsibility of the recipient to ensure that it
is virus free and no responsibility is accepted by JPMorgan Chase &
Co., its subsidiaries and affiliates, as applicable, for any loss
or damage arising in any way from its use. If you received this
transmission in error, please immediately contact the sender and
destroy the material in its entirety, whether in electronic or hard
copy format. Thank you.
Please refer to http://www.jpmorgan.com/pages/disclosures for
disclosures relating to UK legal entities.
[[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] options() question for displaying numbers in the GUI

2008-07-14 Thread Henrique Dallazuanna
You can use this for print:

prettyNum("100.00", big.mark=",")

Perhaps you can use a print method for this.

On Mon, Jul 14, 2008 at 8:50 AM,  <[EMAIL PROTECTED]> wrote:
> Dear R Users,
>
> I would like the R GUI to display numbers with comma separators, i.e.
>
> 1,000,000.00
>
> instead of
>
> 100
>
> Is there a flag in option() for this behaviour. A google/RSiteSearch has
> not revealed anything but perhaps I have missed it.
>
> Thanks in advance,
> Tolga
>
> Generally, this communication is for informational purposes only
> and it is not intended as an offer or solicitation for the purchase
> or sale of any financial instrument or as an official confirmation
> of any transaction. In the event you are receiving the offering
> materials attached below related to your interest in hedge funds or
> private equity, this communication may be intended as an offer or
> solicitation for the purchase or sale of such fund(s).  All market
> prices, data and other information are not warranted as to
> completeness or accuracy and are subject to change without notice.
> Any comments or statements made herein do not necessarily reflect
> those of JPMorgan Chase & Co., its subsidiaries and affiliates.
>
> This transmission may contain information that is privileged,
> confidential, legally privileged, and/or exempt from disclosure
> under applicable law. If you are not the intended recipient, you
> are hereby notified that any disclosure, copying, distribution, or
> use of the information contained herein (including any reliance
> thereon) is STRICTLY PROHIBITED. Although this transmission and any
> attachments are believed to be free of any virus or other defect
> that might affect any computer system into which it is received and
> opened, it is the responsibility of the recipient to ensure that it
> is virus free and no responsibility is accepted by JPMorgan Chase &
> Co., its subsidiaries and affiliates, as applicable, for any loss
> or damage arising in any way from its use. If you received this
> transmission in error, please immediately contact the sender and
> destroy the material in its entirety, whether in electronic or hard
> copy format. Thank you.
> Please refer to http://www.jpmorgan.com/pages/disclosures for
> disclosures relating to UK legal entities.
>[[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.
>



-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40" S 49° 16' 22" O

__
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] options() question for displaying numbers in the GUI

2008-07-14 Thread tolga . i . uzuner
Hi Henrique,

Many thanks. That seems to work for individual numbers passed in as the 
first argument. 

Would anyone know of a way to get things to print this way by default all 
the time in the GUI ? Setting a big.mark option through options does not 
seem to do it.

> prettyNum("100.00", big.mark=",")
[1] "1,000,000.00"
> options(big.mark=",")
> 10e6  <<<--- would like to see this as 10,000,000.00
[1] 1e+07
> 100 
[1] 1e+06 <<<--- would like to see this as 1,000,000.00
> 

Thanks,
Tolga




"Henrique Dallazuanna" <[EMAIL PROTECTED]> 
14/07/2008 13:07

To
[EMAIL PROTECTED]
cc
r-help@r-project.org
Subject
Re: [R] options() question for displaying numbers in the GUI






You can use this for print:

prettyNum("100.00", big.mark=",")

Perhaps you can use a print method for this.

On Mon, Jul 14, 2008 at 8:50 AM,  <[EMAIL PROTECTED]> wrote:
> Dear R Users,
>
> I would like the R GUI to display numbers with comma separators, i.e.
>
> 1,000,000.00
>
> instead of
>
> 100
>
> Is there a flag in option() for this behaviour. A google/RSiteSearch has
> not revealed anything but perhaps I have missed it.
>
> Thanks in advance,
> Tolga
>
> Generally, this communication is for informational purposes only
> and it is not intended as an offer or solicitation for the purchase
> or sale of any financial instrument or as an official confirmation
> of any transaction. In the event you are receiving the offering
> materials attached below related to your interest in hedge funds or
> private equity, this communication may be intended as an offer or
> solicitation for the purchase or sale of such fund(s).  All market
> prices, data and other information are not warranted as to
> completeness or accuracy and are subject to change without notice.
> Any comments or statements made herein do not necessarily reflect
> those of JPMorgan Chase & Co., its subsidiaries and affiliates.
>
> This transmission may contain information that is privileged,
> confidential, legally privileged, and/or exempt from disclosure
> under applicable law. If you are not the intended recipient, you
> are hereby notified that any disclosure, copying, distribution, or
> use of the information contained herein (including any reliance
> thereon) is STRICTLY PROHIBITED. Although this transmission and any
> attachments are believed to be free of any virus or other defect
> that might affect any computer system into which it is received and
> opened, it is the responsibility of the recipient to ensure that it
> is virus free and no responsibility is accepted by JPMorgan Chase &
> Co., its subsidiaries and affiliates, as applicable, for any loss
> or damage arising in any way from its use. If you received this
> transmission in error, please immediately contact the sender and
> destroy the material in its entirety, whether in electronic or hard
> copy format. Thank you.
> Please refer to http://www.jpmorgan.com/pages/disclosures for
> disclosures relating to UK legal entities.
>[[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.
>



-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40" S 49° 16' 22" O



Generally, this communication is for informational purposes only
and it is not intended as an offer or solicitation for the purchase
or sale of any financial instrument or as an official confirmation
of any transaction. In the event you are receiving the offering
materials attached below related to your interest in hedge funds or
private equity, this communication may be intended as an offer or
solicitation for the purchase or sale of such fund(s).  All market
prices, data and other information are not warranted as to
completeness or accuracy and are subject to change without notice.
Any comments or statements made herein do not necessarily reflect
those of JPMorgan Chase & Co., its subsidiaries and affiliates.

This transmission may contain information that is privileged,
confidential, legally privileged, and/or exempt from disclosure
under applicable law. If you are not the intended recipient, you
are hereby notified that any disclosure, copying, distribution, or
use of the information contained herein (including any reliance
thereon) is STRICTLY PROHIBITED. Although this transmission and any
attachments are believed to be free of any virus or other defect
that might affect any computer system into which it is received and
opened, it is the responsibility of the recipient to ensure that it
is virus free and no responsibility is accepted by JPMorgan Chase &
Co., its subsidiaries and affiliates, as applicable, for any loss
or damage arising in any way from its use. If you received this
transmission in error, please immediately contact the sender and
destroy the materi

Re: [R] how to correlate nominal variables?

2008-07-14 Thread Daniel Malter

You can copy the code below to your R-code editor. For Yule's Q, the data is
expected in two vectors. For cramer's phi, the data is expected in separate
columns of a matrix or dataframe.

##Run this code
yule.Q=function(x,y){(table(x,y)[1,1]*table(x,y)[2,2]-table(x,y)[1,2]*table(x,y)[2,1])/(table(x,y)[1,1]*table(x,y)[2,2]+table(x,y)[1,2]*table(x,y)[2,1])}

##create test data
vector.one=rbinom(100,1,0.4)
vector.two=rbinom(100,1,0.8)
table(vector.one,vector.two)

##compute yule's Q
yule.Q(vector.one,vector.two)  
##just put your two vector names there




##Cramer's V

##Run this code
cramers.v=function(x){
x=as.data.frame(x)
chisq=0
row.sum=NULL
col.sum=NULL
for(i in 1:dim(table(x))[1])
  row.sum[i]=sum(table(x)[i,])
for(j in 1:dim(table(x))[2])
  col.sum[j]=sum(table(x)[j,])
for(k in 1:dim(table(x))[1]){
  for(l in 1:dim(table(x))[2]){
 
chisq=chisq+((table(x)[k,l]-(row.sum[k]*col.sum[l])/(dim(x)[1]))^2)/((row.sum[k]*col.sum[l])/(dim(x)[1]))
  cramers.v=sqrt(chisq/(dim(x)[1]*(min(dim(table(x)))-1)))
  }
}
  }

##create test data
toanalyze=cbind(rbinom(100,2,0.4),rbinom(100,1,0.6))
toanalyze2=cbind(rep(c(0,1),each=50),rep(c(0,1),each=50))

##compute cramer's v for the test data 
v1=cramers.v(toanalyze) ## just put your dataframe or matrix name
v2=cramers.v(toanalyze2)

v1 ##cramer's v
v2 ##cramer's v



Timo Stolz wrote:
> 
> Dear R-Users,
> 
> I need functions to calculate Yule's Y or Cramérs Index, in order to
> correlate variables that are nominally scaled?
> 
> Am I wrong? Are such functions existing?
> 
> Sincerely,
> Timo
> 
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
> 
> 

-- 
View this message in context: 
http://www.nabble.com/how-to-correlate-nominal-variables--tp18441195p18442713.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 problem

2008-07-14 Thread Gabor Grothendieck
Try this:

pk[rep(1, 4), ]


On Mon, Jul 14, 2008 at 4:33 AM, fernanda lopez <[EMAIL PROTECTED]> wrote:
> Dear all,
> I want to
> write   ck<-cbind(rep(pk[1,1],4),rep(pk[1,2],4),rep(pk[1,3],4))   state ment
> in a loop . How can I write it ?
>
>
>
>
>
>> pk
>   [,1]  [,2]   [,3]
> [1,] -1.1354816 0.9808877 -0.9446314
> [2,]  0.7787378 0.4536944  0.3204882
> [3,] -1.7274907 1.5112011  1.4481839
> [4,]  1.0629145 0.5976109 -0.5277638
>
>
>
>> pk<-matrix(rnorm(12),nrow=4,ncol=3)
>> pk
>   [,1]  [,2]   [,3]
> [1,] -1.1354816 0.9808877 -0.9446314
> [2,]  0.7787378 0.4536944  0.3204882
> [3,] -1.7274907 1.5112011  1.4481839
> [4,]  1.0629145 0.5976109 -0.5277638
>
>> ck<-cbind(rep(pk[1,1],4),rep(pk[1,2],4),rep(pk[1,3],4))
>> ck
>  [,1]  [,2]   [,3]
> [1,] -1.135482 0.9808877 -0.9446314
> [2,] -1.135482 0.9808877 -0.9446314
> [3,] -1.135482 0.9808877 -0.9446314
> [4,] -1.135482 0.9808877 -0.9446314
>
>
> Thanks for your help
>
> Fernanda Lopez
> Netherlands
>
>[[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

__
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 load stats4 package

2008-07-14 Thread Duncan Murdoch

On 7/14/2008 7:18 AM, Surendra champanerkar wrote:

Dear users
i m not able to find stats4 package to calculate mle
plz give me link for sttats4 package if possible




library(stats4) should do it.  It's a base package, i.e. part of R.

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.


[R] aggregate months to years

2008-07-14 Thread Oehler, Friderike (AGPP)
Many thanks for the recent answers to my question about pattern recognition.
The hint to "grep" and the "pattern" argument brought me a big deal forward.

# Now, I have a data frame:

DATE <- c("1930-01-01", "1930-01-01", "1930-02-01", "1931-01-01",
"1931-02-01", "1931-03-01") # almost all months until "1999-12-01". Day is
always 01, the same months actually occur several times.
FREQ <- rep(1,6)
ex<- data.frame(DATE,FREQ)

# I can aggregate it like this:

ex <- tapply(ex$FREQ, ex$DATE, sum)

# or use"grep" to extract a single year:
# ex[grep(pattern="^1931", ex$DATE),]

# But how can I aggregate the years such that a barplot would show me the
FREQ per year and not per month?

barplot(as.vector(ex))

# Sorry for the bad example, of course my data.frame is much bigger and the
barplot gives me a nice monthly time series of events, but I really only want
the occurrences per year, not per month.

Grateful for your advice!
Friderike

__
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] aggregate months to years

2008-07-14 Thread Henrique Dallazuanna
Try this:

aggregate(ex$FREQ, list(Year =  substr(ex$DATE, 1, 4)), sum)

or

aggregate(ex$FREQ, list(Year = format(as.Date(ex$DATE), "%Y")), sum)



On Mon, Jul 14, 2008 at 9:37 AM, Oehler, Friderike (AGPP)
<[EMAIL PROTECTED]> wrote:
> Many thanks for the recent answers to my question about pattern recognition.
> The hint to "grep" and the "pattern" argument brought me a big deal forward.
>
> # Now, I have a data frame:
>
> DATE <- c("1930-01-01", "1930-01-01", "1930-02-01", "1931-01-01",
> "1931-02-01", "1931-03-01") # almost all months until "1999-12-01". Day is
> always 01, the same months actually occur several times.
> FREQ <- rep(1,6)
> ex<- data.frame(DATE,FREQ)
>
> # I can aggregate it like this:
>
> ex <- tapply(ex$FREQ, ex$DATE, sum)
>
> # or use"grep" to extract a single year:
> # ex[grep(pattern="^1931", ex$DATE),]
>
> # But how can I aggregate the years such that a barplot would show me the
> FREQ per year and not per month?
>
> barplot(as.vector(ex))
>
> # Sorry for the bad example, of course my data.frame is much bigger and the
> barplot gives me a nice monthly time series of events, but I really only want
> the occurrences per year, not per month.
>
> Grateful for your advice!
> Friderike
>
> __
> 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.
>



-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40" S 49° 16' 22" O

__
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] Odp: aggregate months to years

2008-07-14 Thread Petr PIKAL
Hi

[EMAIL PROTECTED] napsal dne 14.07.2008 14:37:36:

> Many thanks for the recent answers to my question about pattern 
recognition.
> The hint to "grep" and the "pattern" argument brought me a big deal 
forward.
> 
> # Now, I have a data frame:
> 
> DATE <- c("1930-01-01", "1930-01-01", "1930-02-01", "1931-01-01",
> "1931-02-01", "1931-03-01") # almost all months until "1999-12-01". Day 
is
> always 01, the same months actually occur several times.
> FREQ <- rep(1,6)
> ex<- data.frame(DATE,FREQ)
> 
Your DATE is not in Date format. See as.Date

ex$Date<-as.Date(ex$DATE)




> # I can aggregate it like this:
> 
> ex <- tapply(ex$FREQ, ex$DATE, sum)

ex1<-tapply(ex$FREQ, cut(ex$Date, "years"), sum)
ex1<-tapply(ex$FREQ, format(ex$Date, "%Y"), sum)

gives you yearly aggregates

> 
> # or use"grep" to extract a single year:
> # ex[grep(pattern="^1931", ex$DATE),]
> 
> # But how can I aggregate the years such that a barplot would show me 
the
> FREQ per year and not per month?
> 
> barplot(as.vector(ex))

barplot(ex1)

could be what you want.

Regards
Petr

> 
> # Sorry for the bad example, of course my data.frame is much bigger and 
the
> barplot gives me a nice monthly time series of events, but I really only 
want
> the occurrences per year, not per month.
> 
> Grateful for your advice!
> Friderike
> 
> __
> 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] Can't compile in HPUX 11.31 on IA64

2008-07-14 Thread Jackson,Daniel
I'm trying to compile R,  not getting pass the configure step.

R version is 2.7.1 from source tarball.

Machine is HPUX 11.31, 32-CPUs of Itanium II.

Compilers are HPUX C, C++ and Fortran.
(B3910B A.06.15, May 2007)

My config string:
./configure --prefix=/apps/INTEL/R --enable-R-shlib CC=/opt/aCC/bin/cc 
CXX=/opt/aCC/bin/aCC FC=/opt/fortran90/bin/f90 --prefix=/apps/INTEL/R 
--enable-R-shlib CFLAGS=+z +DD64 CXXFLAGS=-b +z +DD64 FCFLAGS=+DD64 F77=f90 
FFLAGS=+DD64 LDFLAGS=-L/usr/lib/hpux64 -L/opt/fortran90/lib LIBnn=lib 
--with-x=no --with-readline=no --with-iconv=no --without-jpeglib 
--without-libpng --without-system-bzlib --without-tcltk --without-system-pcre 
--without-system-zlib

It gets as far as "Checking for xmkmf ..no"
configure: WARNING: I could not determine CPICFLAGS

and then just says error, consult the docs for answers.

I'm using the HP compilers, with modern implementations of gcc there is no 
fortran compiler for the Itanium/HPUX architecure, is this a problem?

I have the config.log if anyone is interested.

Thanks in advance,

Dan Jackson
Sr. UNIX Systems Administrator
[EMAIL PROTECTED]
office713.745.0836
cell   832.277.6110
pager   [EMAIL PROTECTED]

__
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] ampersand char in the path causing error message when running rscript.bat

2008-07-14 Thread Zroutik Zroutik
Dear users,

is anybody able to reproduce the following behaviour?

I have two copies of my project with the .rhistory files in a directory with
and without ampersand
a) d:\calc\foo1 & foo2 foo3\
b) d:\calc\foo1 - foo2 foo3\
I'm running "rscript .rhistory" in the dir. At the case a) I'm getting a
following error: The system cannot find the path specified. 'foo2'  is not
recognised as an int. or ext. com... When sourcing the .rhistory in rgui, no
error appears. Using winxp & R2.7.1

Cheers

[[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] applying complex functions by groups

2008-07-14 Thread Finch, W. Holmes
Hi,

I have a matrix that is indexed by groups and looks something like this:

1 1 2
1 2 1
.
.
.
2 1 1
2 1 2
2 NA 1
.
.
.
3 1 NA
3 2 NA
etc.

The first column is the group variable and I would like to apply categorical 
data imputation functions to the other two columns, doing so by groups.  I have 
tried APPLY, BY and SPLIT, but have not had much luck getting it to work.  I 
wonder if anyone has suggestions for how I might do this kind of by groups 
processing.  Thanks very much.

Holmes


Holmes Finch
Associate Professor
Director of Research, Office of Charter School Research
Department of Educational Psychology
Ball State University
Muncie, IN  47306
(765) 285-3668

My favorite quote:

"I was gently accused of escapism during a TV interview about a book I had 
written on my length-of-California walk. Frankly, I fail to see how going for a 
six-month, thousand-mile walk through deserts and mountains can be judged less 
real than spending six months working eight hours a day, five days a week, in 
order to earn enough money to be able to come back home to a comfortable home 
in the evening and sit in front of a TV screen and watch the two-dimensional 
image of some guy talking about a book he has written on a six-month, 
thousand-mile walk through deserts and mountains."

Colin Fletcher (1922-2007), renowned hiker and outdoor writer

__
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] swap_tail macro in pnorm.c

2008-07-14 Thread Adam B. Thompson
Hello,

Looking over the swap_tail macro in pnorm.c, the comment inside the code
indicates it is to swap the values of '*cum' and '*ccum'.  According to the
code below that is taken from the source file, the swap functionality is
dependent on what values are provided for 'x' and 'lower'.

#define swap_tail  \
if (x > 0.) {/* swap  ccum <--> cum */  \
temp = *cum; if(lower) *cum = *ccum; *ccum = temp;  \
}

It only swaps the corresponding values if and only if 'x' is greater than
zero and 'lower' is "true" (non-zero).  The following examples will show the
actual behavior:

Input 1 Input 2

x: 1x: 1
lower: 0lower: 2
*cum:  1*cum:  1
*ccum: 2*ccum: 2

Result 1Result 2

temp:  1temp:  1
*cum:  1*cum:  2
*ccum: 1*ccum: 1

According to the code, Input 1 causes '*cum' to retain its value while
'*ccum' loses its own and takes on that of '*cum', performing a half-swap.
Input 2 performs the full swap, resulting in '*cum' taking on the original
value of '*ccum' while '*ccum' takes on the original value of '*cum'.

Since the logic following the 'lower' conditional statement is not
surrounded in braces, this causes the second statement (*ccum = temp;) to be
executed even if 'lower' evaluates to "false" (zero).  Is this an
appropriate result for the macro since this does not actually result in a
swapped pair of values, as indicated in the above example (Input 1)?  Or
should this only result in swapped values if and only if 'x' and 'lower' are
greater than zero and non-zero, respectively?

Thank you for your assistance.
-- 
Adam B. Thompson

http://www.cs.utk.edu/~athompso

[[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] macros in R

2008-07-14 Thread Erin Hodgess
Hi R People:

Could someone point out a reference for creating macros in R, please?

Thanks,
Erin


-- 
Erin Hodgess
Associate Professor
Department of Computer and Mathematical Sciences
University of Houston - Downtown
mailto: [EMAIL PROTECTED]

__
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] macros in R

2008-07-14 Thread Chuck Cleland

On 7/14/2008 11:03 AM, Erin Hodgess wrote:

Hi R People:

Could someone point out a reference for creating macros in R, please?

Thanks,
Erin


  See Programmer’s Niche: Macros in R by Thomas Lumley:

http://www.r-project.org/doc/Rnews/Rnews_2001-3.pdf

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

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


Re: [R] Tissue specific genes by ANOVA?

2008-07-14 Thread Marcelo Luiz de Laia
icebreake  web.de> writes:

> Hello,
> 
> unfortunately I have I big problem I can't solve.
(...)
> Is there any possibility to do that? ANOVA? Duncan? Constrasts?
> 

Hi Icebreake,

Did you try maanova or limma package from www.bioconductor.org?

I suppose that you are on microarray experiment. If not, please, leave my
suggestions.

Cheers

Marcelo
Brazil

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


[R] creating axis of the plot before data are plotted

2008-07-14 Thread Zroutik Zroutik
Dear R-users,

I'm tackling with a problem which causing me a head-ache for a long time. I
would like to create a nice x-axis to my plots, but I do not know how to
implement the method.

Imagine a matrix where you have rownames real numbers -- these rownames
should be written in the x-axis nicely. I could not find any way how.

I'll describe what I'm doing now:
I have a matrix where each column is an independent curve (number of the
columns 3-4). The rownames are the x-axis, and the names are real numbers
(converted to chars, of course). I find the max and the min among the values
in the matrix (for the y-axis) and I'm creating an empty plot. x-axis is
c(0, nrow(matrix)). Now, I'm creating the x-axis labels

Labels <- seq(1, nrow(matrix), by = 100)
axis(1, at = NULL, labels = rownames(matrix)[Labels])

At this point I'd like to have instead of "24.1233326.4566728.79
31.1233333.45667" at the x-axis, an optimally placed ticks at let's say
"26 28 30 32" -- this is what I cannot achieve.

Afterwards I'm plotting the curves in different colours. I know that the
x-values are accessed by the number of their row and not rowname.

Anybody could point me into some direction, please? Thank you upfront!

[[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 with an error message

2008-07-14 Thread naw3
Hi,

I am writing a very long program that deals with multiple large databases which
often have missing data cells and other quirks. I've been testing it on small
samples of the data so it doesn't take too long, but when I tried it using the
real files, it ran for about a minute and then gave me this error message:

Error in matrix(unlist(value, recursive = FALSE, use.names = FALSE), nrow = nr, 
:
  length of 'dimnames' [2] not equal to array extent

I'm very new at R/computer science, so I have no clue what it means and I would
greatly appreciate any info about why this is coming up and how to fix it. Is
there a way to get R to tell me at which line it is encountering the problem?
Also, what kinds of executions in my code could cause this problem? What should
I be looking for in order to fix this?

Thanks,
-Nina

__
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] Strptime/ date time classes

2008-07-14 Thread Mark Difford

Hi Caroline,

>> is.na(strptime("19810329012000",format="%Y%m%d%H%M%S"))
>> [1] TRUE

>> The problem was to do with daylight saving time.  I need to specify a
>> time zone as this time >> doesn't exist in my operating system's current
>> time zone.  I still think this is odd behaviour >> though!  When you look
>> at the missing object it doesn't look missing at all.  


This is just one reason why the posting guide asks you please to provide a
small, self-contained, reproducible example of the problem, along with
session information, which you never provided:

?sessionInfo
sessionInfo()

On my system, for instance, your example returns TRUE:

> is.na(strptime("19810329012000",format="%Y%m%d%H%M%S"))
[1] FALSE

> sessionInfo()
R version 2.7.1 Patched (2008-06-27 r46012) 
i386-pc-mingw32 

locale:
LC_COLLATE=English_South Africa.1252;LC_CTYPE=English_South
Africa.1252;LC_MONETARY=English_South
Africa.1252;LC_NUMERIC=C;LC_TIME=English_South Africa.1252

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

other attached packages:
[1] exactLoglinTest_1.3.6 vcd_1.0-8 colorspace_0.95  
MASS_7.2-42  
[5] Design_2.1-1  survival_2.34-1   Hmisc_3.4-3  

loaded via a namespace (and not attached):
[1] cluster_1.11.11 lattice_0.17-10 tools_2.7.1

Regards, Mark.


Caroline Keef-2 wrote:
> 
> 
> is.na(strptime("19810329012000",format="%Y%m%d%H%M%S"))
> [1] TRUE
> 
> The problem was to do with daylight saving time.  I need to specify a time
> zone as this time doesn't exist in my operating system's current time
> zone.  I still think this is odd behaviour though!  When you look at the
> missing object it doesn't look missing at all.  
> 
> Caroline
> 
> _
> Find the best and worst places on the planet
> 
>   [[alternative HTML version deleted]]
> 
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Strptime--date-time-classes-tp18362221p18446951.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] creating axis of the plot before data are plotted

2008-07-14 Thread stephen sefick
try at=seq(from=26, to=32, by=2) in the axis statment
hope this helps

Stephen

On Mon, Jul 14, 2008 at 11:21 AM, Zroutik Zroutik <[EMAIL PROTECTED]> wrote:

> Dear R-users,
>
> I'm tackling with a problem which causing me a head-ache for a long time. I
> would like to create a nice x-axis to my plots, but I do not know how to
> implement the method.
>
> Imagine a matrix where you have rownames real numbers -- these rownames
> should be written in the x-axis nicely. I could not find any way how.
>
> I'll describe what I'm doing now:
> I have a matrix where each column is an independent curve (number of the
> columns 3-4). The rownames are the x-axis, and the names are real numbers
> (converted to chars, of course). I find the max and the min among the
> values
> in the matrix (for the y-axis) and I'm creating an empty plot. x-axis is
> c(0, nrow(matrix)). Now, I'm creating the x-axis labels
>
> Labels <- seq(1, nrow(matrix), by = 100)
> axis(1, at = NULL, labels = rownames(matrix)[Labels])
>
> At this point I'd like to have instead of "24.1233326.4566728.79
> 31.1233333.45667" at the x-axis, an optimally placed ticks at let's say
> "26 28 30 32" -- this is what I cannot achieve.
>
> Afterwards I'm plotting the curves in different colours. I know that the
> x-values are accessed by the number of their row and not rowname.
>
> Anybody could point me into some direction, please? Thank you upfront!
>
>[[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.
>



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

-K. Mullis

[[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] More compact form of lm object that can be used for prediction?

2008-07-14 Thread Woolner, Keith
> From: Marc Schwartz [mailto:[EMAIL PROTECTED]
> Sent: Friday, July 11, 2008 4:54 PM
> 
> on 07/11/2008 02:02 PM Woolner, Keith wrote:
> >> From: Marc Schwartz [mailto:[EMAIL PROTECTED]
> >> Sent: Friday, July 11, 2008 12:14 PM
> >>
> >> on 07/11/2008 10:50 AM Woolner, Keith wrote:
> >>> Hi everyone,
> >>>
> >>> Is there a way to take an lm() model and strip it to a minimal
form (or
> >>> convert it to another type of object) that can still used to
predict the
> >>> dependent variable?
> >> 
[...] 
> If the only thing that you need to do is to use the final models to
run
> predictions on new data, all you really need is the correct encoding,
> contrasts and any transforms of the IV's and the resultant
coefficients
> from the source models and code your program around those parameters.
> 
> If the models are not going to change 'too frequently' (a relative
term
> to be sure), I would not worry about spending a lot of time automating
> the processes. You can easily hard code the mechanics as they do
change
> once the basic framework is in place.
> 
> A possibility would be to create a design matrix from the new incoming
> data and then use matrix multiplication against the coefficients to
> generate the predictions.
> 
> For example, using the very simplistic model from ?predict.lm, we get:
> 
> x <- rnorm(15)
> y <- x + rnorm(15)
> 
> my.lm <- lm(y ~ x)
> 
> my.coef <- coef(my.lm)
> 
>  > my.coef
> (Intercept)   x
>-0.2328391.455494
> 
> # Create some new 'x' data for prediction
> new <- data.frame(x = seq(-3, 3, 0.5))
> 
> # Create a design matrix from the new data
> my.mm <- model.matrix(~ x, new)
> 
> # Now create the predicted 'y' values using the new 'x' data
>  > my.mm %*% my.coef

Thank you, once again, Marc!  This turns out to be exactly what I
needed.  I figured something like this should be possible, but I was
fumbling around for the right way to formulate it.  Your example was
perfect, and much appreciated.

Keith

__
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] Help with an error message

2008-07-14 Thread stephen sefick
?unlist

On Mon, Jul 14, 2008 at 11:49 AM, <[EMAIL PROTECTED]> wrote:

> Hi,
>
> I am writing a very long program that deals with multiple large databases
> which
> often have missing data cells and other quirks. I've been testing it on
> small
> samples of the data so it doesn't take too long, but when I tried it using
> the
> real files, it ran for about a minute and then gave me this error message:
>
> Error in matrix(unlist(value, recursive = FALSE, use.names = FALSE), nrow =
> nr,
> :
>  length of 'dimnames' [2] not equal to array extent
>
> I'm very new at R/computer science, so I have no clue what it means and I
> would
> greatly appreciate any info about why this is coming up and how to fix it.
> Is
> there a way to get R to tell me at which line it is encountering the
> problem?
> Also, what kinds of executions in my code could cause this problem? What
> should
> I be looking for in order to fix this?
>
> Thanks,
> -Nina
>
> __
> 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.
>



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

-K. Mullis

[[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] .Last() and namespace

2008-07-14 Thread Ralf Tautenhahn
Dear R-help list,

 for a package that uses Rmpi calls and a namespace,
 I need to define a .Last()  function to call mpi.finalize() - directly
before R quits.

 The hooks like on .onUnload  are not useful in this case, because they
are not executed when the R session is finished.
 
 The defined .Last() must be in the base namespace to be executed, is
there a better way  to do this  than this hack :

  eval(expr=".Last" <- function() mpi.finalize(), envir =
.BaseNamespaceEnv)   ?


Thanks!

Ralf.

__
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 question about using function plot

2008-07-14 Thread Jason Liao
Hello, everyone! I have spent two hours to get what I wanted in a simple 
situation and have not been successful. The set up is extremely simple

x = c(1,2,4,8)
y = c(1,2,3,4)
plot(x, y)

What I need, however, is for the 4 points of 1,2,4,8 to be spaced evenly, not 
by their numerical scale. Also, there should not be any other values such as 
5,6,7 marked on the axis.

So I tried the following


x = c("1","2","4","8")
y = c(1,2,3,4)
plot(x, y)

No help at all.

Anyone can point me to the right way? Thank you very much.

Jason

__
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] Off topic: Tcl/Tk outside R.

2008-07-14 Thread R P Herrold

On Mon, 14 Jul 2008, Peter Dalgaard wrote:


Rolf Turner wrote:



Can anyone give me a hint as to why it doesn't work when the the executable
script is invoked directly (from tcsh)?  Other than the fact that I'm
using a Mac :-) .

[Invoking unname -a gives ``Darwin TURNER-ROLF.local 8.11.1 Darwin Kernel
Version 8.11.1: Wed Oct 10 18:23:28 PDT 2007; 
root:xnu-792.25.20~1/RELEASE_I386 i386 i386''.]




... possibly Mac-specific. One thought:



$ cat rolf.wish
#!/usr/bin/tclsh
package require Tk
button .b -text "Press Me" -command exit
pack .b


No.  This example script works fine here on OS/X 10.4 (ppc)

emac:~/Documents herrold$ uname -a
Darwin emac.first.lan 8.11.0 Darwin Kernel Version 8.11.0: Wed 
Oct 10 18:26:00 PDT 2007; root:xnu-792.24.17~1/RELEASE_PPC 
Power Macintosh powerpc

emac:~/Documents herrold$


see:
http://www.herrold.com/wish-OSX.grab.png

ImageMagick 'import' on OS/X is giving me fits (I suspect 
because the background display is not X, but rather Apple's 
variant), so I used the Apple provided 'Grab' utility (which 
snapshots in TIFF format, copied it to a Linux box, and used 
ImageMagick's 'convert' to make the screenshot browser 
friendlier.


-- Russ herrold

__
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 question about using function plot

2008-07-14 Thread Henrique Dallazuanna
Try:

library(lattice)
xyplot(y ~ factor(x))

or

plot(1:length(x), y, xaxt='n')
axis(1, at=1:length(x), labels=x)



On Mon, Jul 14, 2008 at 12:00 PM, Jason Liao <[EMAIL PROTECTED]> wrote:
> Hello, everyone! I have spent two hours to get what I wanted in a simple 
> situation and have not been successful. The set up is extremely simple
>
> x = c(1,2,4,8)
> y = c(1,2,3,4)
> plot(x, y)
>
> What I need, however, is for the 4 points of 1,2,4,8 to be spaced evenly, not 
> by their numerical scale. Also, there should not be any other values such as 
> 5,6,7 marked on the axis.
>
> So I tried the following
>
>
> x = c("1","2","4","8")
> y = c(1,2,3,4)
> plot(x, y)
>
> No help at all.
>
> Anyone can point me to the right way? Thank you very much.
>
> Jason
>
> __
> 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.
>



-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40" S 49° 16' 22" O

__
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 question about using function plot

2008-07-14 Thread Chuck Cleland

On 7/14/2008 11:00 AM, Jason Liao wrote:

Hello, everyone! I have spent two hours to get what I wanted in a simple 
situation and have not been successful. The set up is extremely simple

x = c(1,2,4,8)
y = c(1,2,3,4)
plot(x, y)

What I need, however, is for the 4 points of 1,2,4,8 to be spaced evenly, not 
by their numerical scale. Also, there should not be any other values such as 
5,6,7 marked on the axis.

So I tried the following


x = c("1","2","4","8")
y = c(1,2,3,4)
plot(x, y)

No help at all.

Anyone can point me to the right way? Thank you very much.


x = c("1","2","4","8")
y = c(1,2,3,4)
plot(seq_along(x), y, xaxt="n", xlab="x")
axis(side=1, at=seq_along(x), labels=x)


Jason

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


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

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


Re: [R] Tissue specific genes by ANOVA?

2008-07-14 Thread icebreake

Thank's for the answer Marcelo. You are right, I'm working on microarrays
(Affymetrix).
I know the two packages you mentioned, but I have absolute know idea which
function I could use for my problem. 
-- 
View this message in context: 
http://www.nabble.com/Tissue-specific-genes-by-ANOVA--tp18441289p18447270.html
Sent from the R help mailing list archive at Nabble.com.

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


Re: [R] A question about using function plot

2008-07-14 Thread Sarah Goslee
What about making x a factor?

Sarah

On Mon, Jul 14, 2008 at 11:00 AM, Jason Liao <[EMAIL PROTECTED]> wrote:
> Hello, everyone! I have spent two hours to get what I wanted in a simple 
> situation and have not been successful. The set up is extremely simple
>
> x = c(1,2,4,8)
> y = c(1,2,3,4)
> plot(x, y)
>
> What I need, however, is for the 4 points of 1,2,4,8 to be spaced evenly, not 
> by their numerical scale. Also, there should not be any other values such as 
> 5,6,7 marked on the axis.
>
> So I tried the following
>
>
> x = c("1","2","4","8")
> y = c(1,2,3,4)
> plot(x, y)
>
> No help at all.
>
> Anyone can point me to the right way? Thank you very much.
>
> Jason


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


Re: [R] A question about using function plot

2008-07-14 Thread Robert Baer

How about:
   plot.default(factor(x), y, xaxt='n', xlab='x')
   axis(1, at=factor(x), labels=x)

- Original Message - 
From: "Jason Liao" <[EMAIL PROTECTED]>

To: 
Sent: Monday, July 14, 2008 10:00 AM
Subject: [R] A question about using function plot


Hello, everyone! I have spent two hours to get what I wanted in a simple 
situation and have not been successful. The set up is extremely simple


x = c(1,2,4,8)
y = c(1,2,3,4)
plot(x, y)

What I need, however, is for the 4 points of 1,2,4,8 to be spaced evenly, 
not by their numerical scale. Also, there should not be any other values 
such as 5,6,7 marked on the axis.


So I tried the following


x = c("1","2","4","8")
y = c(1,2,3,4)
plot(x, y)

No help at all.

Anyone can point me to the right way? Thank you very much.

Jason

__
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] applying complex functions by groups

2008-07-14 Thread jim holtman
can you  provide commented, minimal, self-contained, reproducible
code.  Exactly what statements are you using.  Normally I would use
'split' to partition the data and then 'lapply' to work on each of the
groups.  An idea of what type of processing you have tried and what
your expectation of output (given a specific input) would be.

On Mon, Jul 14, 2008 at 10:39 AM, Finch, W. Holmes <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have a matrix that is indexed by groups and looks something like this:
>
> 1 1 2
> 1 2 1
> .
> .
> .
> 2 1 1
> 2 1 2
> 2 NA 1
> .
> .
> .
> 3 1 NA
> 3 2 NA
> etc.
>
> The first column is the group variable and I would like to apply categorical 
> data imputation functions to the other two columns, doing so by groups.  I 
> have tried APPLY, BY and SPLIT, but have not had much luck getting it to 
> work.  I wonder if anyone has suggestions for how I might do this kind of by 
> groups processing.  Thanks very much.
>
> Holmes
>
>
> Holmes Finch
> Associate Professor
> Director of Research, Office of Charter School Research
> Department of Educational Psychology
> Ball State University
> Muncie, IN  47306
> (765) 285-3668
>
> My favorite quote:
>
> "I was gently accused of escapism during a TV interview about a book I had 
> written on my length-of-California walk. Frankly, I fail to see how going for 
> a six-month, thousand-mile walk through deserts and mountains can be judged 
> less real than spending six months working eight hours a day, five days a 
> week, in order to earn enough money to be able to come back home to a 
> comfortable home in the evening and sit in front of a TV screen and watch the 
> two-dimensional image of some guy talking about a book he has written on a 
> six-month, thousand-mile walk through deserts and mountains."
>
> Colin Fletcher (1922-2007), renowned hiker and outdoor writer
>
> __
> 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
Cincinnati, OH
+1 513 646 9390

What is the problem 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] A question about using function plot

2008-07-14 Thread Richard M. Heiberger
Your x values look to be multiples of two, therefore you might
be interested in using log values for the x axis.

x = c(1,2,4,8) 
y = c(1,2,3,4) 
plot(x, y, log="x", xaxt='n')
axis(1, at=x, labels=x)

__
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 Commander question

2008-07-14 Thread Darin Brooks
Good afternoon
 
New to R ... new to the list.
 
I have installed R Commander 1.2-9 and it functions perfectly.  I would,
however, like to upgrade my Rcmdr to version 1.3-15 ... but I can't seem to
shake the 1.2 version.  Do you have any tips on how to upgrade?
 
Thanks for your time and consideration
 
Darin Brooks
Geomatics/GIS/Remote Sensing Coordinator
Kim Forest Management Ltd. Cranbrook Office
Cranbrook, BC
 
 


Checked by AVG. 

5:58 PM
 

[[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] dll problem

2008-07-14 Thread stephenb

I am trying to load a dll compiled with the latest cygwin into R 2.7.0
R version 2.7.0 (2008-04-22)
Copyright (C) 2008 The R Foundation for Statistical Computing
ISBN 3-900051-07-0

I have:
Sys.getenv("Path")

 
Path
"C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Program
Files\\MBTrading\\MBT Navigator;C:\\Program
Files\\R\\R-2.7.0\\bin;C:\\cygwin\\bin"

the source is:
!!! f1.f
   SUBROUTINE f1(a)

  INTEGER :: a, i
  a=2

  RETURN

  END SUBROUTINE f1

compiled by

g77 -shared -o f1.dll f1.f

R freezes and I have to kill it with task manager
when I try:
dyn.load("f1.dll")

Please, help.
-- 
View this message in context: 
http://www.nabble.com/dll-problem-tp18448005p18448005.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] Backslash in sub pattern?

2008-07-14 Thread Stephan Kolassa

Dear guRus,

I am trying to replace "~" by "$\sim$" for TeX. However, I can't get the 
backslash to work. I would like to turn "DV~IV" into "DV$\sim$IV".


sub("~","$\sim$","DV~IV") => "DV$sim$IV"
sub("~","$\\sim$","DV~IV") => "DV$sim$IV"
sub("~","$\\\sim$","DV~IV") => "DV$sim$IV"
sub("~","$sim$","DV~IV") => "DV$\\sim$IV"

Alternatives 1 and 3 also yield warnings about unknown escape sequences 
(no surprise there). I have been unsuccessfully searching the archives. 
sessionInfo below.


Thank you all for your time!

Best regards
Stephan


> sessionInfo()
R version 2.7.1 (2008-06-23)
i386-pc-mingw32

locale:
LC_COLLATE=German_Germany.1252;LC_CTYPE=German_Germany.1252;LC_MONETARY=German_Germany.1252;LC_NUMERIC=C;LC_TIME=German_Germany.1252

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


other attached packages:
[1] svIDE_0.9-5

loaded via a namespace (and not attached):
[1] svMisc_0.9-5

__
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] Backslash in sub pattern?

2008-07-14 Thread Marc Schwartz

on 07/14/2008 01:09 PM Stephan Kolassa wrote:

Dear guRus,

I am trying to replace "~" by "$\sim$" for TeX. However, I can't get the 
backslash to work. I would like to turn "DV~IV" into "DV$\sim$IV".


sub("~","$\sim$","DV~IV") => "DV$sim$IV"
sub("~","$\\sim$","DV~IV") => "DV$sim$IV"
sub("~","$\\\sim$","DV~IV") => "DV$sim$IV"
sub("~","$sim$","DV~IV") => "DV$\\sim$IV"

Alternatives 1 and 3 also yield warnings about unknown escape sequences 
(no surprise there). I have been unsuccessfully searching the archives. 
sessionInfo below.


Thank you all for your time!

Best regards
Stephan


You want door number 4 because when the double escape is cat()'d to the 
.tex file, you get:


> cat("DV$\\sim$IV", "\n")
DV$\sim$IV

which is what you want latex to process.

HTH,

Marc Schwartz

__
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] Sweave, backslash in sub pattern? was: Backslash in sub pattern?

2008-07-14 Thread Stephan Kolassa

Phil:

thanks a lot! However, my original problem[1] remains: in fact, I am 
trying to \Sexpr the result for Sweave, and for some reason Sweave 
regurgitates the \Sexpr command unchanged:


foo.Rnw contains:
\Sexpr{"DV~IV"}
\Sexpr{cat("DV~IV")}
\Sexpr{sub('~','$sim$',"DV~IV")}
\Sexpr{cat(sub('~','$sim$',"DV~IV"),"\n")}

After Sweave(foo) the file foo.tex then contains:
\usepackage{Sweave}
DV~IV

\Sexpr{sub('~','$sim$',"DV~IV")}
\Sexpr{cat(sub('~','$sim$',"DV~IV"),"\n")}

(yes, with the blank line resulting from \Sexpr{cat("DV~IV")}), and 
LaTeX understandably complains that \Sexpr is not a valid command.


My goal: I would like to use some function bar() so that

str <- "DV~IV"
\Sexpr{bar(str)}

yields after Sweaving

DV$\sim$IV

in the tex file.

Any thoughts?
Stephan


[1] Sorry, I now see that my commented, minimal, self-contained, 
reproducible code was too minimal... I reduced the problem too far. My bad!




Phil Spector schrieb:

Stephen -
Since the print function in R always displays two backslashes
for a single one, you really need to use cat or nchar to make sure
that things are working:


sub('~','$sim$',str)

[1] "ab$\\sim$cd"

cat(sub('~','$sim$',str),"\n")

ab$\sim$cd

It's the result of cat that's actually output, not the string that
R uses to display it.


   - Phil Spector
 Statistical Computing Facility
 Department of Statistics
 UC Berkeley
 [EMAIL PROTECTED]


On Mon, 14 Jul 2008, Stephan Kolassa wrote:


Dear guRus,

I am trying to replace "~" by "$\sim$" for TeX. However, I can't get 
the backslash to work. I would like to turn "DV~IV" into "DV$\sim$IV".


sub("~","$\sim$","DV~IV") => "DV$sim$IV"
sub("~","$\\sim$","DV~IV") => "DV$sim$IV"
sub("~","$\\\sim$","DV~IV") => "DV$sim$IV"
sub("~","$sim$","DV~IV") => "DV$\\sim$IV"

Alternatives 1 and 3 also yield warnings about unknown escape 
sequences (no surprise there). I have been unsuccessfully searching 
the archives. sessionInfo below.


Thank you all for your time!

Best regards
Stephan



sessionInfo()

R version 2.7.1 (2008-06-23)
i386-pc-mingw32

locale:
LC_COLLATE=German_Germany.1252;LC_CTYPE=German_Germany.1252;LC_MONETARY=German_Germany.1252;LC_NUMERIC=C;LC_TIME=German_Germany.1252 



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


other attached packages:
[1] svIDE_0.9-5

loaded via a namespace (and not attached):
[1] svMisc_0.9-5

__
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] Analysis of poorly replicated array data

2008-07-14 Thread Eli Meyer
Greetings,

I have "inherited" a cDNA macroarray dataset that is structured as follows.
Three different stressors were tested.  For each stressor, there are two
treatments (control and stressed).  For each treatment, two biological
replicates exist, and these are paired (i.e., there is a stressed array for
colony A and a control array from this same colony).  For one of these
samples, duplicate arrays were performed (technical replicates).  This works
out to 18 different arrays corresponding to 12 independant biological
replicates.  But counting only the biological replicates for each stressor,
there are only n=2 stressed arrays and n=2 control arrays.

I am pretty well versed in the analysis of array data using R, but obviously
this dataset presents a real challenge because of the low replication.  For
logistical reasons, increasing the sample size is not a possibility.  My
main goal here is to salvage whatever valid findings can be salvaged from
the existing data, but I dont want to go too far in claiming significance
for an expression pattern if there isnt really anystatistical support for
it.

My questions are:
(1) Whether it is even possible to statistically compare the effects of
these stressors on gene expression,
(2) If so, what are folks' recomendations?
(3) Obviously low sample size means low statistical power, but I have always
been told that calculating variance for n=2 and doing stats on that basis is
not even mathematically valid.  Can anyone confirm or refute this?

Thank you for any advice you may have to offer,

-- 
Eli Meyer
Postdoctoral Fellow
Department of Integrative Biology
University of Texas at Austin
Austin, TX 78712
office: (512) 475-6424
cell: (310) 618-4483

[[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] Sweave, backslash in sub pattern? was: Backslash in sub pattern?

2008-07-14 Thread Duncan Murdoch

On 7/14/2008 2:39 PM, Stephan Kolassa wrote:

Phil:

thanks a lot! However, my original problem[1] remains: in fact, I am 
trying to \Sexpr the result for Sweave, and for some reason Sweave 
regurgitates the \Sexpr command unchanged:


foo.Rnw contains:
\Sexpr{"DV~IV"}
\Sexpr{cat("DV~IV")}
\Sexpr{sub('~','$sim$',"DV~IV")}
\Sexpr{cat(sub('~','$sim$',"DV~IV"),"\n")}



The \Sexpr{} form is limited in what it can handle; it's probably 
getting confused by all those escapes.  Here's a way to do it that works 
for me:


<<>>=
Fixtilde <- function(x) sub('~','$sim$',x)
@

Here it is:  \Sexpr{Fixtilde("DV~IV")}.


I haven't traced through the code to see why I need 8 escapes so that 
one makes it through to the .tex file, but that's what appears to work.


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] dll problem

2008-07-14 Thread Prof Brian Ripley

This question has already been answered on R-devel.

In any case, the correct procedure is discussed in the 'R Installation and 
Administration Manual', and does not involve 'cygwin'.


On Mon, 14 Jul 2008, stephenb wrote:



I am trying to load a dll compiled with the latest cygwin into R 2.7.0
R version 2.7.0 (2008-04-22)
Copyright (C) 2008 The R Foundation for Statistical Computing
ISBN 3-900051-07-0

I have:
Sys.getenv("Path")

Path
"C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Program
Files\\MBTrading\\MBT Navigator;C:\\Program
Files\\R\\R-2.7.0\\bin;C:\\cygwin\\bin"

the source is:
!!! f1.f
  SUBROUTINE f1(a)

 INTEGER :: a, i
 a=2

 RETURN

 END SUBROUTINE f1

compiled by

g77 -shared -o f1.dll f1.f

R freezes and I have to kill it with task manager
when I try:
dyn.load("f1.dll")

Please, help.
--
View this message in context: 
http://www.nabble.com/dll-problem-tp18448005p18448005.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.



--
Brian D. Ripley,  [EMAIL PROTECTED]
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] Sweave, backslash in sub pattern? was: Backslash in sub pattern?

2008-07-14 Thread Stephan Kolassa

Duncan,

thank you, that works perfectly! And a big thank you also to all others 
who helped! I'm back to Sweaving!


Best wishes
Stephan


Duncan Murdoch schrieb:

On 7/14/2008 2:39 PM, Stephan Kolassa wrote:

Phil:

thanks a lot! However, my original problem[1] remains: in fact, I am 
trying to \Sexpr the result for Sweave, and for some reason Sweave 
regurgitates the \Sexpr command unchanged:


foo.Rnw contains:
\Sexpr{"DV~IV"}
\Sexpr{cat("DV~IV")}
\Sexpr{sub('~','$sim$',"DV~IV")}
\Sexpr{cat(sub('~','$sim$',"DV~IV"),"\n")}



The \Sexpr{} form is limited in what it can handle; it's probably 
getting confused by all those escapes.  Here's a way to do it that works 
for me:


<<>>=
Fixtilde <- function(x) sub('~','$sim$',x)
@

Here it is:  \Sexpr{Fixtilde("DV~IV")}.


I haven't traced through the code to see why I need 8 escapes so that 
one makes it through to the .tex file, but that's what appears to work.


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] Sweave, backslash in sub pattern? was: Backslash in sub pattern?

2008-07-14 Thread Marc Schwartz

on 07/14/2008 01:39 PM Stephan Kolassa wrote:

Phil:

thanks a lot! However, my original problem[1] remains: in fact, I am 
trying to \Sexpr the result for Sweave, and for some reason Sweave 
regurgitates the \Sexpr command unchanged:


foo.Rnw contains:
\Sexpr{"DV~IV"}
\Sexpr{cat("DV~IV")}
\Sexpr{sub('~','$sim$',"DV~IV")}
\Sexpr{cat(sub('~','$sim$',"DV~IV"),"\n")}

After Sweave(foo) the file foo.tex then contains:
\usepackage{Sweave}
DV~IV

\Sexpr{sub('~','$sim$',"DV~IV")}
\Sexpr{cat(sub('~','$sim$',"DV~IV"),"\n")}

(yes, with the blank line resulting from \Sexpr{cat("DV~IV")}), and 
LaTeX understandably complains that \Sexpr is not a valid command.


My goal: I would like to use some function bar() so that

str <- "DV~IV"
\Sexpr{bar(str)}

yields after Sweaving

DV$\sim$IV

in the tex file.

Any thoughts?
Stephan


[1] Sorry, I now see that my commented, minimal, self-contained, 
reproducible code was too minimal... I reduced the problem too far. My bad!




Phil Spector schrieb:

Stephen -
Since the print function in R always displays two backslashes
for a single one, you really need to use cat or nchar to make sure
that things are working:


sub('~','$sim$',str)

[1] "ab$\\sim$cd"

cat(sub('~','$sim$',str),"\n")

ab$\sim$cd

It's the result of cat that's actually output, not the string that
R uses to display it.


   - Phil Spector
 Statistical Computing Facility
 Department of Statistics
 UC Berkeley
 [EMAIL PROTECTED]


On Mon, 14 Jul 2008, Stephan Kolassa wrote:


Dear guRus,

I am trying to replace "~" by "$\sim$" for TeX. However, I can't get 
the backslash to work. I would like to turn "DV~IV" into "DV$\sim$IV".


sub("~","$\sim$","DV~IV") => "DV$sim$IV"
sub("~","$\\sim$","DV~IV") => "DV$sim$IV"
sub("~","$\\\sim$","DV~IV") => "DV$sim$IV"
sub("~","$sim$","DV~IV") => "DV$\\sim$IV"

Alternatives 1 and 3 also yield warnings about unknown escape 
sequences (no surprise there). I have been unsuccessfully searching 
the archives. sessionInfo below.


Thank you all for your time!

Best regards
Stephan



sessionInfo()

R version 2.7.1 (2008-06-23)
i386-pc-mingw32

locale:
LC_COLLATE=German_Germany.1252;LC_CTYPE=German_Germany.1252;LC_MONETARY=German_Germany.1252;LC_NUMERIC=C;LC_TIME=German_Germany.1252 



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


other attached packages:
[1] svIDE_0.9-5

loaded via a namespace (and not attached):
[1] svMisc_0.9-5


Stephan,

Try running Sweave on the file without SciViews loaded. There have been 
some posts over the past few years, with one relatively recently, 
indicating that there can be package conflicts resulting in \Sexpr{}'s 
not being parsed properly. The key package in question in the past has 
been R2HTML, but perhaps svIDE et al are the culprits here. The conflict 
is due to an alternative or supplemental Sweave driver being loaded.


See FAQ A.18 here:

http://www.statistik.lmu.de/~leisch/Sweave/FAQ.html


It may also be that your code within the \Sexpr{} is overly complicated, 
in which case, move the text processing outside the \Sexpr and then just 
use the result within it:


Res <- sub('~','$sim$',"DV~IV")
\Sexpr{Res}


HTH,

Marc Schwartz

__
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] Difficultes with grep

2008-07-14 Thread Fran100681

Thank you very much for all messages and answers, it's ok now :)



Charles C. Berry wrote:
> 
> On Sun, 13 Jul 2008, Fran100681 wrote:
> 
>>
>> Thank you, but this is not what i want exactly.. i would want to launch
>> function "myfun" with this script:
>>
>>> table <- sample(LETTERS[1:5], 20,TRUE)
>>>
>>> name <- "A"
>>>
>>> myfun <- function(name) {
>> + r <- grep (name[^0-9], table )
> ...XX
> 
> 
> This is not correct syntax. And likely R told you so.
> 
> If you intend "name[^0-9]" to be read as character, you need to quote it.
> 
> Perhaps you want a more complicated regex than the one Jim handed you, 
> like
> 
>   name <- "A[^0-9]"
> 
> ??
> 
> 
>> + return (r) }
>>
>> but if I do it ,R doesn't accept this.. i want this because i have in
>> "table" (a data frame) ,a list of element that are "hsa-mir-N" (when N is
>> any number)..so, if i put in argument "name" this is: "hsa-mir-70"
>> ,function
>> matches hsa-mir-70, but also (for instance) hsa-mir-700, 710 724 and so
>> on... infact i insert a square brackets ^0-9 to exclude any other number
>> after those i have given (in "name").. It's a little complex situation..
>> :(
>>
>> p.s: i can't put in "name" simply: hsa-mir-20 to match all hsa-mir-20 in
>> the
>> data frame because i need to match hsa-mir-20 but also (for instance)
>> hsa-mir-20-3... or hsa-mir-20b, hsa-mir-20a. and not those elements
>> with
>> another number after the 20
>>
>>
>> jholtman wrote:
>>>
>>> I think this is what you want
>>>
 table <- sample(LETTERS[1:5], 20,TRUE)

 name <- "A"

 myfun <- function(name) {
>>> + r <- grep (name, table )
>>> + return (r) }

 myfun(name)
>>> [1]  4  7 14 18
 table
>>>  [1] "E" "B" "D" "A" "B" "B" "A" "B" "E" "B" "C" "C" "C" "A" "E" "D"
>>> "D" "A" "D" "C"

>>>
>>>
>>> On Fri, Jul 11, 2008 at 1:57 PM, Fran100681 <[EMAIL PROTECTED]>
>>> wrote:

 Hello everybody!

 I'm using R and I have a little problem about function "grep". I 've
 got
 to
 make a new function in which "grep" is present. So the first argument
 of
 "grep" is the string we want to find,ok..but in this case I define a
 function "x" before , x receives an argument in a object "name" (for
 instance), then inside function "x" ,i  define a grep.. so i want to
 set
 as
 pattern (1st argument of grep)  what i put in "name" and not the string
 "name"... how do i do that?

 ex:
 name <- "Tom"

 myfun <- function(name) {
 r <- grep ("name", table )
 return (r) }
 It returns nothing because it searches the word "name" in "table"
 rather
 "Tom"...
 I hope to receive some little help because this is stopping me in my
 projcet
 :/ ... i m'not able to reach a solution! Thanks a lot!
 --
 View this message in context:
 http://www.nabble.com/Difficultes-with-grep-tp18409347p18409347.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
>>> Cincinnati, OH
>>> +1 513 646 9390
>>>
>>> What is the problem 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.
>>>
>>>
>>
>> -- 
>> View this message in context:
>> http://www.nabble.com/Difficultes-with-grep-tp18409347p18428404.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.
>>
> 
> Charles C. Berry(858) 534-2098
>  Dept of Family/Preventive
> Medicine
> E mailto:[EMAIL PROTECTED]UC San Diego
> http://famprevmed.ucsd.edu/faculty/cberry/  La Jolla, San Diego 92093-0901
> 
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Difficultes-with-grep-tp18409347p18451185.html
Sent from the R help mailing list archive at Nabble.com.

_

[R] .First and .Rprofile won't run on startup

2008-07-14 Thread Susan Amrose
I'm trying to source a file automatically every time I start R. I tried
adding the following .First function in a file Rprofile.site in my
$R_HOME/etc/ directory (verified $R_HOME by Sys.getenv()) as well as in a
file .Rprofile in my $HOME directory and .Rprofile in the working directory:
.First <- function(){
source(file.path(Sys.getenv("HOME"), "R", "functions","standard.r"))
   cat("Actually read your file")
}

- but no luck. I'm using a Mac (OS 10.4). It never runs (the file is not
sourced and the text does not appear). Does anyone have any suggestions?

Ideally, I would like to have a directory and source all the files in the
directory in startup, but this is just a first step (is that possible?).

Thanks in advance!!
 -Susan

[[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] Off topic: Tcl/Tk outside R.

2008-07-14 Thread Rolf Turner


On 14/07/2008, at 7:15 PM, Peter Dalgaard wrote:



Odd... That _does_ actually work for me, so I guess the issue is  
Mac-specific. One thought:
Tcl is like R;  a core language where you load packages in order to  
do any real work and wish is just Tcl with the Tk package  
preloaded. I.e., the following also works for me


$ cat rolf.wish
#!/usr/bin/tclsh
package require Tk
button .b -text "Press Me" -command exit
pack .b


***That*** does indeed work!  Thanks.  But it's still mysterious,  
isn't it?
The invocation ``#!/usr/bin/tclsh'' is recognized but ``#!/usr/bin/ 
wish'' seems

to be ignored.  Both ``tclsh'' and ``wish'' are executables in /usr/bin.
(Actually they are both symbolic links to tclsh8.4 and wish8.4  
respectively.)


Anyway --- I've got *something* working, and that is a Good Thing.

Thanks again.

cheers,

Rolf

##
Attention:\ This e-mail message is privileged and confid...{{dropped:9}}

__
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] any way to set defaults for par?

2008-07-14 Thread Greg Snow
Write a function that opens a new graphics window (quartz in your case) then 
changes the parameters to what you want as the default.  Then any time you 
want/need a new graphics window, call your function.

Also look at ?options and scroll down to 'device' and ?Startup

Hope this helps,

--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
[EMAIL PROTECTED]
(801) 408-8111



> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Carl Witthoft
> Sent: Sunday, July 13, 2008 4:31 PM
> To: r-help@r-project.org
> Subject: [R] any way to set defaults for par?
>
> I know how to set graphic parameters by calling par(), but
> what I'd like is a way to set the default values so that
> subsequent calls to par() use my defaults.  The reason to
> want this is that every time I create a new graphic window
> (I'm using quartz on OSX, and so far no answers in the Mac
> mailing list), my parameters get reset to the builtin defaults.
> I read about the "unexported variable .Pars," but would like
> to know if there's any way to manipulate that variable.
>
> thanks
> Carl
>
> __
> 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] .First and .Rprofile won't run on startup

2008-07-14 Thread Rolf Turner


On 15/07/2008, at 6:34 AM, Susan Amrose wrote:

I'm trying to source a file automatically every time I start R. I  
tried

adding the following .First function in a file Rprofile.site in my
$R_HOME/etc/ directory (verified $R_HOME by Sys.getenv()) as well  
as in a
file .Rprofile in my $HOME directory and .Rprofile in the working  
directory:

.First <- function(){
source(file.path(Sys.getenv("HOME"), "R", "functions","standard.r"))
   cat("Actually read your file")
}

- but no luck. I'm using a Mac (OS 10.4). It never runs (the file  
is not
sourced and the text does not appear). Does anyone have any  
suggestions?


Ideally, I would like to have a directory and source all the files  
in the
directory in startup, but this is just a first step (is that  
possible?).


I just tried your example, i.e. I put your definition of .First()  
into my
.Rprofile (after creating a directory ``R'' in my home directory, a  
subdirectory

of that called ``functions'', and a file in that called ``standard.r'').

Started R, and ``standard.r'' was sourced --- no problema.  I too am  
running on

a Mac --- darwin8.10.1.

So --- it's another Mac mystery. :-(  Sorry that I can't be more  
helpful.


cheers,

Rolf Turner

##
Attention:\ This e-mail message is privileged and confid...{{dropped:9}}

__
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] Tissue specific genes by ANOVA?

2008-07-14 Thread Marcelo Luiz de Laia
icebreake  web.de> writes:

> 
> 
> Thank's for the answer Marcelo. You are right, I'm working on microarrays
> (Affymetrix).
> I know the two packages you mentioned, but I have absolute know idea which
> function I could use for my problem. 

Dear Icebreake,

I'm a biologists and I didn't have knowledge to help you. But, you could try to
address your questions to [EMAIL PROTECTED]

Absolutely, someone will help you. In that project there are a lot of expert on
microarrays analysis.

I hope this help you

Cheers

Marcelo
Brazil

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


Re: [R] Analysis of poorly replicated array data

2008-07-14 Thread Wolfgang Huber

Hi Eli


I have "inherited" a cDNA macroarray dataset that is structured as follows.
Three different stressors were tested.  For each stressor, there are two
treatments (control and stressed).  For each treatment, two biological
replicates exist, and these are paired (i.e., there is a stressed array for
colony A and a control array from this same colony).  For one of these
samples, duplicate arrays were performed (technical replicates).  This works
out to 18 different arrays corresponding to 12 independant biological
replicates.  But counting only the biological replicates for each stressor,
there are only n=2 stressed arrays and n=2 control arrays.

I am pretty well versed in the analysis of array data using R, but obviously
this dataset presents a real challenge because of the low replication.  For
logistical reasons, increasing the sample size is not a possibility.  My
main goal here is to salvage whatever valid findings can be salvaged from
the existing data, but I dont want to go too far in claiming significance
for an expression pattern if there isnt really anystatistical support for
it.

My questions are:
(1) Whether it is even possible to statistically compare the effects of
these stressors on gene expression,
(2) If so, what are folks' recomendations?
(3) Obviously low sample size means low statistical power, but I have always
been told that calculating variance for n=2 and doing stats on that basis is
not even mathematically valid.  Can anyone confirm or refute this?


Sample variance is an unbiased estimator of variance for any n>1, so I 
am not sure what you mean by "mathematically valid". It can be quite 
variable though. This is why "moderated t-statistics" [e.g. 1,2] are 
popular in microarray analysis, where the variance estimation in t-like 
statistics is shared across genes, paying a small bias for a big gain in 
precision.


However, you might want to bear in mind that the variability (and hence 
variance) that you observe between replicates within your experiment may 
be a poor representation of the variability that you would see if 
someone independently replicated the experiment. It would not be wise to 
expect statistics to somehow magically extrapolate from one to the 
other. So rather than aiming to "claim significance" you could aim for 
generating biological hypotheses that you could then try to corroborate 
using other means (integrating data from other experiments, literature 
search, followup experiment).



[1] Linear Models and Empirical Bayes Methods for Assessing Differential 
Expression in Microarray Experiments, Gordon K. Smyth

http://www.bepress.com/sagmb/vol3/iss1/art3

[2] Differential Expression with the Bioconductor Project
Anja von Heydebreck, Wolfgang Huber, Robert Gentleman
http://www.bepress.com/bioconductor/paper7


Best wishes
Wolfgang
--

Wolfgang Huber, EMBL-EBI, http://www.ebi.ac.uk/huber

__
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] Off topic: Tcl/Tk outside R.

2008-07-14 Thread Rolf Turner


On 15/07/2008, at 4:07 AM, R P Herrold wrote:


On Mon, 14 Jul 2008, Peter Dalgaard wrote:


Rolf Turner wrote:


Can anyone give me a hint as to why it doesn't work when the the  
executable
script is invoked directly (from tcsh)?  Other than the fact that  
I'm

using a Mac :-) .
[Invoking unname -a gives ``Darwin TURNER-ROLF.local 8.11.1  
Darwin Kernel
Version 8.11.1: Wed Oct 10 18:23:28 PDT 2007;  
root:xnu-792.25.20~1/RELEASE_I386 i386 i386''.]




... possibly Mac-specific. One thought:



$ cat rolf.wish
#!/usr/bin/tclsh
package require Tk
button .b -text "Press Me" -command exit
pack .b


No.  This example script works fine here on OS/X 10.4 (ppc)

emac:~/Documents herrold$ uname -a
Darwin emac.first.lan 8.11.0 Darwin Kernel Version 8.11.0: Wed Oct  
10 18:26:00 PDT 2007; root:xnu-792.24.17~1/RELEASE_PPC Power  
Macintosh powerpc

emac:~/Documents herrold$


see:
http://www.herrold.com/wish-OSX.grab.png


Yeah, well I see that it works for you --- but it doesn't work for me!
I.e. my original script doesn't work, but Peter D.'s modification  
does work.


Dang! Why are ``they'' always picking on me? :-)

cheers,

Rolf Turner

##
Attention:\ This e-mail message is privileged and confid...{{dropped:9}}

__
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] .First and .Rprofile won't run on startup

2008-07-14 Thread Bryan Hanson
I accomplish this a little differently.

On the mac, in your home directory (e.g. /Users/susanamrose) there is/could
be a hidden file called .Rprofile  You can edit it with vi for instance by
getting a terminal window and >vi .Rprofile  It will be created it if it
doesn't exist.

I keep all my local functions in a particular directory, then load them via
the .Rprofile by putting the following lines in .Rprofile

funcdir <- "/Users/susanamrose/Functions"
z <- paste(funcdir, "/LoadFunctions.R", sep = "")
source(z, chdir = TRUE)

This will source/execute whatever you put in the file LoadFunctions.R in the
specified directory when R starts up.  So, for instance, LoadFunctions.R
could be a bunch of source("func.R") statements.

This also gives you a short cut to get to your functions directory by
setwd(fundir).  I actually have a number of commonly used directories
defined this way for convenience.

HTH Bryan

On 7/14/08 2:34 PM, "Susan Amrose" <[EMAIL PROTECTED]> wrote:

> I'm trying to source a file automatically every time I start R. I tried
> adding the following .First function in a file Rprofile.site in my
> $R_HOME/etc/ directory (verified $R_HOME by Sys.getenv()) as well as in a
> file .Rprofile in my $HOME directory and .Rprofile in the working directory:
> .First <- function(){
> source(file.path(Sys.getenv("HOME"), "R", "functions","standard.r"))
>cat("Actually read your file")
> }
> 
> - but no luck. I'm using a Mac (OS 10.4). It never runs (the file is not
> sourced and the text does not appear). Does anyone have any suggestions?
> 
> Ideally, I would like to have a directory and source all the files in the
> directory in startup, but this is just a first step (is that possible?).
> 
> Thanks in advance!!
>  -Susan
> 
> [[alternative HTML version deleted]]
> 
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

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


[R] statistics question about a statement in julian faraway's "extending the linear model with R" text

2008-07-14 Thread markleeds
In Julian Faraway's text on pgs 117-119, he gives a very nice, pretty 
simple description of how a glm can be thought of as linear model
with non constant variance. I just didn't understand one of his 
statements  on the top of 118. To quote :


"We can use a similar idea to fit a GLM. Roughly speaking, we want to 
regress g(y) on X with weights inversely proportional
to var(g(y). However, g(y) might not make sense in some cases - for 
example in the binomial GLM. So we linearize g(y)
as follows: Let eta = g(mu) and mu = E(Y). Now do a one step expanation 
, blah, blah, blah.


Could someone explain ( briefly is fine ) what he means by g(y) might 
not make sense in some cases - for example in the binomial

GLM ?

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.


Re: [R] R Commander question

2008-07-14 Thread John Kane
What OS?


--- On Mon, 7/14/08, Darin Brooks <[EMAIL PROTECTED]> wrote:

> From: Darin Brooks <[EMAIL PROTECTED]>
> Subject: [R] R Commander question
> To: r-help@r-project.org
> Received: Monday, July 14, 2008, 1:56 PM
> Good afternoon
>  
> New to R ... new to the list.
>  
> I have installed R Commander 1.2-9 and it functions
> perfectly.  I would,
> however, like to upgrade my Rcmdr to version 1.3-15 ... but
> I can't seem to
> shake the 1.2 version.  Do you have any tips on how to
> upgrade?
>  
> Thanks for your time and consideration
>  
> Darin Brooks
> Geomatics/GIS/Remote Sensing Coordinator
> Kim Forest Management Ltd. Cranbrook Office
> Cranbrook, BC
>  
>  
> 
> 
> Checked by AVG. 
> 
> 5:58 PM
>  
> 
>   [[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.


  __
[[elided Yahoo spam]]

__
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] shapiro wilk normality test

2008-07-14 Thread Greg Snow
For those people who feel the need for a p-value to test normality on large 
sample sizes, I propose the following test/function:

SnowsPenultimateNormalityTest <- function(x){

# the following function works for current implementations of R
# to my knowledge, eventually it may need to be expanded
is.rational <- function(x){
rep( TRUE, length(x) )
}

tmp.p <- if( any(is.rational(x))) {
0
} else {
# current implementation will not get here
# this part is reserved for the ultimate test
1
}

out <- list(
p.value = tmp.p,
alternative = strwrap(paste('The data does not come from a',
'strict normal distribution (but may represent a distribution',
'that is close enough)'), prefix="\n\t"),
method = "Snow's Penultimate Normality Test",
data.name = deparse(substitute(x))
)

class(out) <- 'htest'
out
}


Now that the need for a p-value is satisfied, we can get onto the more useful 
questions mentioned in this thread and other places.

--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
[EMAIL PROTECTED]
(801) 408-8111



> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Bunny,
> lautloscrew.com
> Sent: Saturday, July 12, 2008 10:20 AM
> To: Mark Leeds
> Cc: r-help@r-project.org
> Subject: Re: [R] shapiro wilk normality test
>
> Hmm thanks,
> But on the other hand it just says i cant reject normality,
> which doesnt really mean it is normal. Wouldn´t be nice to
> test for non- normality ? if i´d reject that a high level i
> could be pretty sure it ´s normal... ??
>
> thanks in advance
>
> matthias
> Am 12.07.2008 um 18:10 schrieb Mark Leeds:
>
> > Hi: If normality is the HO, then the test below says don't reject (
> > large p value ).  Check out any multivariate text for what
> the null of
> > the shapiro test is. I don't know for sure but, from below, it sure
> > looks like HO is normality. Or google for it.
> >
> >
> >
> > -Original Message-
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED]
> > ] On
> > Behalf Of Bunny, lautloscrew.com
> > Sent: Saturday, July 12, 2008 11:30 AM
> > To: r-help@r-project.org
> > Subject: [R] shapiro wilk normality test
> >
> > Hi everybody,
> >
> > somehow i dont get the shapiro wilk test for normality. i
> just can´t
> > find what the H0 is .
> >
> > i tried :
> >
> >  shapiro.test(rnorm(5000))
> >
> >   Shapiro-Wilk normality test
> >
> > data:  rnorm(5000)
> > W = 0.9997, p-value = 0.6205
> >
> >
> > If normality is the H0, the test says it´s probably not
> normal, doesn
> > ´t it ?
> >
> > 5000 is the biggest n allowed by the test...
> >
> > are there any other test ? ( i know qqnorm already ;)
> >
> > thanks in advance
> >
> > matthias
> > __
> > 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-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 Commander question

2008-07-14 Thread Darin Brooks
Windows XP Pro

-Original Message-
From: John Kane [mailto:[EMAIL PROTECTED] 
Sent: Monday, July 14, 2008 2:57 PM
To: r-help@r-project.org; Darin Brooks
Subject: Re: [R] R Commander question

What OS?


--- On Mon, 7/14/08, Darin Brooks <[EMAIL PROTECTED]> wrote:

> From: Darin Brooks <[EMAIL PROTECTED]>
> Subject: [R] R Commander question
> To: r-help@r-project.org
> Received: Monday, July 14, 2008, 1:56 PM Good afternoon
>  
> New to R ... new to the list.
>  
> I have installed R Commander 1.2-9 and it functions perfectly.  I 
> would, however, like to upgrade my Rcmdr to version 1.3-15 ... but I 
> can't seem to shake the 1.2 version.  Do you have any tips on how to 
> upgrade?
>  
> Thanks for your time and consideration
>  
> Darin Brooks
> Geomatics/GIS/Remote Sensing Coordinator Kim Forest Management Ltd. 
> Cranbrook Office Cranbrook, BC
>  
>  
> 
> 
> Checked by AVG. 
> 
> 5:58 PM
>  
> 
>   [[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.


  __
Yahoo! Canada Toolbar: Search from anywhere on the web, and bookmark your
favourite sites. Download it now at http://ca.toolbar.yahoo.com.

No virus found in this incoming message.
Checked by AVG. 

5:58 PM
 


Checked by AVG. 

5:58 PM

__
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] statistics question about a statement in julian faraway's "extending the linear model with R" text

2008-07-14 Thread Greg Snow
For the binomial the standard link function is the logit:

g(y) = log( y/(1-y) )

In the binomial glm model the observed y values are 0, or 1 which give g(0) = 
-Inf and g(1) = Inf.  Switching to g(mu) with  0 < mu < 1 results in finite 
values which are much easier for the computer to work with.

Hope this helps,

--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
[EMAIL PROTECTED]
(801) 408-8111



> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of
> [EMAIL PROTECTED]
> Sent: Monday, July 14, 2008 2:48 PM
> To: [EMAIL PROTECTED]
> Subject: [R] statistics question about a statement in julian
> faraway's "extending the linear model with R" text
>
> In Julian Faraway's text on pgs 117-119, he gives a very
> nice, pretty simple description of how a glm can be thought
> of as linear model with non constant variance. I just didn't
> understand one of his statements  on the top of 118. To quote :
>
> "We can use a similar idea to fit a GLM. Roughly speaking, we
> want to regress g(y) on X with weights inversely proportional
> to var(g(y). However, g(y) might not make sense in some cases
> - for example in the binomial GLM. So we linearize g(y) as
> follows: Let eta = g(mu) and mu = E(Y). Now do a one step
> expanation , blah, blah, blah.
>
> Could someone explain ( briefly is fine ) what he means by
> g(y) might not make sense in some cases - for example in the
> binomial GLM ?
>
> 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.
>

__
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 a small "for" loop

2008-07-14 Thread Christopher W. Ryan
R 2.5.1 on WinXP

I'm trying to create new variables in a dataframe called jaw, as powers
of jaw$age up to the sixth power, and name them

jaw$age.(--the digit corresponding to the power--)

Obviously none of these work (silly for me to try, I suppose):

for (i in 2:6) {
  jaw$age.'i' <- jaw$age^i
  }

for (i in 2:6) {
  jaw$age.i <- jaw$age^i
  }

for (i in 2:6) {
  jaw$age."i" <- jaw$age^i
  }

What is the proper syntax to create and name these variables all at once?

Thanks.

--Chris
-- 
Christopher W. Ryan, MD
SUNY Upstate Medical University Clinical Campus at Binghamton
40 Arch Street, Johnson City, NY  13790
cryanatbinghamtondotedu
PGP public keys available at http://home.stny.rr.com/ryancw/

"If you want to build a ship, don't drum up the men to gather wood,
divide the work and give orders. Instead, teach them to yearn for the
vast and endless sea."  [Antoine de St. Exupery]

__
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] statistics question about a statement in julian faraway's "extending the linear model with R" text

2008-07-14 Thread Duncan Murdoch

[EMAIL PROTECTED] wrote:
In Julian Faraway's text on pgs 117-119, he gives a very nice, pretty 
simple description of how a glm can be thought of as linear model
with non constant variance. I just didn't understand one of his 
statements  on the top of 118. To quote :


"We can use a similar idea to fit a GLM. Roughly speaking, we want to 
regress g(y) on X with weights inversely proportional
to var(g(y). However, g(y) might not make sense in some cases - for 
example in the binomial GLM. So we linearize g(y)
as follows: Let eta = g(mu) and mu = E(Y). Now do a one step expanation 
, blah, blah, blah.


Could someone explain ( briefly is fine ) what he means by g(y) might 
not make sense in some cases - for example in the binomial

GLM ?
  


I don't know that text, but I'd guess he's talking about the fact that 
the expected value of a binomial must lie between 0 and N (or the 
expected value of X/N, where

X is binomial from N trials, must lie between 0 and 1).

Similarly, the expected value of a gamma or Poisson must be positive, etc.

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.


[R] Data Manipulations and SQL

2008-07-14 Thread Willa Wei
 
Greetings,
 
I am new to R and have some background knowledge about SQL. I'd like to
know whether there is a way to manipulate the R datasets (or data
frames) using SQL statements. For example, I have two data frames and
both of them have a column called "id", then I want to join this two
data frames into one. In SQL, we can just simply use the join comment.
What should we do in R? Is there any package that allows us to run SQL
statements with R data? 
 
Thank you in advance for your help,
Willa

This message contains confidential information and is in...{{dropped:8}}

__
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 a small "for" loop

2008-07-14 Thread Wolfgang Huber

Christopher W. Ryan wrote:

R 2.5.1 on WinXP

I'm trying to create new variables in a dataframe called jaw, as powers
of jaw$age up to the sixth power, and name them

jaw$age.(--the digit corresponding to the power--)

Obviously none of these work (silly for me to try, I suppose):

for (i in 2:6) {
  jaw$age.'i' <- jaw$age^i
  }

for (i in 2:6) {
  jaw$age.i <- jaw$age^i
  }

for (i in 2:6) {
  jaw$age."i" <- jaw$age^i
  }

What is the proper syntax to create and name these variables all at once?

Thanks.

--Chris



for (i in 2:6)
   jaw[[paste("age", i, sep="^")]] = jaw$age^i


or

 m = outer(jaw$age, 2:6, "^")
 colnames(m) = paste("age", 2:6, sep="^")
 jaw = cbind(jaw, m)


Best wishes
 Wolfgang


--

Wolfgang Huber, EMBL-EBI, http://www.ebi.ac.uk/huber

__
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] Convert data set to data frame

2008-07-14 Thread Willa Wei
 
Greetings,
 
I have a data set look like this:
 
> print(MyResult)
   259   10
1113
mean6.108394 3.272211e+01 3.951703e+02 2.086217e+03
79.838867  2.592272e+04
median  1.29 2.743511e+00 4.061491e+00 4.943710e+01
-2.821667 -3.040625e+00
var  2885.350595 2.343144e+05 1.022680e+06 1.200589e+07
365179.508831  3.363738e+09
sd 53.715460 4.840603e+02 1.011276e+03 3.464952e+03
604.300843  5.799774e+04
valid.n 83501.00 2.699000e+03 2.60e+01 1.00e+01
491.00  5.00e+00
  14  17  19   20   21
mean   226.58561273.23011611.224 620.8836 3608.207
median  51.68978 56.71791266.557 140.8548  459.320
var 758255.12696 485670.6679 2393157.095 1232059.4957 38426150.479
sd 870.77846696.90081546.9831109.9818 6198.883
valid.n118.0 90.  58.000  77.   15.000
attr(,"class")
[1] "dstat"

The above data set was generated from brkdn function and the numbers 2,
5, and etc. indicate the levels in my breakdown. Now, I want to have a
data frame looks like shown below so that I can save it into my
database:
 
 Level   mean medianvar sdvalid.n 
  2   6.11   1.29   2885  53.72   8.35e+04 
  5  32.72   2.74  2.343e+05  484.1   2699 
  9  395.2   4.06  1.023e+06   1011 26 
 10   2086  49.44  1.201e+07   3465 10 
 11  79.84  -2.82  3.652e+05  604.3491 
 13  2.592e+04  -3.04  3.364e+095.8e+04  5 
 14  226.6  51.69  7.583e+05  870.8118 
 17  273.2  56.72  4.857e+05  696.9 90 
 19   1611   1267  2.393e+06   1547 58 
 20  620.9  140.8  1.232e+06   1110 77 
 21   3608  459.3  3.843e+07   6199 15 

 
How can I do it?
 
Thanks in advance for your help,
Willa
 

This message contains confidential information and is in...{{dropped:8}}

__
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 to create variables with prefix

2008-07-14 Thread Moira Burke
Hi.  I'm a new R user and think what I'm trying to do is pretty basic, but
haven't been able to find the answer in the mailing list archives.  How do I
write a function that creates new variables in a given data.frame with a
prefix attached to the variable names?  I do a lot of repetitive logging and
scaling of variables, and would like a way to consistently generate and name
versions of the variables.

The function would take a data.frame, an array of variables, and a prefix
string.  It performs a transformation on the variables (e.g. logs and
scales), and creates new variables with the same names as the inputs, but
with the prefix_string prepended.

So, a sample call would look like:

myfunction(mydata, myvariables, "norm_")

And if myvariables contained variables named "var1", "var2", etc., the
function would generate:

mydata$norm_var1
mydata$norm_var2

Thanks,
Moira

[[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] statistics question about a statement in julian faraway's "extending the linear model with R" text

2008-07-14 Thread Peter Dalgaard

[EMAIL PROTECTED] wrote:
In Julian Faraway's text on pgs 117-119, he gives a very nice, pretty 
simple description of how a glm can be thought of as linear model
with non constant variance. I just didn't understand one of his 
statements  on the top of 118. To quote :


"We can use a similar idea to fit a GLM. Roughly speaking, we want to 
regress g(y) on X with weights inversely proportional
to var(g(y). However, g(y) might not make sense in some cases - for 
example in the binomial GLM. So we linearize g(y)
as follows: Let eta = g(mu) and mu = E(Y). Now do a one step 
expanation , blah, blah, blah.


Could someone explain ( briefly is fine ) what he means by g(y) might 
not make sense in some cases - for example in the binomial

GLM ?

Note that he does say "roughly speaking". The intention is presumably 
that if y is a vector of proportions and g is the logit function, 
proportions can be zero or one, but then their logits would be minus or 
plus infinity. (However, that's not the only thing that goes wrong; the 
model for g(E(Y)) is linear, the expression for E(g(y)) in general is not.)


--
  O__   Peter Dalgaard Øster Farimagsgade 5, Entr.B
 c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K
(*) \(*) -- University of Copenhagen   Denmark  Ph:  (+45) 35327918
~~ - ([EMAIL PROTECTED])  FAX: (+45) 35327907

__
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] Insurance review statistical methods

2008-07-14 Thread Kenneth Roy Cabrera Torres
Hi R users:

I will like to know if somebody works on insurance statistics
(actuarial problems) and had use TRICAST, and can tell me
if with all the R tools it can be build a solution
like TRICAST or similar.

In a word:
Do you think that  R has all the statistical tools
(I mean modeling tools) to make a job similar to TRICAST?

Does TRICAST has modeling tools that are not implemented
on R yet?

Thank you for your help.

Kenneth

-- 
Kenneth Roy Cabrera Torres <[EMAIL PROTECTED]>

__
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 a small "for" loop

2008-07-14 Thread milton ruser
May be this helps:


jaw<-data.frame(vara=1:20,age=runif(20))

for (i in 2:6)  {
 jaw[paste("agepow",i, sep="")] <- jaw["age"]^i
 }

jaw<-round(jaw,2) # It is just to help the check task



Cheers,



Miltinho Astronauta

Brazil






On 7/14/08, Christopher W. Ryan <[EMAIL PROTECTED]> wrote:
>
> R 2.5.1 on WinXP
>
> I'm trying to create new variables in a dataframe called jaw, as powers
> of jaw$age up to the sixth power, and name them
>
> jaw$age.(--the digit corresponding to the power--)
>
> Obviously none of these work (silly for me to try, I suppose):
>
> for (i in 2:6) {
> jaw$age.'i' <- jaw$age^i
> }
>
> for (i in 2:6) {
> jaw$age.i <- jaw$age^i
> }
>
> for (i in 2:6) {
> jaw$age."i" <- jaw$age^i
> }
>
> What is the proper syntax to create and name these variables all at once?
>
> Thanks.
>
> --Chris
> --
> Christopher W. Ryan, MD
> SUNY Upstate Medical University Clinical Campus at Binghamton
> 40 Arch Street, Johnson City, NY  13790
> cryanatbinghamtondotedu
> PGP public keys available at http://home.stny.rr.com/ryancw/
>
> "If you want to build a ship, don't drum up the men to gather wood,
> divide the work and give orders. Instead, teach them to yearn for the
> vast and endless sea."  [Antoine de St. Exupery]
>
> __
> 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] creating axis of the plot before data are plotted

2008-07-14 Thread Zroutik Zroutik
Nope, this assigns the 26th, 28th, 30th anf 32nd point of the total
nrow(matrix) number of points. This does not assign the points (or places of
the x-axis) with such a rowname.

row number <-> row name
1:nrow(matrix) <-> rowname(matrix[1]) .. rowname(matrix[nrow(matrix)])


I try to rephrase my question: how do you plot a curve into a plot when the
x-axis isn't the rownumbers, but each row is a real x-value (e.g. 35.23)?


p.s. there is a mistake in my original (first) email. Instead "at=NULL"
should be "at=Labels" (otherwise there is an error message). Sorry for
confusion.

On Mon, Jul 14, 2008 at 5:53 PM, stephen sefick <[EMAIL PROTECTED]> wrote:

> try at=seq(from=26, to=32, by=2) in the axis statment
> hope this helps
>
> Stephen
>
> On Mon, Jul 14, 2008 at 11:21 AM, Zroutik Zroutik <[EMAIL PROTECTED]>
> wrote:
>
>> Dear R-users,
>>
>> I'm tackling with a problem which causing me a head-ache for a long time.
>> I
>> would like to create a nice x-axis to my plots, but I do not know how to
>> implement the method.
>>
>> Imagine a matrix where you have rownames real numbers -- these rownames
>> should be written in the x-axis nicely. I could not find any way how.
>>
>> I'll describe what I'm doing now:
>> I have a matrix where each column is an independent curve (number of the
>> columns 3-4). The rownames are the x-axis, and the names are real numbers
>> (converted to chars, of course). I find the max and the min among the
>> values
>> in the matrix (for the y-axis) and I'm creating an empty plot. x-axis is
>> c(0, nrow(matrix)). Now, I'm creating the x-axis labels
>>
>> Labels <- seq(1, nrow(matrix), by = 100)
>> axis(1, at = NULL, labels = rownames(matrix)[Labels])
>>
>> At this point I'd like to have instead of "24.1233326.4566728.79
>> 31.1233333.45667" at the x-axis, an optimally placed ticks at let's
>> say
>> "26 28 30 32" -- this is what I cannot achieve.
>>
>> Afterwards I'm plotting the curves in different colours. I know that the
>> x-values are accessed by the number of their row and not rowname.
>>
>> Anybody could point me into some direction, please? Thank you upfront!
>>
>>[[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.
>>
>
>
>
> --
> Let's not spend our time and resources thinking about things that are so
> little or so large that all they really do for us is puff us up and make us
> feel like gods. We are mammals, and have not exhausted the annoying little
> problems of being mammals.
>
> -K. Mullis

[[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] [Fwd: Re: Insurance review statistical methods]

2008-07-14 Thread Kenneth Roy Cabrera Torres

--- Begin Message ---
Hi R Guru:

Thank you for your answer!

No, Dr. Velez, it is a closed source and propietary software,
that several companies here in Medellin are starting to use
to face actuarial problems.

Kenneth

El lun, 14-07-2008 a las 17:59 -0400, Jorge Ivan Velez escribió:
> Dear Kenneth,
> 
> Is TRICAST any R package?
> 
> Jorge
> 
> On Mon, Jul 14, 2008 at 5:47 PM, Kenneth Roy Cabrera Torres
> <[EMAIL PROTECTED]> wrote:
> Hi R users:
> 
> I will like to know if somebody works on insurance statistics
> (actuarial problems) and had use TRICAST, and can tell me
> if with all the R tools it can be build a solution
> like TRICAST or similar.
> 
> In a word:
> Do you think that  R has all the statistical tools
> (I mean modeling tools) to make a job similar to TRICAST?
> 
> Does TRICAST has modeling tools that are not implemented
> on R yet?
> 
> Thank you for your help.
> 
> Kenneth
> 
> --
> Kenneth Roy Cabrera Torres <[EMAIL PROTECTED]>
> 
> __
> 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.
> 
--- End Message ---
__
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] creating axis of the plot before data are plotted

2008-07-14 Thread stephen sefick
why don't you give us a snippett of your data and then we may be able to
help (read the posting guide)

On Mon, Jul 14, 2008 at 6:04 PM, Zroutik Zroutik <[EMAIL PROTECTED]> wrote:

> Nope, this assigns the 26th, 28th, 30th anf 32nd point of the total
> nrow(matrix) number of points. This does not assign the points (or places of
> the x-axis) with such a rowname.
>
> row number <-> row name
> 1:nrow(matrix) <-> rowname(matrix[1]) .. rowname(matrix[nrow(matrix)])
>
>
> I try to rephrase my question: how do you plot a curve into a plot when the
> x-axis isn't the rownumbers, but each row is a real x-value (e.g. 35.23)?
>
>
> p.s. there is a mistake in my original (first) email. Instead "at=NULL"
> should be "at=Labels" (otherwise there is an error message). Sorry for
> confusion.
>
>
> On Mon, Jul 14, 2008 at 5:53 PM, stephen sefick <[EMAIL PROTECTED]> wrote:
>
>> try at=seq(from=26, to=32, by=2) in the axis statment
>> hope this helps
>>
>> Stephen
>>
>> On Mon, Jul 14, 2008 at 11:21 AM, Zroutik Zroutik <[EMAIL PROTECTED]>
>> wrote:
>>
>>> Dear R-users,
>>>
>>> I'm tackling with a problem which causing me a head-ache for a long time.
>>> I
>>> would like to create a nice x-axis to my plots, but I do not know how to
>>> implement the method.
>>>
>>> Imagine a matrix where you have rownames real numbers -- these rownames
>>> should be written in the x-axis nicely. I could not find any way how.
>>>
>>> I'll describe what I'm doing now:
>>> I have a matrix where each column is an independent curve (number of the
>>> columns 3-4). The rownames are the x-axis, and the names are real numbers
>>> (converted to chars, of course). I find the max and the min among the
>>> values
>>> in the matrix (for the y-axis) and I'm creating an empty plot. x-axis is
>>> c(0, nrow(matrix)). Now, I'm creating the x-axis labels
>>>
>>> Labels <- seq(1, nrow(matrix), by = 100)
>>> axis(1, at = NULL, labels = rownames(matrix)[Labels])
>>>
>>> At this point I'd like to have instead of "24.1233326.4566728.79
>>> 31.1233333.45667" at the x-axis, an optimally placed ticks at let's
>>> say
>>> "26 28 30 32" -- this is what I cannot achieve.
>>>
>>> Afterwards I'm plotting the curves in different colours. I know that the
>>> x-values are accessed by the number of their row and not rowname.
>>>
>>> Anybody could point me into some direction, please? Thank you upfront!
>>>
>>>[[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.
>>>
>>
>>
>>
>> --
>> Let's not spend our time and resources thinking about things that are so
>> little or so large that all they really do for us is puff us up and make us
>> feel like gods. We are mammals, and have not exhausted the annoying little
>> problems of being mammals.
>>
>> -K. Mullis
>
>
>


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

-K. Mullis

[[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] question about a small "for" loop

2008-07-14 Thread Christopher W. Ryan
Thank you to all for your ideas.  They all solved my problem nicely.
And I learned about paste() too!

--Chris
Christopher W. Ryan, MD
SUNY Upstate Medical University Clinical Campus at Binghamton
40 Arch Street, Johnson City, NY  13790
cryanatbinghamtondotedu
PGP public keys available at http://home.stny.rr.com/ryancw/

"If you want to build a ship, don't drum up the men to gather wood,
divide the work and give orders. Instead, teach them to yearn for the
vast and endless sea."  [Antoine de St. Exupery]

milton ruser wrote:
> May be this helps:
>  
> 
> jaw<-data.frame(vara=1:20,age=runif(20))
> 
> for (i in 2:6)  {
>  jaw[paste("agepow",i, sep="")] <- jaw["age"]^i
>  }
> 
> jaw<-round(jaw,2) # It is just to help the check task
> 
>  
> 
> Cheers,
> 
>  
> 
> Miltinho Astronauta
> 
> Brazil
> 
> 
>  
> 
> 
> 
>  
> On 7/14/08, *Christopher W. Ryan* <[EMAIL PROTECTED]
> > wrote:
> 
> R 2.5.1 on WinXP
> 
> I'm trying to create new variables in a dataframe called jaw, as powers
> of jaw$age up to the sixth power, and name them
> 
> jaw$age.(--the digit corresponding to the power--)
> 
> Obviously none of these work (silly for me to try, I suppose):
> 
> for (i in 2:6) {
> jaw$age.'i' <- jaw$age^i
> }
> 
> for (i in 2:6) {
> jaw$age.i <- jaw$age^i
> }
> 
> for (i in 2:6) {
> jaw$age."i" <- jaw$age^i
> }
> 
> What is the proper syntax to create and name these variables all at
> once?
> 
> Thanks.
> 
> --Chris
> --
> Christopher W. Ryan, MD
> SUNY Upstate Medical University Clinical Campus at Binghamton
> 40 Arch Street, Johnson City, NY  13790
> cryanatbinghamtondotedu
> PGP public keys available at http://home.stny.rr.com/ryancw/
> 
> "If you want to build a ship, don't drum up the men to gather wood,
> divide the work and give orders. Instead, teach them to yearn for the
> vast and endless sea."  [Antoine de St. Exupery]
> 
> __
> 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] Data Manipulations and SQL

2008-07-14 Thread Gabor Grothendieck
The sqldf R package can do that using SQL syntax.  See:
http://sqldf.googlecode.com

The R merge command can do a join but not using SQL syntax.
See ?merge

On Mon, Jul 14, 2008 at 5:29 PM, Willa Wei <[EMAIL PROTECTED]> wrote:
>
> Greetings,
>
> I am new to R and have some background knowledge about SQL. I'd like to
> know whether there is a way to manipulate the R datasets (or data
> frames) using SQL statements. For example, I have two data frames and
> both of them have a column called "id", then I want to join this two
> data frames into one. In SQL, we can just simply use the join comment.
> What should we do in R? Is there any package that allows us to run SQL
> statements with R data?
>
> Thank you in advance for your help,
> Willa
>
> This message contains confidential information and is in...{{dropped:8}}
>
> __
> 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] position of a specific character

2008-07-14 Thread Hua Li
Hi All,

I'm wondering whether there is a quick way to know the position of a specific 
charcater in a long character:

for example

frg="((D:41.04,I:41.04):45.05,(((E:2.32,((G:0.67,J:0.67):0.44,H:1.11):1.21)"

and I would like to know that the 1st, 2nd, 26th, 27th, 28th ... character is 
"(", is there a quick way to do that?

Thanks!

Hua

__
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] position of a specific character

2008-07-14 Thread Hua Li
Well, actually, what I really want is a way to quickly find the fragment that 
contained equal number of "(" and ")", starting from the end of the character. 
In the case of

frg = ="((D:41.04,I:41.04):45.05,(((E:2.32,((G:0.67,J:0.67):0.44,H:1.11):1.21)"

that means finding the part: "(E:2.32,((G:0.67,J:0.67):0.44,H:1.11):1.21)" 
automatically!


Thanks a lot!

Hua



--- On Mon, 7/14/08, Hua Li <[EMAIL PROTECTED]> wrote:

> From: Hua Li <[EMAIL PROTECTED]>
> Subject: [R] position of a specific character
> To: "R-help" 
> Date: Monday, July 14, 2008, 6:57 PM
> Hi All,
> 
> I'm wondering whether there is a quick way to know the
> position of a specific charcater in a long character:
> 
> for example
> 
> frg="((D:41.04,I:41.04):45.05,(((E:2.32,((G:0.67,J:0.67):0.44,H:1.11):1.21)"
> 
> and I would like to know that the 1st, 2nd, 26th, 27th,
> 28th ... character is "(", is there a quick way
> to do that?
> 
> Thanks!
> 
> Hua
> 
> __
> 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] position of a specific character

2008-07-14 Thread Erik Iverson

gregexpr("\\(", frg)


Hua Li wrote:

Hi All,

I'm wondering whether there is a quick way to know the position of a
specific charcater in a long character:

for example

frg="((D:41.04,I:41.04):45.05,(((E:2.32,((G:0.67,J:0.67):0.44,H:1.11):1.21)"


and I would like to know that the 1st, 2nd, 26th, 27th, 28th ...
character is "(", is there a quick way to do that?

Thanks!

Hua

__ 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] Convert data set to data frame

2008-07-14 Thread jim holtman
Is this what you want:

> x <- data.frame(a=1:10,b=1:10)
> x
a  b
1   1  1
2   2  2
3   3  3
4   4  4
5   5  5
6   6  6
7   7  7
8   8  8
9   9  9
10 10 10
> t(x)
  [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
a12345678910
b12345678910
>


On Mon, Jul 14, 2008 at 5:40 PM, Willa Wei <[EMAIL PROTECTED]> wrote:
>
> Greetings,
>
> I have a data set look like this:
>
>> print(MyResult)
>   259   10
> 1113
> mean6.108394 3.272211e+01 3.951703e+02 2.086217e+03
> 79.838867  2.592272e+04
> median  1.29 2.743511e+00 4.061491e+00 4.943710e+01
> -2.821667 -3.040625e+00
> var  2885.350595 2.343144e+05 1.022680e+06 1.200589e+07
> 365179.508831  3.363738e+09
> sd 53.715460 4.840603e+02 1.011276e+03 3.464952e+03
> 604.300843  5.799774e+04
> valid.n 83501.00 2.699000e+03 2.60e+01 1.00e+01
> 491.00  5.00e+00
>  14  17  19   20   21
> mean   226.58561273.23011611.224 620.8836 3608.207
> median  51.68978 56.71791266.557 140.8548  459.320
> var 758255.12696 485670.6679 2393157.095 1232059.4957 38426150.479
> sd 870.77846696.90081546.9831109.9818 6198.883
> valid.n118.0 90.  58.000  77.   15.000
> attr(,"class")
> [1] "dstat"
>
> The above data set was generated from brkdn function and the numbers 2,
> 5, and etc. indicate the levels in my breakdown. Now, I want to have a
> data frame looks like shown below so that I can save it into my
> database:
>
> Level   mean medianvar sdvalid.n
>  2   6.11   1.29   2885  53.72   8.35e+04
>  5  32.72   2.74  2.343e+05  484.1   2699
>  9  395.2   4.06  1.023e+06   1011 26
> 10   2086  49.44  1.201e+07   3465 10
> 11  79.84  -2.82  3.652e+05  604.3491
> 13  2.592e+04  -3.04  3.364e+095.8e+04  5
> 14  226.6  51.69  7.583e+05  870.8118
> 17  273.2  56.72  4.857e+05  696.9 90
> 19   1611   1267  2.393e+06   1547 58
> 20  620.9  140.8  1.232e+06   1110 77
> 21   3608  459.3  3.843e+07   6199 15
>
>
> How can I do it?
>
> Thanks in advance for your help,
> Willa
>
>
> This message contains confidential information and is ...{{dropped:18}}

__
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] modeling binary response variables

2008-07-14 Thread Kevin J Emerson
R-devotees,

I have a question about modeling in the case where the response variable is
binary.

I have a case where I have a response variable that is the probability of
success, and four descriptor variables, The response has a sigmoid response
with one of the variables. I would like to test for the effect of the
various descriptor variables on the percentage success of the binary trait.
I have looked at glm with family = "binomial" but am not sure I totally
understand its use (and therefore am not sure it is the appropriate test)
and am looking for two things: (1) is glm with family = 'binomial' the right
way to do this, and (2) are there any good references on how it works.
I have posted a plot of a sample of the data I am looking at as well as the
sample data used to generate the plots.

Sample Plot: http://www.uoregon.edu/~kemerson/tmp/plot.pdf
Sample Data: http://www.uoregon.edu/~kemerson/tmp/data.csv

Response variable is percent.dev (se2.dev are the errors from binomial
estimates given probability and number of samples).

Descriptor variables are num.days, ppd, temp, and pop.  

Any help would be greatly appreciated.

Cheers,
Kevin Emerson



Kevin J. Emerson
Bradshaw - Holzapfel Lab
1210 University of Oregon
Eugene, OR, 97403
email: [EMAIL PROTECTED]
web: http://evodevo.uoregon.edu/people/emerson.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.


[R] Extract and plot array from data

2008-07-14 Thread theBenjamin

I have a table of data, and columns 6-8 of row 1 each contain an array.  How
do I extract those arrays and plot them against eachother?  Here is my
current code, which only plots the first point of the array.

circle <- as.matrix(AllData[1,6:8])

triax.points(
circle,
pch = 20,
col.symbols = "Black"
)
-- 
View this message in context: 
http://www.nabble.com/Extract-and-plot-array-from-data-tp18453896p18453896.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] rgl.snapshot on linux produces colored lines only

2008-07-14 Thread Matt
I'm having a problem with rgl.snapshot.  If I run the following code *once* and 
*once only*, all is well.

data(trees) 
attach(trees)
plot3d(Height, Girth, Volume, type='s')
rgl.snapshot("/home/user/pic.png", fmt="png", top=TRUE )

And the pic.png looks right.  But if I try to rerun rgl.snapshot anytime again 
in this session, the file pic.png still outputs but is nothing but colored 
lines, like in a TV test pattern.

I also tried the built-in example:

shade3d(oh3d(), color="red")
 rgl.bringtotop()
 rgl.viewpoint(0,20)
 setwd(path)
 for (i in 1:45) {
   rgl.viewpoint(i,20)
   filename <- paste("pic",formatC(i,digits=1,flag="0"),".png",sep="")
   rgl.snapshot(filename)
 }

and all the png files are colored lines.

I seem to have no trouble installing rgl (my configure output is below), and I 
have seen the previous messages about finding paths to the X11 etc. lirbaries.  
My libpng is up to date.  I have tried this on two different Ubuntu hardy 
machines and get the same thing.

Anybody else out there get this?

Thanks.

Configure output

 sudo R CMD INSTALL --configure-args='--x-includes=/usr/include/X11 
--x-libraries=/usr/lib' rgl_0.79.tar.gz 
* Installing to library '/usr/local/lib/R/site-library'
* Installing *source* package 'rgl' ...
checking for gcc... gcc -std=gnu99
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc -std=gnu99 accepts -g... yes
checking for gcc -std=gnu99 option to accept ANSI C... none needed
checking how to run the C preprocessor... gcc -std=gnu99 -E
checking for gcc... (cached) gcc -std=gnu99
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc -std=gnu99 accepts -g... (cached) yes
checking for gcc -std=gnu99 option to accept ANSI C... (cached) none needed
checking for libpng-config... yes
configure: using libpng-config
configure: using libpng dynamic linkage
checking for X... libraries /usr/lib, headers /usr/include/X11
checking GL/gl.h usability... yes
checking GL/gl.h presence... yes
checking for GL/gl.h... yes
checking GL/glu.h usability... yes
checking GL/glu.h presence... yes
checking for GL/glu.h... yes
checking for glEnd in -lGL... yes
checking for gluProject in -lGLU... yes
checking for freetype-config... yes
configure: using Freetype and FTGL
configure: creating ./config.status
config.status: creating src/Makevars
[[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] long data frame selection error

2008-07-14 Thread Rheannon

Hello,

I am trying to select the following headers from a data frame but when I try
and run the command it executes halfway through and give me an error at V188
and V359.

Temp <- data.frame(V4, V5, V6, V7, V8, V9, V10, V11, V12, V13, V14, V15,
V16, V17, V18, V19, V20, V21, V22, V23, V24, V25, V26, V27, V28, V29, V30,
V31, V32, V33, V34, V35, V36, V37, V38, V39, V40, V41, V42, V43, V44, V45,
V46, V47, V48, V49, V50, V51, V52, V53, V54, V55, V56, V57, V58, V59, V60,
V61, V62, V63, V64, V65, V66, V67, V68, V69, V70, V71, V72, V73, V74, V75,
V76, V77, V78, V79, V80, V81, V82, V83, V84, V85, V86, V87, V88, V89, V90,
V91, V92, V93, V94, V95, V96, V97, V98, V99, V100, V101, V102, V103, V104,
V105, V106, V107, V108, V109, V110, V111, V112, V113, V114, V115, V116,
V117, V118, V119, V120, V121, V122, V123, V124, V125, V126, V127, V128,
V129, V130, V131, V132, V133, V134, V135, V136, V137, V138, V139, V140,
V141, V142, V143, V144, V145, V146, V147, V148, V149, V150, V151, V152,
V153, V154, V155, V156, V157, V158, V159, V160, V161, V162, V163, V164,
V165, V166, V167, V168, V169, V170, V171, V172, V173, V174, V175, V176,
V177, V178, V179, V180, V181, V182, V183, V184, V185, V186, V187, V188,
V189, V190, V191, V192, V193, V194, V195, V196, V197, V198, V199, V200,
V201, V202, V203, V204, V205, V206, V207, V208, V209, V210, V211, V212,
V213, V214, V215, V216, V217, V218, V219, V220, V221, V222, V223, V224,
V225, V226, V227, V228, V229, V230, V231, V232, V233, V234, V235, V236,
V237, V238, V239, V240, V241, V242, V243, V244, V245, V246, V247, V248,
V249, V250, V251, V252, V253, V254, V255, V256, V257, V258, V259, V260,
V261, V262, V263, V264, V265, V266, V267, V268, V269, V270, V271, V272,
V273, V274, V275, V276, V277, V278, V279, V280, V281, V282, V283, V284,
V285, V286, V287, V288, V289, V290, V291, V292, V293, V294, V295, V296,
V297, V298, V299, V300, V301, V302, V303, V304, V305, V306, V307, V308,
V309, V310, V311, V312, V313, V314, V315, V316, V317, V318, V319, V320,
V321, V322, V323, V324, V325, V326, V327, V328, V329, V330, V331, V332,
V333, V334, V335, V336, V337, V338, V339, V340, V341, V342, V343, V344,
V345, V346, V347, V348, V349, V350, V351, V352, V353, V354, V355, V356,
V357, V358, V359, V360, V361, V362, V363, V364, V365, V366, V367, V368)

Is there a way to shorten this long line of code or a way to solve the
problem?

Thanks
R
-- 
View this message in context: 
http://www.nabble.com/long-data-frame-selection-error-tp18455101p18455101.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.


  1   2   >