Re: [R] plot ᵒ C in graph axis label

2009-10-01 Thread baptiste auguie
Hi,

You cannot start with a "*" in expression(). Try this,

 plot(x~y,ylab=expression(~degree~C))

or even, as a short-cut,

 plot(x~y,ylab=~degree~C)

HTH,

baptiste

2009/10/2 e-letter :
> Readers,
>
> I have tried to use a plotmath command to add the temperature degree
> sign (i.e. ᵒ C) to the axis label of a graph:
>
>> x<-(1:10)
>> y<-(200:191)
>> plot(x~y,ylab=expression(*degree~C))
> Error: syntax error, unexpected '*', expecting ',' in
> "plot(x~y,ylab=expression(*"
>
> According to plotmath manual, the syntax is '*degree' and I am able to
> use this command when a number precedes the asterisk (e.g.
> ylab=expression(0*degree~C)). But I want to omit the need for a number
> before the degree sign. Any advice please?
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/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] Compress (gzip) a pdf device

2009-10-01 Thread Rainer M Krug
On Thu, Oct 1, 2009 at 7:26 PM, Martin Renner <
martin.ren...@stonebow.otago.ac.nz> wrote:

> try pdftk. Not quite on the fly but should do the trick. (I saw this on
> this list a little while ago)
>

pdftk compresses the pdf internally - it is still a pdf, can be opened as a
pdf, and is not an externally compressed pdf (pdf in an archive).
Below is the approach which I am using, but as stated earlier, if somebody
could provide a way of only doing dev.off() whhich then calls pdfComp() with
the filename, I would be glad to know. Otherwise.

Rainer


>
> pdfComp <- function (pdfname){
>  if (0){
>x <- tempfile()
>system (paste ("mv", pdfname, x))
>system (paste ("pdftk", x, "output", pdfname, "compress"))
>unlink (x)
>  }
> }
>
> pdf ("test.pdf")
> plot (1:10)
> dev.off()
> pdfComp ("test.pdf")
>
>
> On 30 Sep 2009, at 00:25 , Rainer M Krug wrote:
>
>  2009/9/30 Daniele Amberti 
>>
>>  I have not found an easy way to compress a file on filesystem.
>>> Especially I'd like to compress a pdf from pdf() function/device. Is it
>>> possible to compress It on the flight?
>>> I'd like to do something like:
>>> pdf(gzipconnection())
>>> dev.off()
>>>
>>>
>>>  I guess this boils down to a question I asked some time ago concerning
>> getting the filename of a pdf() device, as I wanted to create a compressed
>> pdf from the uncompressed pdf created by R (not "zipping" the pdf).
>> It does not seem to be possible, at least I did not get any response which
>> I
>> could use to implement my idea (create my dev.off(), which calls dev.off()
>> and afterwards compresses the pdf by using the file name).
>>
>> If you find a solution, please let me know.
>>
>> Cheers,
>>
>> Rainer
>>
>> If It is not possible, how can I create a gzip with the pdf?
>>
>>>
>>> Thanks
>>> Daniele A.
>>>
>>>
>>>
>>> 
>>> ORS Srl
>>>
>>> Via Agostino Morando 1/3 12060 Roddi (Cn) - Italy
>>> Tel. +39 0173 620211
>>> Fax. +39 0173 620299 / +39 0173 433111
>>> Web Site www.ors.it
>>>
>>>
>>>
>>> 
>>> Qualsiasi utilizzo non autorizzato del presente messaggio e dei suoi
>>> allegati ? vietato e potrebbe costituire reato.
>>> Se lei avesse ricevuto erroneamente questo messaggio, Le saremmo grati se
>>> provvedesse alla distruzione dello stesso
>>> e degli eventuali allegati.
>>> Opinioni, conclusioni o altre informazioni riportate nella e-mail, che
>>> non
>>> siano relative alle attivit? e/o
>>> alla missione aziendale di O.R.S. Srl si intendono non attribuibili alla
>>> societ? stessa, n? la impegnano in alcun modo.
>>>
>>>  [[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.
>>>
>>>
>>
>>
>> --
>> Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
>> Biology,
>> UCT), Dipl. Phys. (Germany)
>>
>> Centre of Excellence for Invasion Biology
>> Natural Sciences Building
>> Office Suite 2039
>> Stellenbosch University
>> Main Campus, Merriman Avenue
>> Stellenbosch
>> South Africa
>>
>> Cell:   +27 - (0)83 9479 042
>> Fax:+27 - (0)86 516 2782
>> Fax:+49 - (0)721 151 334 888
>> email:  rai...@krugs.de
>>
>> Skype:  RMkrug
>> Google: r.m.k...@gmail.com
>>
>>[[alternative HTML version deleted]]
>>
>> __
>> R-help@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>
>


-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology,
UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Natural Sciences Building
Office Suite 2039
Stellenbosch University
Main Campus, Merriman Avenue
Stellenbosch
South Africa

Cell:   +27 - (0)83 9479 042
Fax:+27 - (0)86 516 2782
Fax:+49 - (0)721 151 334 888
email:  rai...@krugs.de

Skype:  RMkrug
Google: r.m.k...@gmail.com

[[alternative HTML version deleted]]

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


[R] plot ᵒ C in graph axis label

2009-10-01 Thread e-letter
Readers,

I have tried to use a plotmath command to add the temperature degree
sign (i.e. ᵒ C) to the axis label of a graph:

> x<-(1:10)
> y<-(200:191)
> plot(x~y,ylab=expression(*degree~C))
Error: syntax error, unexpected '*', expecting ',' in
"plot(x~y,ylab=expression(*"

According to plotmath manual, the syntax is '*degree' and I am able to
use this command when a number precedes the asterisk (e.g.
ylab=expression(0*degree~C)). But I want to omit the need for a number
before the degree sign. Any advice please?

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] changing number of axis

2009-10-01 Thread Dan Kortschak
Thanks for that again. That almost works, except that lines are drawn
between non-empty bins (in various degrees of diagonality), so absent
points (important here) don't show clearly. It's not a huge issue, so I
might leave it, unless there is a simple way around this.

cheers
Dan

On Tue, 2009-09-29 at 23:17 -0700, Deepayan Sarkar wrote:
> On Tue, Sep 29, 2009 at 11:09 PM, Dan Kortschak
>  wrote:
> > Hi Deepayan,
> >
> > Thanks for that, I had a think (a few hour too late) and came to the
> > same conclusion. I had wanted to have vertical bars for each of the
> data
> > points, I have gone to a straight xyplot and this shows other
> intersting
> > information - maybe I want to be able to do both point and bar plots
> > (the bars show gaps in the bins nicely where the points don't).
> 
> Perhaps  type = c("l", "h") in xyplot.
> 
> -Deepayan
>

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] What did I do wrong? Bootstrap with glm

2009-10-01 Thread Chunhao Tu

Hi R users,
I just play with a small data set (from SAS) by using the boot with glm. But
I don't know what I did wrong. Would someone please give me a hint?
> require(boot)
> carc<-read.table(file="C:\\Documents and
> Settings\\admin\\Desktop\\drug.txt",header=T)
> carc
 n  cc car age
1  500  42   S   1
2 1200  37   M   1
3  100   1   L   1
4  400 101   S   2
5  500  73   M   2
6  300  14   L   2
> dfd<-function(d,i){
+ d<-carc[i,]
+ car.glm<- glm(cc ~ car+age+offset(log(n)), family=poisson(link =
"log"), data=d)
+ coefficients(car.glm)
+ }
> 
> car.boot=boot(carc,dfd,)
Error in t.star[r, ] <- statistic(data, i[r, ], ...) : 
  number of items to replace is not a multiple of replacement length
Many Thanks
Tu http://www.nabble.com/file/p25710150/drug.txt drug.txt   
-- 
View this message in context: 
http://www.nabble.com/What-did-I-do-wrong--Bootstrap-with-glm-tp25710150p25710150.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] removing missing values from a matrix

2009-10-01 Thread Amit Kumar
Thanks!
It worked! There is another problem I want to subset the matrix 'red'
in following manner:
>dim(red)
  23688  164
>a=red[1:23688,1:4]
>b=red[1:23688,5:8]
>c=red[1:23688,9:12]
..
..
>z=red[1:23688,161:164]
If there any efficient way to do it?
cheers!
Amit

>
> On Thu, 1 Oct 2009, Amit Kumar wrote:
>
>> Hi! All,
>> I am working with a large matrix of dimension 23689 x 162. Some of the
>> values of this matrix is missing (NA). And it looks something like
>> that:
>>
>>> dim(red)
>>
>>  23689  162
>>
>>> red
>>
>>       [,1]  [,2]  [,3]  [,4]  [,5]
>> [1,]    2     NA    4     9     6
>> [2,]    5     NA    6   NA     1
>> [3,]   NA    2     11   23    20
>> [4,]    2      1     21  NA    3
>> [5,]   NA    7     NA  52    NA
>>
>> Here I want to convert NA to zero everywhere in the matrix. I do no
>> want to omit NA using na.omit(red). I want output something like that:
>>>
>>> red
>>
>>       [,1]  [,2]  [,3]  [,4]  [,5]
>> [1,]    2      0     4     9     6
>> [2,]    5      0     6     0     1
>> [3,]    0      2     11   23    20
>> [4,]    2      1     21    0     3
>> [5,]    0      7      0    52     0
>>
>> Please, help thanks.
>> Amit
>>
>> __
>> R-help@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/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] Minimum and blanks

2009-10-01 Thread Chris Li

Thanks Joris and Peter. Sorry for not giving enough details. I have tried
your suggestions and the problem is solved. Thank you. :)


JorisMeys wrote:
> 
> The minimum of a character vector is returned according to the unicode
> or ascii code values, but I guess that's not what Chris is looking
> for.
> 
> Chris, please always try to provide a minimal working example of code
> to see what is wrong.
> 
> Something goes wrong with the input in your example. As Peter
> rightfully pointed out, your vector is considered a character vector.
> So you need to :
> 
> 1) replace "" with NA
>   e.g. x <-  ifelse(x=='',NA,x)
> Better to do something like that when reading in the code.
> 
> 2) use the argument na.rm : min (x, na.rm=T)
> 
> kind regards
> Joris
> 
> On Thu, Oct 1, 2009 at 8:36 AM, Peter Ehlers  wrote:
>> Chris,
>>
>> What is your definition of the minimum of a *character* vector?
>>
>>  -Peter Ehlers
>>
>> Chris Li wrote:
>>>
>>> Hi all,
>>>
>>> I want to calculate the minimum of a column which contains blanks.
>>>
>>> R returns "" as the minimum, which is not I want.
>>>
>>> Is there a way to overcome it?
>>>
>>> Thanks in advance.
>>> Chris
>>
>> __
>> R-help@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/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.
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Minimum-and-blanks-tp25692189p25707736.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] split-apply question

2009-10-01 Thread andrew
?subset is probably what you want:

subset(x, x1 == 'A')

On Oct 2, 1:43 pm, Kavitha Venkatesan 
wrote:
> Hi,
>
> I have a data frame that looks like this:
>
> >x
>
> x1  x2  x3
> A   1    1.5
> B   2    0.9
> B   3    2.7
> C   7    1.8
> D   7    1.3
>
> I want to "group" by the x1 column and in the case of multiple x$x1 values
> (e.g., "B")d, return rows that have the smallest values of x2. In the case
> of rows with only one value of x1 (e.g., "A"), return the row as is. How can
> I do that?  For example, in the above case, the output I want would be:
>
> x1  x2  x3
> A   1    1.5
> B   2    0.9
> C   7    1.8
> D   7    1.3
>
> Thanks!
>
>         [[alternative HTML version deleted]]
>
> __
> r-h...@r-project.org mailing listhttps://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guidehttp://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] Compress (gzip) a pdf device

2009-10-01 Thread Martin Renner
try pdftk. Not quite on the fly but should do the trick. (I saw this  
on this list a little while ago)



pdfComp <- function (pdfname){
  if (0){
x <- tempfile()
system (paste ("mv", pdfname, x))
system (paste ("pdftk", x, "output", pdfname, "compress"))
unlink (x)
  }
}

pdf ("test.pdf")
plot (1:10)
dev.off()
pdfComp ("test.pdf")

On 30 Sep 2009, at 00:25 , Rainer M Krug wrote:


2009/9/30 Daniele Amberti 


I have not found an easy way to compress a file on filesystem.
Especially I'd like to compress a pdf from pdf() function/device.  
Is it

possible to compress It on the flight?
I'd like to do something like:
pdf(gzipconnection())
dev.off()



I guess this boils down to a question I asked some time ago concerning
getting the filename of a pdf() device, as I wanted to create a  
compressed

pdf from the uncompressed pdf created by R (not "zipping" the pdf).
It does not seem to be possible, at least I did not get any response  
which I
could use to implement my idea (create my dev.off(), which calls  
dev.off()

and afterwards compresses the pdf by using the file name).

If you find a solution, please let me know.

Cheers,

Rainer

If It is not possible, how can I create a gzip with the pdf?


Thanks
Daniele A.




ORS Srl

Via Agostino Morando 1/3 12060 Roddi (Cn) - Italy
Tel. +39 0173 620211
Fax. +39 0173 620299 / +39 0173 433111
Web Site www.ors.it



Qualsiasi utilizzo non autorizzato del presente messaggio e dei suoi
allegati ? vietato e potrebbe costituire reato.
Se lei avesse ricevuto erroneamente questo messaggio, Le saremmo  
grati se

provvedesse alla distruzione dello stesso
e degli eventuali allegati.
Opinioni, conclusioni o altre informazioni riportate nella e-mail,  
che non

siano relative alle attivit? e/o
alla missione aziendale di O.R.S. Srl si intendono non attribuibili  
alla

societ? stessa, n? la impegnano in alcun modo.

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





--
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation  
Biology,

UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Natural Sciences Building
Office Suite 2039
Stellenbosch University
Main Campus, Merriman Avenue
Stellenbosch
South Africa

Cell:   +27 - (0)83 9479 042
Fax:+27 - (0)86 516 2782
Fax:+49 - (0)721 151 334 888
email:  rai...@krugs.de

Skype:  RMkrug
Google: r.m.k...@gmail.com

[[alternative HTML version deleted]]

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


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] split-apply question

2009-10-01 Thread Kavitha Venkatesan
Hi,

I have a data frame that looks like this:

>x

x1  x2  x3
A   11.5
B   20.9
B   32.7
C   71.8
D   71.3

I want to "group" by the x1 column and in the case of multiple x$x1 values
(e.g., "B")d, return rows that have the smallest values of x2. In the case
of rows with only one value of x1 (e.g., "A"), return the row as is. How can
I do that?  For example, in the above case, the output I want would be:

x1  x2  x3
A   11.5
B   20.9
C   71.8
D   71.3


Thanks!

[[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 get duplicated items in a vector?

2009-10-01 Thread William Dunlap


Bill Dunlap
TIBCO Software Inc - Spotfire Division
wdunlap tibco.com  

> -Original Message-
> From: r-help-boun...@r-project.org 
> [mailto:r-help-boun...@r-project.org] On Behalf Of Peng Yu
> Sent: Thursday, October 01, 2009 7:42 PM
> To: r-h...@stat.math.ethz.ch
> Subject: [R] How to get duplicated items in a vector?
> 
> Hi,
> 
> > x=c(rep(1,3),rep(3,2))
> > x
> [1] 1 1 1 3 3
> > duplicated(x)
> [1] FALSE  TRUE  TRUE FALSE  TRUE
> >
> 
> As shown in the above code, 'duplicated' doesn't return 'F' for the
> first '1' and first '3' in 'x'. I am wondering if there is a function
> that can return an indicator for any element whether it appears in a
> vector twice or more.

You could use is.element() or %in%, as in
   > x <- rep(3:1, 3:1)
   > x %in% x[duplicated(x)]
   [1]  TRUE  TRUE  TRUE  TRUE  TRUE FALSE

Bill Dunlap
TIBCO Software Inc - Spotfire Division
wdunlap tibco.com 

> 
> Regards,
> Peng
> 
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/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 get duplicated items in a vector?

2009-10-01 Thread Gabor Grothendieck
Try this:

> x <- c(1, 2, 3, 3, 4, 5)

> ave(x, x, FUN = length) > 1
[1] FALSE FALSE  TRUE  TRUE FALSE FALSE


On Thu, Oct 1, 2009 at 10:42 PM, Peng Yu  wrote:
> Hi,
>
>> x=c(rep(1,3),rep(3,2))
>> x
> [1] 1 1 1 3 3
>> duplicated(x)
> [1] FALSE  TRUE  TRUE FALSE  TRUE
>>
>
> As shown in the above code, 'duplicated' doesn't return 'F' for the
> first '1' and first '3' in 'x'. I am wondering if there is a function
> that can return an indicator for any element whether it appears in a
> vector twice or more.
>
> Regards,
> Peng
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

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


[R] How to get duplicated items in a vector?

2009-10-01 Thread Peng Yu
Hi,

> x=c(rep(1,3),rep(3,2))
> x
[1] 1 1 1 3 3
> duplicated(x)
[1] FALSE  TRUE  TRUE FALSE  TRUE
>

As shown in the above code, 'duplicated' doesn't return 'F' for the
first '1' and first '3' in 'x'. I am wondering if there is a function
that can return an indicator for any element whether it appears in a
vector twice or more.

Regards,
Peng

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] confint fails in quasibinomial glm: dims do not match

2009-10-01 Thread smith_cc

I am unable to calculate confidence intervals for the slope estimate in a
quasibinomial glm using confint(). Below is the output and the package info
for MASS. Thanks in advance!

R 2.9.2
MASS 7.2-48

> confint(glm.palive.0.str)
Waiting for profiling to be done...
Error: dims [product 37] do not match the length of object [74]
> glm.palive.0.str

Call:  glm(formula = cbind(alive, red) ~ str, family = quasibinomial, 
data = subset(master.palive, vtime == 0)) 

Coefficients:
(Intercept) strs  
   1.05 1.01  

Degrees of Freedom: 36 Total (i.e. Null);  35 Residual
Null Deviance:  20800 
Residual Deviance: 16200AIC: NA 

> packageDescription("MASS")
Bundle: VR
Contains: MASS class nnet spatial
Priority: recommended
Version: 7.2-48
Date: 2009-07-29
Depends: R (>= 2.5.0), grDevices, graphics, stats, utils
Suggests: lattice, nlme, survival
Author: S original by Venables & Ripley. R port by Brian Ripley
, following earlier work by Kurt Hornik and Albrecht
Gebhardt.
Maintainer: Brian Ripley 
BundleDescription: Functions and datasets to support Venables and Ripley,
'Modern Applied Statistics with S' (4th edition).
License: GPL-2 | GPL-3
URL: http://www.stats.ox.ac.uk/pub/MASS4/
Packaged: 2009-07-31 13:56:57 UTC; ripley
Repository: CRAN
Date/Publication: 2009-08-05 11:20:53
Package: MASS
Description: The main library and the datasets
Title: Main Package of Venables and Ripley's MASS
LazyLoad: yes
LazyData: yes
Built: R 2.9.2; i686-pc-linux-gnu; 2009-08-25 10:52:10 UTC; unix

Cheers,
Chad 
-- 
View this message in context: 
http://www.nabble.com/confint-fails-in-quasibinomial-glm%3A-dims-do-not-match-tp25709756p25709756.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] How to use Subpopulation data?

2009-10-01 Thread KABELI MEFANE

Thanks
 
But it seems like you don't get my problem. Do you mean that there is something 
wrong with the code as it seems like  what you are doing is suggesting 
different ways to write a code. 
 
Will i get to use the variable that have been name previously like if i want to 
calculate the standard deviation of stratum hypermarket in a sample not 
population, the first start is to check if it would help me is to check the 
length() of different levels if it is not same as that of the original data
 
Best Regards 
 
I rest my case, i might dream it

--- On Thu, 1/10/09, Bernardo Rangel Tura  wrote:


From: Bernardo Rangel Tura 
Subject: Re: [R] How to use Subpopulation data?
To: "r-help" 
Date: Thursday, 1 October, 2009, 10:18 PM


On Thu, 2009-10-01 at 13:34 +, KABELI MEFANE wrote:
> ## package sampling
> 
> stra=strata(sampleframe,c("type","value","rating"),size=c(20,80,200,300,400),
> method="srswor")
> sample.strat<-getdata(sampleframe,stra)
> 
> sample.strat
> 

Try:

stra<-strata(sampleframe,size=c(20,80,200,300,400),method="srswor")
sample.strat<-getdata(sampleframe,stra)
sample.strat

-- 
Bernardo Rangel Tura, M.D,MPH,Ph.D
National Institute of Cardiology
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.



  
[[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] Level name as object name

2009-10-01 Thread jim holtman
assign(levels(data$Species)[1], 1:10)

or you might want to consider the use of a list depending on what you
are trying to do.

On Thu, Oct 1, 2009 at 7:26 PM, jimdare  wrote:
>
> Hi,
>
> If I have a dataset called "data" with a factor called "Species" that has
> three levels "Sp1", "Sp2", and "Sp3".  Is there a way to name an object
> after a specific level?  I have tried the code below and get the error
> "error in paste(levels(data$Species)[1]) <- 1:10   could not find function
> "paste<-"
>
> Code:
> paste(levels(data$Species)[1])<-1:10
>
> Thanks for your help.
>
> James
> --
> View this message in context: 
> http://www.nabble.com/Level-name-as-object-name-tp25708252p25708252.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 that you are trying to solve?

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


Re: [R] removing missing values from a matrix

2009-10-01 Thread Rolf Turner


On 2/10/2009, at 1:03 PM, Carvalho, Benilton wrote:


I agree with you folks, my assumption is that the user knows what he's
doing.


Almost surely a rash assumption! (I.e. except for a set of
users of probability zero.) :-)

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] removing missing values from a matrix

2009-10-01 Thread Carvalho, Benilton
I agree with you folks, my assumption is that the user knows what he's
doing.


Sent from my iPhone

On Oct 1, 2009, at 8:33 PM, "Rolf Turner" 
wrote:

>
> On 2/10/2009, at 12:05 PM, Bert Gunter wrote:
>
>> However, I would hazard the guess that doing this is a (possibly
>> disastrously) bad idea
>
>I heartily second that hazard!!!
>
>cheers,
>
>Rolf Turner
>
>> Bert Gunter
>> Genentech Nonclinical Biostatistics
>>
>>
>>
>> -Original Message-
>> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-
>> project.org] On
>> Behalf Of Carvalho, Benilton
>> Sent: Thursday, October 01, 2009 3:34 PM
>> To: Amit Kumar
>> Cc: r-help@r-project.org
>> Subject: Re: [R] removing missing values from a matrix
>>
>> red[is.na(red)] <- 0
>>
>> Sent from my iPhone
>>
>> On Oct 1, 2009, at 7:22 PM, "Amit Kumar" 
>> wrote:
>>
>>> Hi! All,
>>> I am working with a large matrix of dimension 23689 x 162. Some of
>>> the
>>> values of this matrix is missing (NA). And it looks something like
>>> that:
>>>
 dim(red)
>>> 23689  162
>>>
 red
>>>   [,1]  [,2]  [,3]  [,4]  [,5]
>>> [1,]2 NA4 9 6
>>> [2,]5 NA6   NA 1
>>> [3,]   NA2 11   2320
>>> [4,]2  1 21  NA3
>>> [5,]   NA7 NA  52NA
>>>
>>> Here I want to convert NA to zero everywhere in the matrix. I do no
>>> want to omit NA using na.omit(red). I want output something like
>>> that:
 red
>>>   [,1]  [,2]  [,3]  [,4]  [,5]
>>> [1,]2  0 4 9 6
>>> [2,]5  0 6 0 1
>>> [3,]0  2 11   2320
>>> [4,]2  1 210 3
>>> [5,]0  7  052 0
>>>
>>> Please, help thanks.
>>> Amit
>>>
>>> __
>>> R-help@r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/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.
>
>
> ##
> Attention:
> This e-mail message is privileged and confidential. If you are not the
> intended recipient please delete the message and notify the sender.
> Any views or opinions presented are solely those of the author.
>
> This e-mail has been scanned and cleared by MailMarshal
> www.marshalsoftware.com
> ##

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


Re: [R] removing missing values from a matrix

2009-10-01 Thread Rolf Turner


On 2/10/2009, at 12:05 PM, Bert Gunter wrote:


However, I would hazard the guess that doing this is a (possibly
disastrously) bad idea


I heartily second that hazard!!!

cheers,

Rolf Turner


Bert Gunter
Genentech Nonclinical Biostatistics



-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- 
project.org] On

Behalf Of Carvalho, Benilton
Sent: Thursday, October 01, 2009 3:34 PM
To: Amit Kumar
Cc: r-help@r-project.org
Subject: Re: [R] removing missing values from a matrix

red[is.na(red)] <- 0

Sent from my iPhone

On Oct 1, 2009, at 7:22 PM, "Amit Kumar" 
wrote:


Hi! All,
I am working with a large matrix of dimension 23689 x 162. Some of  
the

values of this matrix is missing (NA). And it looks something like
that:


dim(red)

 23689  162


red

   [,1]  [,2]  [,3]  [,4]  [,5]
[1,]2 NA4 9 6
[2,]5 NA6   NA 1
[3,]   NA2 11   2320
[4,]2  1 21  NA3
[5,]   NA7 NA  52NA

Here I want to convert NA to zero everywhere in the matrix. I do no
want to omit NA using na.omit(red). I want output something like  
that:

red

   [,1]  [,2]  [,3]  [,4]  [,5]
[1,]2  0 4 9 6
[2,]5  0 6 0 1
[3,]0  2 11   2320
[4,]2  1 210 3
[5,]0  7  052 0

Please, help thanks.
Amit

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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.



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


[R] Level name as object name

2009-10-01 Thread jimdare

Hi,

If I have a dataset called "data" with a factor called "Species" that has
three levels "Sp1", "Sp2", and "Sp3".  Is there a way to name an object
after a specific level?  I have tried the code below and get the error
"error in paste(levels(data$Species)[1]) <- 1:10   could not find function
"paste<-"

Code:
paste(levels(data$Species)[1])<-1:10

Thanks for your help.

James
-- 
View this message in context: 
http://www.nabble.com/Level-name-as-object-name-tp25708252p25708252.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] removing missing values from a matrix

2009-10-01 Thread Bert Gunter
However, I would hazard the guess that doing this is a (possibly
disastrously) bad idea.

Bert Gunter
Genentech Nonclinical Biostatistics
 
 

-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of Carvalho, Benilton
Sent: Thursday, October 01, 2009 3:34 PM
To: Amit Kumar
Cc: r-help@r-project.org
Subject: Re: [R] removing missing values from a matrix

red[is.na(red)] <- 0

Sent from my iPhone

On Oct 1, 2009, at 7:22 PM, "Amit Kumar" 
wrote:

> Hi! All,
> I am working with a large matrix of dimension 23689 x 162. Some of the
> values of this matrix is missing (NA). And it looks something like
> that:
>
>> dim(red)
>  23689  162
>
>> red
>[,1]  [,2]  [,3]  [,4]  [,5]
> [1,]2 NA4 9 6
> [2,]5 NA6   NA 1
> [3,]   NA2 11   2320
> [4,]2  1 21  NA3
> [5,]   NA7 NA  52NA
>
> Here I want to convert NA to zero everywhere in the matrix. I do no
> want to omit NA using na.omit(red). I want output something like that:
>> red
>[,1]  [,2]  [,3]  [,4]  [,5]
> [1,]2  0 4 9 6
> [2,]5  0 6 0 1
> [3,]0  2 11   2320
> [4,]2  1 210 3
> [5,]0  7  052 0
>
> Please, help thanks.
> Amit
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/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] removing missing values from a matrix

2009-10-01 Thread Carvalho, Benilton
red[is.na(red)] <- 0

Sent from my iPhone

On Oct 1, 2009, at 7:22 PM, "Amit Kumar" 
wrote:

> Hi! All,
> I am working with a large matrix of dimension 23689 x 162. Some of the
> values of this matrix is missing (NA). And it looks something like
> that:
>
>> dim(red)
>  23689  162
>
>> red
>[,1]  [,2]  [,3]  [,4]  [,5]
> [1,]2 NA4 9 6
> [2,]5 NA6   NA 1
> [3,]   NA2 11   2320
> [4,]2  1 21  NA3
> [5,]   NA7 NA  52NA
>
> Here I want to convert NA to zero everywhere in the matrix. I do no
> want to omit NA using na.omit(red). I want output something like that:
>> red
>[,1]  [,2]  [,3]  [,4]  [,5]
> [1,]2  0 4 9 6
> [2,]5  0 6 0 1
> [3,]0  2 11   2320
> [4,]2  1 210 3
> [5,]0  7  052 0
>
> Please, help thanks.
> Amit
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/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] Using optimize with array variables

2009-10-01 Thread Charles C. Berry

On Thu, 1 Oct 2009, Vik wrote:


Thanks Charles, I have been able to change the function and to make it work.
I have also gotten the same results using nlm().

Now the question I have (and that google has not helped on) is which
optimization functions can I use for solving for two distinct variables
instead of only one? Thanks again.


Once again, the _posting guide_ rides to the rescue.

Following the advice there,

RSiteSearch("optimization",restric="functions")

would have answered your question.

:-)




On Thu, Oct 1, 2009 at 1:06 PM, Charles C. Berry wrote:


On Thu, 1 Oct 2009, Vik wrote:

 Hello,


I am trying to figure out how to use optimize() with array variables
as inputs. I have a for loop in the function definition:

SS <- function(int,slo,x,y){
for(i in 1:length(x)) ((int+slo*x[i])-y[i])^2->squares[i]
sum(squares)->>sum_squares
output_txt = c ("The sum of squares is", sum_squares)
print(output_txt, quote=FALSE)}




Try running your code in a clean session. There is an error (and not the
one you quote below).


After you get rid of that error, try

   val <- SS ( 0.1, 1, 1, 1 )

then

   print( val )

The difficulty optimize is having should be apparent.

In spite of the pressure you are under, you will need to slow down, write
readable code, and take the time to learn about writing functions in R
before you can hope to get anywhere with a problem like this.

Read the posting guide. For a problem like this one, the 'Some' mentioned
below includes many of the people on this list who can provide useful,
knowledgeable answers:

   Some consider it good manners to include a concise signature
   specifying affiliation


HTH,

Chuck


p.s. do not use '<<-' or '->>' until you really, really know what it does
(which means you understand 'scoping')!

 Even assuming I make x and y single-integer variables, for example:


optimize(SS, c(0,1), tol = 0.0001, x=1, y=1, slo=1)

I get the error:

Error in optimize(SS, c(0, 1), tol = 1e-04, x = 1, y = 1, slo = 1) :
 invalid function value in 'optimize'

Not sure what that means. This also happens when x and y are defined
as arrays. Does optimize require me to input values for all variables
that are not being optimized (i.e. for n-1 of the inputs)? Why am I
getting an error.

I am new to R and under pressure to get some calculations done for my
work. I'd appreciate an answer to the specific question - and I fully
understand that I need to read up on R basics in more depth, which I
am doing as best I can while trying to get this work done. 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.



Charles C. Berry(858) 534-2098
   Dept of Family/Preventive
Medicine
E mailto:cbe...@tajo.ucsd.edu   UC San Diego
http://famprevmed.ucsd.edu/faculty/cberry/  La Jolla, San Diego 92093-0901





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



Charles C. Berry(858) 534-2098
Dept of Family/Preventive Medicine
E mailto:cbe...@tajo.ucsd.edu   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.


[R] removing missing values from a matrix

2009-10-01 Thread Amit Kumar
Hi! All,
I am working with a large matrix of dimension 23689 x 162. Some of the
values of this matrix is missing (NA). And it looks something like
that:

>dim(red)
  23689  162

>red
[,1]  [,2]  [,3]  [,4]  [,5]
[1,]2 NA4 9 6
[2,]5 NA6   NA 1
[3,]   NA2 11   2320
[4,]2  1 21  NA3
[5,]   NA7 NA  52NA

Here I want to convert NA to zero everywhere in the matrix. I do no
want to omit NA using na.omit(red). I want output something like that:
>red
[,1]  [,2]  [,3]  [,4]  [,5]
[1,]2  0 4 9 6
[2,]5  0 6 0 1
[3,]0  2 11   2320
[4,]2  1 210 3
[5,]0  7  052 0

Please, help thanks.
Amit

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] aproximate a titration kurve to the measure data.

2009-10-01 Thread awayguy

yes, halo thank you.
my measure data:
v2 <- c(0, 2, 4, 6, 6.2, 6.4, 6.6, 6.8, 7, 7.2, 7.4, 7.6, 7.8, 8, 10, 12,
14)
ph2 <- c(12.10, 11.94, 11.68, 11.11, 10.91, 10.74, 10.47, 9.71, 7.1, 4.24,
3.3, 3.08, 2.98, 2.86, 2.33, 2.11, 1.98)

with regards

bartjoosen wrote:
> 
> Hi,
> 
> This should be possible, even with automatic EP detection.
> Can you give use some example titration data, or the used matlab code?
> 
> If you want some introduction papers to R, take a look at the documents at
> CRAN (CRAN > other)
> 
> Bart
> 
> 
> 
> awayguy wrote:
>> 
>> Halo
>> 
>> i'm studying chemistry, today we made an experiment and i have to draw a
>> titration kurve for my mess data. we can do it on a mm paper, or we can
>> also use a programe. people from chemistry recomend "R"
>> last year i studied civil eng. and we used Matlab, as I see, R ist very
>> similar to it, but its got other comands.
>> But i think R would be a good help for some exercises.
>> 
>> so my main question is: i have some measurement data from my titration,
>> and I want aproximate a kurve to this data. is it possible to do it with
>> R?
>> 
>> a titration kurve looks like this:
>> 
>>  http://www.nabble.com/file/p25685986/acetic-acid-titration-curve.png 
>> 
>> hope you can help me, and yes when its possible, if you know something
>> like a tutorial then i would be glad if you could post it.
>> 
>> with regards
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/aproximate-a-titration-kurve-to-the-measure-data.-tp25685986p25703104.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] How to use Subpopulation data?

2009-10-01 Thread Bernardo Rangel Tura
On Thu, 2009-10-01 at 13:34 +, KABELI MEFANE wrote:
> ## package sampling
> 
> stra=strata(sampleframe,c("type","value","rating"),size=c(20,80,200,300,400),
> method="srswor")
> sample.strat<-getdata(sampleframe,stra)
> 
> sample.strat
> 

Try:

stra<-strata(sampleframe,size=c(20,80,200,300,400),method="srswor")
sample.strat<-getdata(sampleframe,stra)
sample.strat

-- 
Bernardo Rangel Tura, M.D,MPH,Ph.D
National Institute of Cardiology
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] Help me replace a for loop with an "apply" function

2009-10-01 Thread jim holtman
What I am doing is trying to determine where the dates are not
sequential (difference is not one day).  Everytime that this occurs,
the expression 'diff(.days) != 1' is TRUE and this is where a new
sequence starts.  'diff' will return a vector one shorter than its
input; I am assuming that the first date starts a sequence, so that is
why the TRUE is the initial entry.  Using 'cumsum' will generate a
vector that has the same values for dates that are consecutive.  By
using table, you can determine what the maximum number of consecutive
days are.

HTH

On Thu, Oct 1, 2009 at 2:57 PM, gd047  wrote:
>
> Congratulations!
>
> Could you explain to me the reason you add an initial "TRUE" value in the
> cumulatice sum?
>
>
>
> jholtman wrote:
>>
>> Will this work:
>>
>>> x <- read.table(textConnection("   day         user_id
>> + 2008/11/01    2001
>> + 2008/11/01    2002
>> + 2008/11/01    2003
>> + 2008/11/01    2004
>> + 2008/11/01    2005
>> + 2008/11/02    2001
>> + 2008/11/02    2005
>> + 2008/11/03    2001
>> + 2008/11/03    2003
>> + 2008/11/03    2004
>> + 2008/11/03    2005
>> + 2008/11/04    2001
>> + 2008/11/04    2003
>> + 2008/11/04    2004
>> + 2008/11/04    2005"), header=TRUE)
>>> closeAllConnections()
>>> # convert to Date
>>> x$day <- as.Date(x$day, format="%Y/%m/%d")
>>> # split by user and then look for contiguous days
>>> contig <- sapply(split(x$day, x$user_id), function(.days){
>> +     .diff <- cumsum(c(TRUE, diff(.days) != 1))
>> +     max(table(.diff))
>> + })
>>> contig
>> 2001 2002 2003 2004 2005
>>    4    1    2    2    4
>>>
>>>
>>
>>
>> On Thu, Oct 1, 2009 at 11:29 AM, gd047  wrote:
>>>
>>> ...if that is possible
>>>
>>> My task is to find the longest streak of continuous days a user
>>> participated
>>> in a game.
>>>
>>> Instead of writing an sql function, I chose to use the R's rle function,
>>> to
>>> get the longest streaks and then update my db table with the results.
>>>
>>> The (attached) dataframe is something like this:
>>>
>>>    day         user_id
>>> 2008/11/01    2001
>>> 2008/11/01    2002
>>> 2008/11/01    2003
>>> 2008/11/01    2004
>>> 2008/11/01    2005
>>> 2008/11/02    2001
>>> 2008/11/02    2005
>>> 2008/11/03    2001
>>> 2008/11/03    2003
>>> 2008/11/03    2004
>>> 2008/11/03    2005
>>> 2008/11/04    2001
>>> 2008/11/04    2003
>>> 2008/11/04    2004
>>> 2008/11/04    2005
>>>
>>>
>>>
>>> --- R code follows
>>> --
>>>
>>>
>>> # turn it to a contingency table
>>> my_table <- table(user_id, day)
>>>
>>> # get the streaks
>>> rle_table <- apply(my_table,1,rle)
>>>
>>> # verify the longest streak of "1"s for user 2001
>>> # as.vector(tapply(rle_table$'2001'$lengths, rle_table$'2001'$values,
>>> max)["1"])
>>>
>>> # loop to get the results
>>> # initiate results matrix
>>> res<-matrix(nrow=dim(my_table)[1], ncol=2)
>>>
>>> for (i in 1:dim(my_table)[1]) {
>>> string <- paste("as.vector(tapply(rle_table$'", rownames(my_table)[i],
>>> "'$lengths, rle_table$'", rownames(my_table)[i], "'$values, max)['1'])",
>>> sep="")
>>> res[i,]<-c(as.integer(rownames(my_table)[i]) , eval(parse(text=string)))
>>> }
>>>
>>>
>>> 
>>> --- end of R code
>>>
>>> Unfortunately this for loop takes too long and I' wondering if there is a
>>> way to produce the res matrix using a function from the "apply" family.
>>>
>>> Thank you in advance
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Help-me-replace-a-for-loop-with-an-%22apply%22-function-tp25696937p25696937.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 that you are trying to solve?
>>
>> __
>> R-help@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>>
>
> --
> View this message in context: 
> http://www.nabble.com/Help-me-replace-a-for-loop-with-an-%22apply%22-function-tp25696937p25704683.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 that you are trying to solve?

__
R-help@r

Re: [R] How to use Subpopulation data?

2009-10-01 Thread KABELI MEFANE
helpers 
 
 
I have tried doing everything i can but i think my problem may be solved by 
even one command or statement. If i have a dataframe with variale name A,B,C 
and i subset this dataframe, how do i retain the variable names to use in my 
subset. 
 
In short i need to forget about the original dataframe until after i have 
finished with the subset, then also how do i call it back, may be by 
sampleframe$type,...sampleframe$value?
 
Thanks and i rest my case

--- On Thu, 1/10/09, KABELI MEFANE  wrote:


From: KABELI MEFANE 
Subject: Re: [R] How to use Subpopulation data?
To: "Peter Ehlers" 
Cc: R-help@r-project.org, "Bernardo Rangel Tura" 
Date: Thursday, 1 October, 2009, 2:34 PM



Thanks 
 
i was not aware of str, i have a very large code since i am new to r.
I forgot to mention that the package is sampling. Actually i have this 
simulated code:
 
n <- c(100,400,1000,1500,2000)
x <- c(2,3,3,3,5)
y <- c(7,7,9,10,10)
s <- function(mn, mx, n) {sample(mn:mx, n, replace=TRUE)}
rating=unlist(mapply(s, x, y, n))

Hypermarket <- matrix(rnorm(100, mean=5, sd=5000))
Supermarket <- matrix(rnorm(400, mean=34000, sd=3000))
Minimarket  <- matrix(rnorm(1000, mean=1,sd=2000))
Cornershop  <- matrix(rnorm(1500, mean=2500, sd=500))
Spazashop   <- matrix(rnorm(2000, mean=1000, sd=250))
dat=data.frame(type=c(rep("Hypermarket",100), rep("Supermarket",400),
rep("Minimarket",1000),rep("Cornershop",1500), rep("Spazashop",2000)),
value=c(Hypermarket, Supermarket, Minimarket, Cornershop,Spazashop))
 
##sample frame
sampleframe=data.frame(type=c(rep("Hypermarket",100), rep("Supermarket",400),
rep("Minimarket",1000),rep("Cornershop",1500), rep("Spazashop",2000)),
value=c(Hypermarket, Supermarket, Minimarket, Cornershop,Spazashop),
ratings =cbind(rating))
 
## package sampling
 
stra=strata(sampleframe,c("type","value","rating"),size=c(20,80,200,300,400),
method="srswor")
sample.strat<-getdata(sampleframe,stra)

sample.strat

now i want to find different estimates from sample.strat
 
Help appreciated.





      
    [[alternative HTML version deleted]]


-Inline Attachment Follows-


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] caret package for time series applications

2009-10-01 Thread Max Kuhn
Zubin,

> Hello, I have some time series applications, where i have a large set of X
> variables (hundreds) and thousands of time data points (sampling every
> minute).
> I like to use the caret package to support the analysis, variable selection
> and model selection.  However, reading the documentation, it looks like
> caret uses resampling methods.  Not sure if these methods work with time
> series, as you need  a block bootstrap or such.
> My question:  Does the caret package support the usage of time series data?

I don't know much about resampling with time series. If regular
resampling methods are not appropriate, you can use the index argument
of trainControl to specify the indices of the samples that you want in
the training set. We can always add resampling options that are
specific to time series.

It also assumes that the predictors are in the form of a data frame or
matrix, so I'm not sure that passing an object of some other class
would work right now. I'd be happy to add new methods for train that
are specific to certain data types.

-- 

Max

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Compress (gzip) a pdf device - [ ] Message is from an unknown sender

2009-10-01 Thread Duncan Temple Lang

The latest version of the Rcompression package (www.omegahat.org/Rcompression)
provides a gzip() function that does this. The example in the help page shows
how.

There is a source version of the package in the Omegahat repository (and on the 
package's
Web site), but no binaries at this point.

 D.

Daniele Amberti wrote:
> system() invokes the OS command specified by command, in the example you gave 
> it means that gzip is installed and (assuming Windows OS) it is in your 
> search path.
> 
> I'd like to have a solution that do not use external programs.
> 
> Thanks
> Daniele
> 
> -Original Message-
> From: Ista Zahn [mailto:istaz...@gmail.com]
> Sent: 01 October 2009 17:11
> To: Daniele Amberti
> Cc: r-help@r-project.org; Rainer M Krug
> Subject: Re: [R] Compress (gzip) a pdf device - [ ] Message is from an 
> unknown sender
> 
> I guess I don't understand what your're trying to do. gzip-ing a file
> from within R is easy enough:
> 
> pdf(file="CompressMe.pdf")
> plot(rnorm(100))
> dev.off()
> system("gzip CompressMe.pdf")
> 
> I think you want something more complicated, but I'm not sure what.
> 
> -Ista
> 
> On Thu, Oct 1, 2009 at 6:41 AM, Daniele Amberti  
> wrote:
>> By now It seems nobody have idea.
>>
>> zz <- gzfile("C:/gzpdftest.gz", "wb")
>> pdf(file = zz)
>> plot(USArrests)
>> dev.off()
>> close(zz)
>>
>> produce a file named "3" without any extension in my working directory.
>>
>> Also I don't have any news on how to gzip the pdf afterward (without using 
>> an external executable).
>>
>> Daniele
>>
>>
>> From: Rainer M Krug [mailto:r.m.k...@gmail.com]
>> Sent: 30 September 2009 10:26
>> To: Daniele Amberti
>> Cc: r-help@r-project.org
>> Subject: Re: [R] Compress (gzip) a pdf device - [ ] Message is from an 
>> unknown sender
>>
>>
>> 2009/9/30 Daniele Amberti 
>> mailto:daniele.ambe...@ors.it>>
>> I have not found an easy way to compress a file on filesystem.
>> Especially I'd like to compress a pdf from pdf() function/device. Is it 
>> possible to compress It on the flight?
>> I'd like to do something like:
>> pdf(gzipconnection())
>> dev.off()
>>
>> I guess this boils down to a question I asked some time ago concerning 
>> getting the filename of a pdf() device, as I wanted to create a compressed 
>> pdf from the uncompressed pdf created by R (not "zipping" the pdf).
>> It does not seem to be possible, at least I did not get any response which I 
>> could use to implement my idea (create my dev.off(), which calls dev.off() 
>> and afterwards compresses the pdf by using the file name).
>>
>> If you find a solution, please let me know.
>>
>> Cheers,
>>
>> Rainer
>> If It is not possible, how can I create a gzip with the pdf?
>>
>> Thanks
>> Daniele A.
>>
>>
>>
>> 
>>
>>
>>
>> 
>> ORS Srl
>>
>> Via Agostino Morando 1/3 12060 Roddi (Cn) - Italy
>> Tel. +39 0173 620211
>> Fax. +39 0173 620299 / +39 0173 433111
>> Web Site www.ors.it
>>
>> 
>> Qualsiasi utilizzo non autorizzato del presente messaggio e dei suoi 
>> allegati ? vietato e potrebbe costituire reato.
>> Se lei avesse ricevuto erroneamente questo messaggio, Le saremmo grati se 
>> provvedesse alla distruzione dello stesso
>> e degli eventuali allegati.
>> Opinioni, conclusioni o altre informazioni riportate nella e-mail, che non 
>> siano relative alle attivit? e/o
>> alla missione aziendale di O.R.S. Srl si intendono non attribuibili alla 
>> societ? stessa, n? la impegnano in alcun modo.
>>
>>[[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.
>>
> 
> 
> 
> --
> Ista Zahn
> Graduate student
> University of Rochester
> http://yourpsyche.org
> 
> ORS Srl
> 
> Via Agostino Morando 1/3 12060 Roddi (Cn) - Italy
> Tel. +39 0173 620211
> Fax. +39 0173 620299 / +39 0173 433111
> Web Site www.ors.it
> 
> 
> Qualsiasi utilizzo non autorizzato del presente messaggio e dei suoi allegati 
> è vietato e potrebbe costituire reato.
> Se lei avesse ricevuto erroneamente questo messaggio, Le saremmo grati se 
> provvedesse alla distruzione dello stesso
> e degli eventuali allegati.
> Opinioni, conclusioni o altre informazioni riportate nella e-mail, che non 
> siano relative alle attività e/o
> alla missione aziendale di O.R.S. Srl si intendono non  attribuibili alla 
> società stessa, né la impegnano in alcun modo.
> 
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read t

Re: [R] Using optimize with array variables

2009-10-01 Thread Vik
Thanks Charles, I have been able to change the function and to make it work.
I have also gotten the same results using nlm().

Now the question I have (and that google has not helped on) is which
optimization functions can I use for solving for two distinct variables
instead of only one? Thanks again.

On Thu, Oct 1, 2009 at 1:06 PM, Charles C. Berry wrote:

> On Thu, 1 Oct 2009, Vik wrote:
>
>  Hello,
>>
>> I am trying to figure out how to use optimize() with array variables
>> as inputs. I have a for loop in the function definition:
>>
>> SS <- function(int,slo,x,y){
>> for(i in 1:length(x)) ((int+slo*x[i])-y[i])^2->squares[i]
>> sum(squares)->>sum_squares
>> output_txt = c ("The sum of squares is", sum_squares)
>> print(output_txt, quote=FALSE)}
>>
>>
>
> Try running your code in a clean session. There is an error (and not the
> one you quote below).
>
>
> After you get rid of that error, try
>
>val <- SS ( 0.1, 1, 1, 1 )
>
> then
>
>print( val )
>
> The difficulty optimize is having should be apparent.
>
> In spite of the pressure you are under, you will need to slow down, write
> readable code, and take the time to learn about writing functions in R
> before you can hope to get anywhere with a problem like this.
>
> Read the posting guide. For a problem like this one, the 'Some' mentioned
> below includes many of the people on this list who can provide useful,
> knowledgeable answers:
>
>Some consider it good manners to include a concise signature
>specifying affiliation
>
>
> HTH,
>
> Chuck
>
>
> p.s. do not use '<<-' or '->>' until you really, really know what it does
> (which means you understand 'scoping')!
>
>  Even assuming I make x and y single-integer variables, for example:
>>
>> optimize(SS, c(0,1), tol = 0.0001, x=1, y=1, slo=1)
>>
>> I get the error:
>>
>> Error in optimize(SS, c(0, 1), tol = 1e-04, x = 1, y = 1, slo = 1) :
>>  invalid function value in 'optimize'
>>
>> Not sure what that means. This also happens when x and y are defined
>> as arrays. Does optimize require me to input values for all variables
>> that are not being optimized (i.e. for n-1 of the inputs)? Why am I
>> getting an error.
>>
>> I am new to R and under pressure to get some calculations done for my
>> work. I'd appreciate an answer to the specific question - and I fully
>> understand that I need to read up on R basics in more depth, which I
>> am doing as best I can while trying to get this work done. 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.
>>
>>
> Charles C. Berry(858) 534-2098
>Dept of Family/Preventive
> Medicine
> E mailto:cbe...@tajo.ucsd.edu   UC San Diego
> http://famprevmed.ucsd.edu/faculty/cberry/  La Jolla, San Diego 92093-0901
>
>
>

[[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] Espresso heuristic logic minimizer for R ?

2009-10-01 Thread Ali Salehi
Hi,
 I am wondering, does anybody knows if there is any package/function
in R I can use to calculate  the
espresso heuristic logic minimizer ?
(http://en.wikipedia.org/wiki/Espresso_heuristic_logic_minimizer)

 Also, would you please kindly let me know if there is any open source
computer algebra system which has the espresso algorithm implemented.


Kind regards,
-A
**
Ali Salehi, LSIR - Distributed Information Systems Laboratory
EPFL-IC-IIF-LSIR, Bâtiment BC, Station 14, CH-1015 Lausanne, Switzerland.
http://lsirpeople.epfl.ch/salehi/
email: ali.sal...@epfl.ch
Tel: +41-21-6936656 Mobile: +41-21-788152020 Fax: +41-21-6938115

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Can You Recommend Books for Linear Mixed Models in R

2009-10-01 Thread milton ruser
Hi Pat,

I am happy with the book "Mixed Effects Models and Extensions in Ecology
with R"
by Zuur, Ieno, Walker, Saveliev and Smith. In fact I am reading chapter by
chapter,
and the reading is very digestible, as well as the examples are quite easy
to understand
and to be reference for our "real world".

Cheers

milton
brazil=toronto

On Thu, Oct 1, 2009 at 12:10 PM, Pat Schmitz  wrote:

> All
>
> I have been looking into the books on performing statistics in R, in
> particular I am interested in General Linear Mixed Models, for Randomized
> Complete Block Design Experiments
>
> The list I have come away with so far is:
>
> Mixed Effects Models in S and S-plus by Pinheiro (2002)
>
> http://www.amazon.com/Mixed-Effects-Models-S-S-Plus/dp/0387989579/ref=wl_itt_dp_o?ie=UTF8&coliid=I1WXOBRXMHD30V&colid=38N475HUK5VPJ
>
> Linear Models with R by Faraway (2004)
>
> http://www.amazon.com/Linear-Models-Texts-Statistical-Science/dp/1584884258/ref=sr_1_1?ie=UTF8&s=books&qid=1254412763&sr=1-1
>
> Extending the Linear Model with R by Faraway (2005)
>
> http://www.amazon.com/Extending-Linear-Model-Generalized-Nonparametric/dp/158488424X/ref=pd_sim_b_7
>
> Which of these would you as statisticians, researchers, scientists most
> recommend?
> Are there others in this realm of statistics that I have not discovered,
> that might be more effective?
>
> Thanks
> Pat
>
>
>
> --
> Patrick Schmitz
> Graduate Student
> Plant Biology
> 1206 West Gregory Drive
> RM 1500
>
>[[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

[[alternative HTML version deleted]]

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


[R] inverse currying

2009-10-01 Thread baptiste auguie
Dear list,

I have the following function,

sugar = function(fun, id = "id"){
  ff <- formals(fun)
  if( id %in% names(ff))
stop("id is part of args(fun)")
  formals(fun) <- c(unlist(ff), alist(id=))
  fun
}

which one may use on a function foo,

foo = function(x){
  x
}

sugar(foo) # results in the extended closure,

function (x, id)
{
x
}

Its limitation (other than not working with .Primitives) is the 'id'
tag that I add in the formals of fun(). I don't know how to create a
alist(id=) pairlist where id can be changed. I tried the usual bquote
and substitute approach but they don't seem to work here. I suppose I
could do something like,

parse(text = paste("alist(",id, "=)", sep=""))

but this is usually not recommended.

Any ideas?

Best regards,

baptiste

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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 me replace a for loop with an "apply" function

2009-10-01 Thread gd047

Congratulations!

Could you explain to me the reason you add an initial "TRUE" value in the
cumulatice sum?



jholtman wrote:
> 
> Will this work:
> 
>> x <- read.table(textConnection("   day user_id
> + 2008/11/012001
> + 2008/11/012002
> + 2008/11/012003
> + 2008/11/012004
> + 2008/11/012005
> + 2008/11/022001
> + 2008/11/022005
> + 2008/11/032001
> + 2008/11/032003
> + 2008/11/032004
> + 2008/11/032005
> + 2008/11/042001
> + 2008/11/042003
> + 2008/11/042004
> + 2008/11/042005"), header=TRUE)
>> closeAllConnections()
>> # convert to Date
>> x$day <- as.Date(x$day, format="%Y/%m/%d")
>> # split by user and then look for contiguous days
>> contig <- sapply(split(x$day, x$user_id), function(.days){
> + .diff <- cumsum(c(TRUE, diff(.days) != 1))
> + max(table(.diff))
> + })
>> contig
> 2001 2002 2003 2004 2005
>41224
>>
>>
> 
> 
> On Thu, Oct 1, 2009 at 11:29 AM, gd047  wrote:
>>
>> ...if that is possible
>>
>> My task is to find the longest streak of continuous days a user
>> participated
>> in a game.
>>
>> Instead of writing an sql function, I chose to use the R's rle function,
>> to
>> get the longest streaks and then update my db table with the results.
>>
>> The (attached) dataframe is something like this:
>>
>>    day         user_id
>> 2008/11/01    2001
>> 2008/11/01    2002
>> 2008/11/01    2003
>> 2008/11/01    2004
>> 2008/11/01    2005
>> 2008/11/02    2001
>> 2008/11/02    2005
>> 2008/11/03    2001
>> 2008/11/03    2003
>> 2008/11/03    2004
>> 2008/11/03    2005
>> 2008/11/04    2001
>> 2008/11/04    2003
>> 2008/11/04    2004
>> 2008/11/04    2005
>>
>>
>>
>> --- R code follows
>> --
>>
>>
>> # turn it to a contingency table
>> my_table <- table(user_id, day)
>>
>> # get the streaks
>> rle_table <- apply(my_table,1,rle)
>>
>> # verify the longest streak of "1"s for user 2001
>> # as.vector(tapply(rle_table$'2001'$lengths, rle_table$'2001'$values,
>> max)["1"])
>>
>> # loop to get the results
>> # initiate results matrix
>> res<-matrix(nrow=dim(my_table)[1], ncol=2)
>>
>> for (i in 1:dim(my_table)[1]) {
>> string <- paste("as.vector(tapply(rle_table$'", rownames(my_table)[i],
>> "'$lengths, rle_table$'", rownames(my_table)[i], "'$values, max)['1'])",
>> sep="")
>> res[i,]<-c(as.integer(rownames(my_table)[i]) , eval(parse(text=string)))
>> }
>>
>>
>> 
>> --- end of R code
>>
>> Unfortunately this for loop takes too long and I' wondering if there is a
>> way to produce the res matrix using a function from the "apply" family.
>>
>> Thank you in advance
>> --
>> View this message in context:
>> http://www.nabble.com/Help-me-replace-a-for-loop-with-an-%22apply%22-function-tp25696937p25696937.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 that you are trying to solve?
> 
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Help-me-replace-a-for-loop-with-an-%22apply%22-function-tp25696937p25704683.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] caret package for time series applications

2009-10-01 Thread zubin
Hello, I have some time series applications, where i have a large set of 
X variables (hundreds) and thousands of time data points (sampling every 
minute). 

I like to use the caret package to support the analysis, variable 
selection and model selection.  However, reading the documentation, it 
looks like caret uses resampling methods.  Not sure if these methods 
work with time series, as you need  a block bootstrap or such. 


My question:  Does the caret package support the usage of time series data?

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Normal distribution

2009-10-01 Thread Peter Ehlers

Another interesting visual technique is given by the
qreference() function in pkg:DAAG. I've used this type
of display effectively with non-stats people as well
as in teaching intro courses in stats.
(I would randomize the location of the actual-data panel
and not use a different colour. The question then is,
can you discern the actual data from the simulated data?)

 -Peter Ehlers

Steve Lianoglou wrote:

Hi,

I think you can also use a qq-plot to do the same, no? You won't get a
statistic score + p.value, but perhaps you're more of a visual person?
:-)

-steve

On Thu, Oct 1, 2009 at 12:56 PM, Richardson, Patrick
 wrote:

?shapiro.test


-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On 
Behalf Of Noela Sánchez
Sent: Thursday, October 01, 2009 12:47 PM
To: r-help@r-project.org
Subject: [R] Normal distribution

Hi,

I am dealing with how to check in R if some data that I have belongs to a 
normal distribution or not. I am not interested in obtaining the theoreticall 
frequencies. I am only interested in determing if (by means of a test as 
Kolmogorov, or whatever), if my data are normal or not.

But I have tried with ks.test() and I have not got it.


--
Noela
Grupo de Recursos Marinos y Pesquerías
Universidad de A Coruña

   [[alternative HTML version deleted]]

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

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







__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Normal distribution

2009-10-01 Thread Peter Ehlers

Noela,

Package nortest has 5 tests of normality.

A word of caution: the wording of your question suggests that
you believe that, if the test you use does not reject the
normality hypothesis, you then have proof that your data come
from a Normal distribution. That's *NOT* true. Normality will
still be an *assumption*, albeit perhaps a reasonable one.
This is particularly important to realize if you have small
samples.

 -Peter Ehlers

Noela Sánchez wrote:

Hi,

I am dealing with how to check in R if some data that I have belongs to a
normal distribution or not. I am not interested in obtaining the
theoreticall frequencies. I am only interested in determing if (by means of
a test as Kolmogorov, or whatever), if my data are normal or not.

But I have tried with ks.test() and I have not got it.






__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] launching two RGUI computations from two different Excel workbooks

2009-10-01 Thread Erich Neuwirth

Please send questions like this to the rcom mailing list.
You can subscribe at rcom.univie.ac.at.


On Sep 28, 2009, at 1:34 PM, sowh...@o2.pl wrote:


Hello,

I have the following problem:

I have excel workbooks connected with R through RExcel package. Data  
are being loaded from excel, then they are processed in R and then  
the results are being put in excel. Everything works fine, except  
the fact that I can't launch two or more excel workbooks (and two or  
more R servers in the background) at the same time.
I have to wait until one computation is finished and then launch  
another one. It would be much easier and quicker for me to launch  
two or more computations at the same time. Is this possible to  
launch two different R servers from Excel?


Regards,

Wojciech Turski

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Looking for a better way to document my packages

2009-10-01 Thread Steve Lianoglou
Ah, great!

Thanks for the refs, I'll look into them.

-steve

On Thu, Oct 1, 2009 at 1:12 PM, baptiste auguie
 wrote:
> Hi,
>
> I know of three options that resemble your query,
>
> - the roxygen package
>
> - a ruby script called weeder by Hadley Wikham
>
> - the inlinedocs package on r-forge
>
> I only ever used roxygen though, so i can't speak for the relative
> merits of the others.
>
> HTH,
>
> baptiste
>
>
> 2009/10/1 Steve Lianoglou :
>> Hi all,
>>
>> Trying to do what my subject says.
>>
>> As I'm trying to be better about making packages out of my code, I'd like
>> the packages themselves to be better, which means *.Rd-documenting my code.
>> The thing is, from years of programming other languages prior to landing in
>> the R pond, I've grown accustomed to documenting my functions inline. I'm
>> not just used to it, but I like it more than having function documentation
>> completely removed from my function, code.
>>
>> So, for example
>>
>> myNeatFunction <- function(arg1, arg2, arg3=NULL, ...) {
>>  # One liner describing the neat thing this function does.
>>  #
>>  # More comments, probably very much what would be in the
>>  # \description section of the *Rd
>>  #
>>  # Parameters
>>  # --
>>  # arg1 : 
>>  # arg2 : 
>>  # ... This is essentially the same exact stuff that would
>>  # be in the \arguments{} section of the *.Rd
>>  #
>>  # Returns
>>  # ---
>>  # A description of what's returned, let's say this is
>>  # what you'd find in the \value{} section.
>>  #
>>  # Notes
>>  # -
>>  # Maybe something like the \details{} section, though this
>>  # might as well be up in the description section, too.
>>  # etc.
>> }
>>
>> There's essentially a 1-to-1 mapping of the comments I write here and what I
>> would write in an *.Rd file, but I'd rather have it written in my function
>> definition than an external document.
>>
>> Are there any tools that help facilitate this? Or are there better ways you
>> folks have figured out to do something similar?
>>
>> I don't need the function comment block to be exactly what I showed here,
>> but it's just an example of how I'm currently writing my stuff. I'm thinking
>> something like sphinx (http://sphinx.pocoo.org/) from the python world would
>> be cool. Perhaps there's a way to make a plugin for that to parse R-code.
>> That's more work than I want to bit off right now, but if there isn't
>> something useful in R-land already, it might be a fun side project.
>>
>> Just curious,
>> -steve
>>
>> --
>> Steve Lianoglou
>> Graduate Student: Computational Systems Biology
>>  |  Memorial Sloan-Kettering Cancer Center
>>  |  Weill Medical College of Cornell University
>> Contact Info: http://cbio.mskcc.org/~lianos/contact
>>
>> __
>> R-help@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>



-- 
Steve Lianoglou
Graduate Student: Computational Systems Biology
 | Memorial Sloan-Kettering Cancer Center
 | Weill Medical College of Cornell University
Contact Info: http://cbio.mskcc.org/~lianos/contact

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Normal distribution

2009-10-01 Thread Richardson, Patrick
I don't disagree. And to that end one could probably look at the skewness and 
kurtosis values as well. A combination of several techniques would probably be 
a good idea.

Best regards,

Patrick

-Original Message-
From: Steve Lianoglou [mailto:mailinglist.honey...@gmail.com] 
Sent: Thursday, October 01, 2009 1:18 PM
To: Richardson, Patrick
Cc: Noela Sánchez; r-help@r-project.org
Subject: Re: [R] Normal distribution

Hi,

I think you can also use a qq-plot to do the same, no? You won't get a
statistic score + p.value, but perhaps you're more of a visual person?
:-)

-steve

On Thu, Oct 1, 2009 at 12:56 PM, Richardson, Patrick
 wrote:
> ?shapiro.test
>
>
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On 
> Behalf Of Noela Sánchez
> Sent: Thursday, October 01, 2009 12:47 PM
> To: r-help@r-project.org
> Subject: [R] Normal distribution
>
> Hi,
>
> I am dealing with how to check in R if some data that I have belongs to a 
> normal distribution or not. I am not interested in obtaining the theoreticall 
> frequencies. I am only interested in determing if (by means of a test as 
> Kolmogorov, or whatever), if my data are normal or not.
>
> But I have tried with ks.test() and I have not got it.
>
>
> --
> Noela
> Grupo de Recursos Marinos y Pesquerías
> Universidad de A Coruña
>
>[[alternative HTML version deleted]]
>
> This email message, including any attachments, is for ...{{dropped:25}}

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Normal distribution

2009-10-01 Thread Steve Lianoglou
Hi,

I think you can also use a qq-plot to do the same, no? You won't get a
statistic score + p.value, but perhaps you're more of a visual person?
:-)

-steve

On Thu, Oct 1, 2009 at 12:56 PM, Richardson, Patrick
 wrote:
> ?shapiro.test
>
>
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On 
> Behalf Of Noela Sánchez
> Sent: Thursday, October 01, 2009 12:47 PM
> To: r-help@r-project.org
> Subject: [R] Normal distribution
>
> Hi,
>
> I am dealing with how to check in R if some data that I have belongs to a 
> normal distribution or not. I am not interested in obtaining the theoreticall 
> frequencies. I am only interested in determing if (by means of a test as 
> Kolmogorov, or whatever), if my data are normal or not.
>
> But I have tried with ks.test() and I have not got it.
>
>
> --
> Noela
> Grupo de Recursos Marinos y Pesquerías
> Universidad de A Coruña
>
>[[alternative HTML version deleted]]
>
> This email message, including any attachments, is for th...{{dropped:6}}
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
Steve Lianoglou
Graduate Student: Computational Systems Biology
 | Memorial Sloan-Kettering Cancer Center
 | Weill Medical College of Cornell University
Contact Info: http://cbio.mskcc.org/~lianos/contact

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Unable to install lme4

2009-10-01 Thread jamesmcc

This is the first time I've encountered R having difficulty with package and
R version compatibility. I cant believe no one has fixed generally so that
your version of R can get the latest package appropriate to that version.
How nice would that be? :)

Anyway, I figured it out for my version (2.8.1). I needed to install Matrix
package first, which was also outdated.

> R CMD INSTALL -l lib Matrix_0.999375-22.tar.gz
> R CMD INSTALL -l lib lme4_0.999375-28.tar.gz

it loads now within R. I haven used it much yet.



jamesmcc wrote:
> 
> I am baffled by this as well. I'm having the same issue. Using suse linux,
> with 64 bit R2.8.1.
> 
> Thanks, 
> 
> james
> 
> 
> 
> Zege, Andrew wrote:
>> 
>> I am unable to install package lme4, after several attempts to do so
>> using various repository URLs.
>> Just to make sure everything works fine with proxy, connection, etc, I
>> installed ggplot2 and it worked fine.
>> 
>> I am using command
>> 
>> install.packages("lme4", lib="/myRlibs"),
>> 
>> optionally using contrib argument with different URLs.
>> 
>> Error message the I get is
>> 
>> Warning message;
>> In install.packages("lme4", lib="/myRlibs")
>>  package 'lme4' is not available
>> 
>> 
>> Some other details, not sure how relevant are:
>> 
>> getOption("repos") returns "http://lib.stat.cmu.edu/R/CRAN";
>> 
>> I tried setting contrib to various other URL, such as 
>> "http://cran.mtu.edu/src/contrib"; or Berkeley URL, but with no success.
>> Actually, when I did available.packages() on this repos, I didn't see
>> lme4 in the package indices.
>> My machine has x86_64bit RedHat Linux.
>> 
>> Would appreciate any tips or directions,
>> 
>> Thanks
>> Andre
>> 
>> __
>> R-help@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/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/Unable-to-install--lme4-tp25514856p25703018.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] Looking for a better way to document my packages

2009-10-01 Thread baptiste auguie
Hi,

I know of three options that resemble your query,

- the roxygen package

- a ruby script called weeder by Hadley Wikham

- the inlinedocs package on r-forge

I only ever used roxygen though, so i can't speak for the relative
merits of the others.

HTH,

baptiste


2009/10/1 Steve Lianoglou :
> Hi all,
>
> Trying to do what my subject says.
>
> As I'm trying to be better about making packages out of my code, I'd like
> the packages themselves to be better, which means *.Rd-documenting my code.
> The thing is, from years of programming other languages prior to landing in
> the R pond, I've grown accustomed to documenting my functions inline. I'm
> not just used to it, but I like it more than having function documentation
> completely removed from my function, code.
>
> So, for example
>
> myNeatFunction <- function(arg1, arg2, arg3=NULL, ...) {
>  # One liner describing the neat thing this function does.
>  #
>  # More comments, probably very much what would be in the
>  # \description section of the *Rd
>  #
>  # Parameters
>  # --
>  # arg1 : 
>  # arg2 : 
>  # ... This is essentially the same exact stuff that would
>  # be in the \arguments{} section of the *.Rd
>  #
>  # Returns
>  # ---
>  # A description of what's returned, let's say this is
>  # what you'd find in the \value{} section.
>  #
>  # Notes
>  # -
>  # Maybe something like the \details{} section, though this
>  # might as well be up in the description section, too.
>  # etc.
> }
>
> There's essentially a 1-to-1 mapping of the comments I write here and what I
> would write in an *.Rd file, but I'd rather have it written in my function
> definition than an external document.
>
> Are there any tools that help facilitate this? Or are there better ways you
> folks have figured out to do something similar?
>
> I don't need the function comment block to be exactly what I showed here,
> but it's just an example of how I'm currently writing my stuff. I'm thinking
> something like sphinx (http://sphinx.pocoo.org/) from the python world would
> be cool. Perhaps there's a way to make a plugin for that to parse R-code.
> That's more work than I want to bit off right now, but if there isn't
> something useful in R-land already, it might be a fun side project.
>
> Just curious,
> -steve
>
> --
> Steve Lianoglou
> Graduate Student: Computational Systems Biology
>  |  Memorial Sloan-Kettering Cancer Center
>  |  Weill Medical College of Cornell University
> Contact Info: http://cbio.mskcc.org/~lianos/contact
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/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] Using optimize with array variables

2009-10-01 Thread Charles C. Berry

On Thu, 1 Oct 2009, Vik wrote:


Hello,

I am trying to figure out how to use optimize() with array variables
as inputs. I have a for loop in the function definition:

SS <- function(int,slo,x,y){
for(i in 1:length(x)) ((int+slo*x[i])-y[i])^2->squares[i]
sum(squares)->>sum_squares
output_txt = c ("The sum of squares is", sum_squares)
print(output_txt, quote=FALSE)}




Try running your code in a clean session. There is an error (and not the 
one you quote below).



After you get rid of that error, try

val <- SS ( 0.1, 1, 1, 1 )

then

print( val )

The difficulty optimize is having should be apparent.

In spite of the pressure you are under, you will need to slow down, write 
readable code, and take the time to learn about writing functions in R 
before you can hope to get anywhere with a problem like this.


Read the posting guide. For a problem like this one, the 'Some' mentioned 
below includes many of the people on this list who can provide useful, 
knowledgeable answers:


Some consider it good manners to include a concise signature
specifying affiliation


HTH,

Chuck


p.s. do not use '<<-' or '->>' until you really, really know what it does 
(which means you understand 'scoping')!



Even assuming I make x and y single-integer variables, for example:

optimize(SS, c(0,1), tol = 0.0001, x=1, y=1, slo=1)

I get the error:

Error in optimize(SS, c(0, 1), tol = 1e-04, x = 1, y = 1, slo = 1) :
 invalid function value in 'optimize'

Not sure what that means. This also happens when x and y are defined
as arrays. Does optimize require me to input values for all variables
that are not being optimized (i.e. for n-1 of the inputs)? Why am I
getting an error.

I am new to R and under pressure to get some calculations done for my
work. I'd appreciate an answer to the specific question - and I fully
understand that I need to read up on R basics in more depth, which I
am doing as best I can while trying to get this work done. 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.



Charles C. Berry(858) 534-2098
Dept of Family/Preventive Medicine
E mailto:cbe...@tajo.ucsd.edu   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.


Re: [R] Huge matrix: allocation works but assignment fails

2009-10-01 Thread Ben Bolker
> Remi wrote:

> 
> > (Failed to allocate a vector of size...)
> > What can I do? And, maybe even more important, how can one explains such 
> > a behavior?

 If your matrices are not sparse, get more memory. If they are,

 help("sparseMatrix",package=Matrix) ?

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Looking for a better way to document my packages

2009-10-01 Thread Steve Lianoglou

Hi all,

Trying to do what my subject says.

As I'm trying to be better about making packages out of my code, I'd  
like the packages themselves to be better, which means *.Rd- 
documenting my code. The thing is, from years of programming other  
languages prior to landing in the R pond, I've grown accustomed to  
documenting my functions inline. I'm not just used to it, but I like  
it more than having function documentation completely removed from my  
function, code.


So, for example

myNeatFunction <- function(arg1, arg2, arg3=NULL, ...) {
  # One liner describing the neat thing this function does.
  #
  # More comments, probably very much what would be in the
  # \description section of the *Rd
  #
  # Parameters
  # --
  # arg1 : 
  # arg2 : 
  # ... This is essentially the same exact stuff that would
  # be in the \arguments{} section of the *.Rd
  #
  # Returns
  # ---
  # A description of what's returned, let's say this is
  # what you'd find in the \value{} section.
  #
  # Notes
  # -
  # Maybe something like the \details{} section, though this
  # might as well be up in the description section, too.
  # etc.
}

There's essentially a 1-to-1 mapping of the comments I write here and  
what I would write in an *.Rd file, but I'd rather have it written in  
my function definition than an external document.


Are there any tools that help facilitate this? Or are there better  
ways you folks have figured out to do something similar?


I don't need the function comment block to be exactly what I showed  
here, but it's just an example of how I'm currently writing my stuff.  
I'm thinking something like sphinx (http://sphinx.pocoo.org/) from the  
python world would be cool. Perhaps there's a way to make a plugin for  
that to parse R-code. That's more work than I want to bit off right  
now, but if there isn't something useful in R-land already, it might  
be a fun side project.


Just curious,
-steve

--
Steve Lianoglou
Graduate Student: Computational Systems Biology
  |  Memorial Sloan-Kettering Cancer Center
  |  Weill Medical College of Cornell University
Contact Info: http://cbio.mskcc.org/~lianos/contact

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Revolutions blog: September roundup

2009-10-01 Thread David M Smith
I write about R every weekday at the Revolutions blog:
http://blog.revolution-computing.com .

In case you missed them, here are some articles from last month of
particular interest to R users.

http://bit.ly/WYAnM shows how to create a URL for a Google Spreadsheet
so you can read the data directly from the cloud in R with read.csv.

http://bit.ly/FuUNw reported on Google's use of R to predict economic
statistics from search activity.

http://bit.ly/10UbHc showed how to use the New York Times' API to mine
articles for word frequency data.

http://bit.ly/VKqSh discussed the similarities between Grand Central
Dispatch for Snow Leopard and parallel processing with foreach.

http://bit.ly/lRbAX announced a new R user group in Madison, Wisconsin.

http://bit.ly/2Ms5nM noted the popular blog flowingdata.com uses R as
the tool of choice for graphics (with touchups by Illustrator).

http://bit.ly/BIU9V remarked on the "Flash Mob" which has populated
stackoverflow.com with useful answers for many R questions.

http://bit.ly/2cysLh reviews Jeroen Ooms' web-based financial plotting
tool built on R.

http://bit.ly/TcfD1 linked to a script in R for 7 common machine
learning techniques. (And

http://bit.ly/YInMs touched on the distinctions between machine
learning and statistics.)

http://bit.ly/XgBoR linked to an analysis done in R of the
demographics of readers of Hacker News.

http://bit.ly/Eec5z noted that TechCruch Trends is using R for its
analysis of startup activity.

http://bit.ly/akFNd gave tips for adding error bars to barplots with ggplot2.

http://bit.ly/xxBNm showed how to present hierarchical clustering
models as a circular cladogram.

http://bit.ly/iteac gave some tips for getting started with bootstrapping in R.

http://bit.ly/2no2C showed how R is used to analyze milk yields.

http://bit.ly/VC7LE linked to a comprehensive reference to R for Matlab users.

http://bit.ly/1CqP6n gave a practical demonstration of ggplot2's
"grammar of graphics" concept.

http://bit.ly/tP3Ci is a pictorial story of how one user converted a
workflow based on Perl, Stata and Matlab to one solely based on R.

http://bit.ly/OY2CR reviewed some of the airline performance posters
from this year's Data Expo at the JSM.

Other non-R-specific stories in the last month covered stochastic
psychics (http://bit.ly/BIU9V), identifying individuals in "anonymous"
data (http://bit.ly/ho0Df), an apology for Turing
(http://bit.ly/QqW29), the Mythbusters' statistical philosophy
(http://bit.ly/f8Nia), the Bulgarian lottery coincidence
(http://bit.ly/Y1gaU), keyboards for pirates (http://bit.ly/t1C7a),
the Netflix prize (http://bit.ly/eS1nb), and which line to choose at
the supermarket (http://bit.ly/nHJkQ).

(I've provided short URLs above because many mailers break the long
direct URLs.)

The R Community Calendar has also been updated at:
http://blog.revolution-computing.com/calendar.html

September was the highest-traffic month yet for the Revolutions blog.
The Bulgarian Lottery article was quoted in the Wall Street Journal,
and the machine learning post was very popular on Hacker News. As
always, thanks for the comments and please keep sending suggestions to
me at da...@revolution-computing.com .

Don't forget you can also follow the blog using an RSS reader like
Google Reader, or by following me on Twitter (I'm @revodavid).

Cheers to all,
# David Smith
--
David M Smith 
Director of Community, REvolution Computing www.revolution-computing.com
Tel: +1 (206) 577-4778 x3203 (San Francisco, USA)

Check out our upcoming events schedule at www.revolution-computing.com/events

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Normal distribution

2009-10-01 Thread Richardson, Patrick
?shapiro.test


-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On 
Behalf Of Noela Sánchez
Sent: Thursday, October 01, 2009 12:47 PM
To: r-help@r-project.org
Subject: [R] Normal distribution

Hi,

I am dealing with how to check in R if some data that I have belongs to a 
normal distribution or not. I am not interested in obtaining the theoreticall 
frequencies. I am only interested in determing if (by means of a test as 
Kolmogorov, or whatever), if my data are normal or not.

But I have tried with ks.test() and I have not got it.


--
Noela
Grupo de Recursos Marinos y Pesquerías
Universidad de A Coruña

[[alternative HTML version deleted]]

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

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


Re: [R] Huge matrix: allocation works but assignment fails

2009-10-01 Thread Uwe Ligges



Remi wrote:

Hello everyone,

I am working with one big matrix:
w=matrix(0,18000,18000)

on a Linux computer with 16Go of RAM.

I can actually create the matrix, and even access elements:
w[10,10]
0

but if I try to change one element, it fails:
w[10,10]=1


In this case your object is copied and you need two times the space for 
your object.


Best,
Uwe Ligges



Erreur : impossible d'allouer un vecteur de taille 2531250 Ko
(Failed to allocate a vector of size...)

What can I do? And, maybe even more important, how can one explains such 
a behavior?


Thank you for any help/advice

Rémi Proville.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] .Rprofile file

2009-10-01 Thread Data Analytics Corp.

Hi,

I want to use the .RProfile to set defaults such as text editor.  Is 
this a file I need to create?  Also, where should I put it?  I tend to 
create .RData files for different projects, putting each in a different 
Windows (Vista) folder.  Is one .Rprofile file created  that any  
instance of R can access  (I would imagine so)?


Thanks,

Walt



--


Walter R. Paczkowski, Ph.D.
Data Analytics Corp.
44 Hamilton Lane
Plainsboro, NJ 08536

(V) 609-936-8999
(F) 609-936-3733
w...@dataanalyticscorp.com
www.dataanalyticscorp.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] Normal distribution

2009-10-01 Thread Noela Sánchez
Hi,

I am dealing with how to check in R if some data that I have belongs to a
normal distribution or not. I am not interested in obtaining the
theoreticall frequencies. I am only interested in determing if (by means of
a test as Kolmogorov, or whatever), if my data are normal or not.

But I have tried with ks.test() and I have not got it.


-- 
Noela
Grupo de Recursos Marinos y Pesquerías
Universidad de A Coruña

[[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] Help me replace a for loop with an "apply" function

2009-10-01 Thread jim holtman
Will this work:

> x <- read.table(textConnection("   day user_id
+ 2008/11/012001
+ 2008/11/012002
+ 2008/11/012003
+ 2008/11/012004
+ 2008/11/012005
+ 2008/11/022001
+ 2008/11/022005
+ 2008/11/032001
+ 2008/11/032003
+ 2008/11/032004
+ 2008/11/032005
+ 2008/11/042001
+ 2008/11/042003
+ 2008/11/042004
+ 2008/11/042005"), header=TRUE)
> closeAllConnections()
> # convert to Date
> x$day <- as.Date(x$day, format="%Y/%m/%d")
> # split by user and then look for contiguous days
> contig <- sapply(split(x$day, x$user_id), function(.days){
+ .diff <- cumsum(c(TRUE, diff(.days) != 1))
+ max(table(.diff))
+ })
> contig
2001 2002 2003 2004 2005
   41224
>
>


On Thu, Oct 1, 2009 at 11:29 AM, gd047  wrote:
>
> ...if that is possible
>
> My task is to find the longest streak of continuous days a user participated
> in a game.
>
> Instead of writing an sql function, I chose to use the R's rle function, to
> get the longest streaks and then update my db table with the results.
>
> The (attached) dataframe is something like this:
>
>    day         user_id
> 2008/11/01    2001
> 2008/11/01    2002
> 2008/11/01    2003
> 2008/11/01    2004
> 2008/11/01    2005
> 2008/11/02    2001
> 2008/11/02    2005
> 2008/11/03    2001
> 2008/11/03    2003
> 2008/11/03    2004
> 2008/11/03    2005
> 2008/11/04    2001
> 2008/11/04    2003
> 2008/11/04    2004
> 2008/11/04    2005
>
>
>
> --- R code follows
> --
>
>
> # turn it to a contingency table
> my_table <- table(user_id, day)
>
> # get the streaks
> rle_table <- apply(my_table,1,rle)
>
> # verify the longest streak of "1"s for user 2001
> # as.vector(tapply(rle_table$'2001'$lengths, rle_table$'2001'$values,
> max)["1"])
>
> # loop to get the results
> # initiate results matrix
> res<-matrix(nrow=dim(my_table)[1], ncol=2)
>
> for (i in 1:dim(my_table)[1]) {
> string <- paste("as.vector(tapply(rle_table$'", rownames(my_table)[i],
> "'$lengths, rle_table$'", rownames(my_table)[i], "'$values, max)['1'])",
> sep="")
> res[i,]<-c(as.integer(rownames(my_table)[i]) , eval(parse(text=string)))
> }
>
>
> 
> --- end of R code
>
> Unfortunately this for loop takes too long and I' wondering if there is a
> way to produce the res matrix using a function from the "apply" family.
>
> Thank you in advance
> --
> View this message in context: 
> http://www.nabble.com/Help-me-replace-a-for-loop-with-an-%22apply%22-function-tp25696937p25696937.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 that you are trying to solve?

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


Re: [R] pass "..." to multiple sub-functions

2009-10-01 Thread baptiste auguie
2009/10/1 Peter Ruckdeschel :

>
>   removed <- c("lty",params.fun1)
>   ## I assume you do not want to pass on argument "lty"...
>   dots.remaining <- cl[-1] ### remove the function name
>   dots.remaining <- dots.remaining[! names(dots.remaining)
> %in% removed]
>
> Best, Peter
>


Thank you, that's very helpful.

I vaguely remember there was also a package to deal with this problem
(among other things). Have I dreamed that?

Best,

baptiste

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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 optimize with array variables

2009-10-01 Thread Vik
Hello,

I am trying to figure out how to use optimize() with array variables
as inputs. I have a for loop in the function definition:

SS <- function(int,slo,x,y){
for(i in 1:length(x)) ((int+slo*x[i])-y[i])^2->squares[i]
sum(squares)->>sum_squares
output_txt = c ("The sum of squares is", sum_squares)
print(output_txt, quote=FALSE)}

Even assuming I make x and y single-integer variables, for example:

optimize(SS, c(0,1), tol = 0.0001, x=1, y=1, slo=1)

I get the error:

Error in optimize(SS, c(0, 1), tol = 1e-04, x = 1, y = 1, slo = 1) :
  invalid function value in 'optimize'

Not sure what that means. This also happens when x and y are defined
as arrays. Does optimize require me to input values for all variables
that are not being optimized (i.e. for n-1 of the inputs)? Why am I
getting an error.

I am new to R and under pressure to get some calculations done for my
work. I'd appreciate an answer to the specific question - and I fully
understand that I need to read up on R basics in more depth, which I
am doing as best I can while trying to get this work done. 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] Can You Recommend Books for Linear Mixed Models in R

2009-10-01 Thread Pat Schmitz
All

I have been looking into the books on performing statistics in R, in
particular I am interested in General Linear Mixed Models, for Randomized
Complete Block Design Experiments

The list I have come away with so far is:

Mixed Effects Models in S and S-plus by Pinheiro (2002)
http://www.amazon.com/Mixed-Effects-Models-S-S-Plus/dp/0387989579/ref=wl_itt_dp_o?ie=UTF8&coliid=I1WXOBRXMHD30V&colid=38N475HUK5VPJ

Linear Models with R by Faraway (2004)
http://www.amazon.com/Linear-Models-Texts-Statistical-Science/dp/1584884258/ref=sr_1_1?ie=UTF8&s=books&qid=1254412763&sr=1-1

Extending the Linear Model with R by Faraway (2005)
http://www.amazon.com/Extending-Linear-Model-Generalized-Nonparametric/dp/158488424X/ref=pd_sim_b_7

Which of these would you as statisticians, researchers, scientists most
recommend?
Are there others in this realm of statistics that I have not discovered,
that might be more effective?

Thanks
Pat



-- 
Patrick Schmitz
Graduate Student
Plant Biology
1206 West Gregory Drive
RM 1500

[[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] The problem of readLines

2009-10-01 Thread Tammy Ma

I have a more problem: Because there are few files which can't be read into R 
completely, so on the following subsequence programme, I use write.table, which 
creates the "NA" files for those incomplete files autimatically. 
I don't want those NA files. How can I do the following:
whenever readLines can't completely read one file, then autimatically remove it 
from my dataset?

Thanks.
Tammy





> From: www...@gmail.com
> Date: Thu, 1 Oct 2009 11:06:35 -0300
> Subject: Re: [R] The problem of readLines
> To: metal_lical...@live.com
> CC: r-help@r-project.org
> 
> From the help page for readLines:
> 
> " If the final line is incomplete (no final EOL marker) the
>  behaviour depends on whether the connection is blocking or not.
>  For a non-blocking text-mode connection the incomplete line is
>  pushed back, silently.  For all other connections the line will be
>  accepted, with a warning. "
> 
> You can disable the warning with;
> 
> readLines('your_file', warn = FALSE)
> 
> On Thu, Oct 1, 2009 at 9:39 AM, Tammy Ma  wrote:
> >
> > Dear R-users,
> >
> >
> > I use "readLines" to read data, but when processing the large data set, 
> > there are few files which can not be readed in:
> >
> > 48: In readLines(name_c[i]) ... :
> >  incomplete final line found on 'C:/Documents and Settings/lma/My 
> > Documents/habitdata/244052900243997/calllog/calllog_log-20050505T121611.txt'
> > ...
> >
> >
> >
> > Whats the problem about this?
> >
> > Regards,
> > Tammy
> >
> >
> >
> > _
> > More than messages–check out the rest of the Windows Live™.
> > http://www.microsoft.com/windows/windowslive/
> >[[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
  
_
Drag n’ drop—Get easy photo sharing with Windows Live™ Photos.

http://www.microsoft.com/windows/windowslive/products/photos.aspx
[[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] cdplot????

2009-10-01 Thread Achim Zeileis

On Thu, 1 Oct 2009, kayj wrote:


I am having difficulties interpreting a cdplot, I have a binary variable y
that I want to cdplot against a continuous variable x,below is the R command

cdplot(y~x, data=mydata)

you get a plot with a dark shaded area and a light shaded area. what do
these areas mean? and how to interpret the plot?

you help is greatly appreciated


See ?cdplot. It's a display that graphs (an approximation of) P(y | x) 
against x. The areas above and below the line are simply shaded in 
different levels of gray.


To obtain P(y | x), the idea is to use

  f(y | x) = f(x | y) * f(x)/f(y)

where for f(x) and f(x | y) are obtained by (unconditional and 
conditional, respectively) kernel density smoothers from density().

f(y) is simply the unconditional proportion of the category y.

hth,
Z



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

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




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


Re: [R] Unable to install lme4

2009-10-01 Thread jamesmcc

I am baffled by this as well. I'm having the same issue. Using suse linux,
with 64 bit R2.8.1.

Thanks, 

james



Zege, Andrew wrote:
> 
> I am unable to install package lme4, after several attempts to do so using
> various repository URLs.
> Just to make sure everything works fine with proxy, connection, etc, I
> installed ggplot2 and it worked fine.
> 
> I am using command
> 
> install.packages("lme4", lib="/myRlibs"),
> 
> optionally using contrib argument with different URLs.
> 
> Error message the I get is
> 
> Warning message;
> In install.packages("lme4", lib="/myRlibs")
>  package 'lme4' is not available
> 
> 
> Some other details, not sure how relevant are:
> 
> getOption("repos") returns "http://lib.stat.cmu.edu/R/CRAN";
> 
> I tried setting contrib to various other URL, such as 
> "http://cran.mtu.edu/src/contrib"; or Berkeley URL, but with no success.
> Actually, when I did available.packages() on this repos, I didn't see lme4
> in the package indices.
> My machine has x86_64bit RedHat Linux.
> 
> Would appreciate any tips or directions,
> 
> Thanks
> Andre
> 
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/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/Unable-to-install--lme4-tp25514856p25697423.html
Sent from the R help mailing list archive at Nabble.com.

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


[R] Help me replace a for loop with an "apply" function

2009-10-01 Thread gd047

...if that is possible 

My task is to find the longest streak of continuous days a user participated
in a game. 

Instead of writing an sql function, I chose to use the R's rle function, to
get the longest streaks and then update my db table with the results.

The (attached) dataframe is something like this:

day user_id
2008/11/012001
2008/11/012002
2008/11/012003
2008/11/012004
2008/11/012005
2008/11/022001
2008/11/022005
2008/11/032001
2008/11/032003
2008/11/032004
2008/11/032005
2008/11/042001
2008/11/042003
2008/11/042004
2008/11/042005



--- R code follows
--


# turn it to a contingency table
my_table <- table(user_id, day)

# get the streaks
rle_table <- apply(my_table,1,rle)

# verify the longest streak of "1"s for user 2001
# as.vector(tapply(rle_table$'2001'$lengths, rle_table$'2001'$values,
max)["1"])

# loop to get the results
# initiate results matrix
res<-matrix(nrow=dim(my_table)[1], ncol=2)

for (i in 1:dim(my_table)[1]) {
string <- paste("as.vector(tapply(rle_table$'", rownames(my_table)[i],
"'$lengths, rle_table$'", rownames(my_table)[i], "'$values, max)['1'])",
sep="")
res[i,]<-c(as.integer(rownames(my_table)[i]) , eval(parse(text=string)))
}



--- end of R code

Unfortunately this for loop takes too long and I' wondering if there is a
way to produce the res matrix using a function from the "apply" family.

Thank you in advance
-- 
View this message in context: 
http://www.nabble.com/Help-me-replace-a-for-loop-with-an-%22apply%22-function-tp25696937p25696937.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] Compress (gzip) a pdf device - [ ] Message is from an unknown sender

2009-10-01 Thread Daniele Amberti
system() invokes the OS command specified by command, in the example you gave 
it means that gzip is installed and (assuming Windows OS) it is in your search 
path.

I'd like to have a solution that do not use external programs.

Thanks
Daniele

-Original Message-
From: Ista Zahn [mailto:istaz...@gmail.com]
Sent: 01 October 2009 17:11
To: Daniele Amberti
Cc: r-help@r-project.org; Rainer M Krug
Subject: Re: [R] Compress (gzip) a pdf device - [ ] Message is from an unknown 
sender

I guess I don't understand what your're trying to do. gzip-ing a file
from within R is easy enough:

pdf(file="CompressMe.pdf")
plot(rnorm(100))
dev.off()
system("gzip CompressMe.pdf")

I think you want something more complicated, but I'm not sure what.

-Ista

On Thu, Oct 1, 2009 at 6:41 AM, Daniele Amberti  wrote:
> By now It seems nobody have idea.
>
> zz <- gzfile("C:/gzpdftest.gz", "wb")
> pdf(file = zz)
> plot(USArrests)
> dev.off()
> close(zz)
>
> produce a file named "3" without any extension in my working directory.
>
> Also I don't have any news on how to gzip the pdf afterward (without using an 
> external executable).
>
> Daniele
>
>
> From: Rainer M Krug [mailto:r.m.k...@gmail.com]
> Sent: 30 September 2009 10:26
> To: Daniele Amberti
> Cc: r-help@r-project.org
> Subject: Re: [R] Compress (gzip) a pdf device - [ ] Message is from an 
> unknown sender
>
>
> 2009/9/30 Daniele Amberti 
> mailto:daniele.ambe...@ors.it>>
> I have not found an easy way to compress a file on filesystem.
> Especially I'd like to compress a pdf from pdf() function/device. Is it 
> possible to compress It on the flight?
> I'd like to do something like:
> pdf(gzipconnection())
> dev.off()
>
> I guess this boils down to a question I asked some time ago concerning 
> getting the filename of a pdf() device, as I wanted to create a compressed 
> pdf from the uncompressed pdf created by R (not "zipping" the pdf).
> It does not seem to be possible, at least I did not get any response which I 
> could use to implement my idea (create my dev.off(), which calls dev.off() 
> and afterwards compresses the pdf by using the file name).
>
> If you find a solution, please let me know.
>
> Cheers,
>
> Rainer
> If It is not possible, how can I create a gzip with the pdf?
>
> Thanks
> Daniele A.
>
>
>
> 
>
>
>
> 
> ORS Srl
>
> Via Agostino Morando 1/3 12060 Roddi (Cn) - Italy
> Tel. +39 0173 620211
> Fax. +39 0173 620299 / +39 0173 433111
> Web Site www.ors.it
>
> 
> Qualsiasi utilizzo non autorizzato del presente messaggio e dei suoi allegati 
> ? vietato e potrebbe costituire reato.
> Se lei avesse ricevuto erroneamente questo messaggio, Le saremmo grati se 
> provvedesse alla distruzione dello stesso
> e degli eventuali allegati.
> Opinioni, conclusioni o altre informazioni riportate nella e-mail, che non 
> siano relative alle attivit? e/o
> alla missione aziendale di O.R.S. Srl si intendono non attribuibili alla 
> societ? stessa, n? la impegnano in alcun modo.
>
>[[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.
>



--
Ista Zahn
Graduate student
University of Rochester
http://yourpsyche.org

ORS Srl

Via Agostino Morando 1/3 12060 Roddi (Cn) - Italy
Tel. +39 0173 620211
Fax. +39 0173 620299 / +39 0173 433111
Web Site www.ors.it


Qualsiasi utilizzo non autorizzato del presente messaggio e dei suoi allegati è 
vietato e potrebbe costituire reato.
Se lei avesse ricevuto erroneamente questo messaggio, Le saremmo grati se 
provvedesse alla distruzione dello stesso
e degli eventuali allegati.
Opinioni, conclusioni o altre informazioni riportate nella e-mail, che non 
siano relative alle attività e/o
alla missione aziendale di O.R.S. Srl si intendono non  attribuibili alla 
società stessa, né la impegnano in alcun modo.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Debug

2009-10-01 Thread Steve Lianoglou

Hi Tammy,

On Oct 1, 2009, at 11:04 AM, Tammy Ma wrote:


Hi, R-Users,'
I have written a programe to process the bunch of files in one folder.
But there is a error came out;
How can I know which file returns error when being processed?
I have tested the first 1-10th files, no any problem. But the  
problems is I have more than 500 files. How can I know which file  
has the problem?


See ?tryCatch

Here's some (untested) code that should give you an idea of what to do:

which.files <- dir(path="/directory/with/files", full.names=TRUE)
for (file.name in which.files) {
  result <- tryCatch(process.file(file.name), error=function(err) err)
  if (inherits(result, 'error')) {
cat("File", file.name, "is hosed\n")
  }
}

This assumes you have a function called 'process.file' that does what  
you want. If the function throws an error, it will be caught and  
stored in the result variable. In this case, the file.name will be  
written to your workspace.


Instead of just printing to your workspace, you could consider storing  
the bad file names in a list and post-process later.


Hope that helps,
-steve

--
Steve Lianoglou
Graduate Student: Computational Systems Biology
  |  Memorial Sloan-Kettering Cancer Center
  |  Weill Medical College of Cornell University
Contact Info: http://cbio.mskcc.org/~lianos/contact

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Treating variables as symbols

2009-10-01 Thread Gabor Grothendieck
Read the troubleshooting section on the home page: http://ryacas.googlecode.com
Note, in particular, that it currently only works with an older
version of the XML package.

> library(Ryacas)
> packageDescription("XML")$Version
[1] "1.96-0"
> x <- Sym("x")
> Integrate(x*x, x)
[1] "Starting Yacas!"
expression(x^3/3)


On Thu, Oct 1, 2009 at 11:08 AM, ZeMajik  wrote:
> Thanks guys, Ryacas is pretty much what I'm looking for!However, I can't
> seem to get it to work properly.
>
> For example:
>
>> yacas("Integrate(x) x")
> Error in parse(text = text, srcfile = NULL) :
>  unexpected numeric constant in ""/" ("^" (x ,2 2"
>
> Same thing with expressions such as yacas("x*x")
>
> However
>
>> yacas("2*2")
> expression(4)
>
> So it seems there is a successful connection between yacas and R.
> I didn't find any info on the problem by googling it unfortunately! Any
> ideas what it might be?
>
> Thanks again,
> M
>
> On Thu, Oct 1, 2009 at 3:50 PM, Jorge Ivan Velez
> wrote:
>
>> Hi Zemajik,
>> Try this:
>>
>> > y <- function(a) paste(a, '*x', sep="")
>> > y(2)
>> [1] "2*x"
>>
>> Also, take a look at the Ryacas package.
>>
>> HTH,
>> Jorge
>>
>>
>> On Thu, Oct 1, 2009 at 9:46 AM, ZeMajik <> wrote:
>>
>>> Hey,
>>> I'm trying to find how to perform operations with a variable treated as a
>>> symbol.
>>> For, an extremely simple, example I want to integrate a*x with respect to
>>> x
>>> and I want to find the indefinite integral of this, (a*x^2/2), or the
>>> definite integral with some interval for x.
>>>
>>> Another example of such a use would be to create a function
>>> y<-function(x) {a*x}
>>> and by typig y(2) I would get the result 2*a
>>>
>>> Is there a way to treat variables as merely "symbols"?
>>> Any help much appreciated
>>>
>>> -M
>>>
>>>        [[alternative HTML version deleted]]
>>>
>>> __
>>> R-help@r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>> PLEASE do read the posting guide
>>> http://www.R-project.org/posting-guide.html
>>> and provide commented, minimal, self-contained, reproducible code.
>>>
>>
>>
>
>        [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Compress (gzip) a pdf device - [ ] Message is from an unknown sender

2009-10-01 Thread Ista Zahn
I guess I don't understand what your're trying to do. gzip-ing a file
from within R is easy enough:

pdf(file="CompressMe.pdf")
plot(rnorm(100))
dev.off()
system("gzip CompressMe.pdf")

I think you want something more complicated, but I'm not sure what.

-Ista

On Thu, Oct 1, 2009 at 6:41 AM, Daniele Amberti  wrote:
> By now It seems nobody have idea.
>
> zz <- gzfile("C:/gzpdftest.gz", "wb")
> pdf(file = zz)
> plot(USArrests)
> dev.off()
> close(zz)
>
> produce a file named "3" without any extension in my working directory.
>
> Also I don't have any news on how to gzip the pdf afterward (without using an 
> external executable).
>
> Daniele
>
>
> From: Rainer M Krug [mailto:r.m.k...@gmail.com]
> Sent: 30 September 2009 10:26
> To: Daniele Amberti
> Cc: r-help@r-project.org
> Subject: Re: [R] Compress (gzip) a pdf device - [ ] Message is from an 
> unknown sender
>
>
> 2009/9/30 Daniele Amberti 
> mailto:daniele.ambe...@ors.it>>
> I have not found an easy way to compress a file on filesystem.
> Especially I'd like to compress a pdf from pdf() function/device. Is it 
> possible to compress It on the flight?
> I'd like to do something like:
> pdf(gzipconnection())
> dev.off()
>
> I guess this boils down to a question I asked some time ago concerning 
> getting the filename of a pdf() device, as I wanted to create a compressed 
> pdf from the uncompressed pdf created by R (not "zipping" the pdf).
> It does not seem to be possible, at least I did not get any response which I 
> could use to implement my idea (create my dev.off(), which calls dev.off() 
> and afterwards compresses the pdf by using the file name).
>
> If you find a solution, please let me know.
>
> Cheers,
>
> Rainer
> If It is not possible, how can I create a gzip with the pdf?
>
> Thanks
> Daniele A.
>
>
>
> 
>
>
>
> 
> ORS Srl
>
> Via Agostino Morando 1/3 12060 Roddi (Cn) - Italy
> Tel. +39 0173 620211
> Fax. +39 0173 620299 / +39 0173 433111
> Web Site www.ors.it
>
> 
> Qualsiasi utilizzo non autorizzato del presente messaggio e dei suoi allegati 
> ? vietato e potrebbe costituire reato.
> Se lei avesse ricevuto erroneamente questo messaggio, Le saremmo grati se 
> provvedesse alla distruzione dello stesso
> e degli eventuali allegati.
> Opinioni, conclusioni o altre informazioni riportate nella e-mail, che non 
> siano relative alle attivit? e/o
> alla missione aziendale di O.R.S. Srl si intendono non attribuibili alla 
> societ? stessa, n? la impegnano in alcun modo.
>
>        [[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.
>



-- 
Ista Zahn
Graduate student
University of Rochester
http://yourpsyche.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] Treating variables as symbols

2009-10-01 Thread ZeMajik
Thanks guys, Ryacas is pretty much what I'm looking for!However, I can't
seem to get it to work properly.

For example:

> yacas("Integrate(x) x")
Error in parse(text = text, srcfile = NULL) :
  unexpected numeric constant in ""/" ("^" (x ,2 2"

Same thing with expressions such as yacas("x*x")

However

> yacas("2*2")
expression(4)

So it seems there is a successful connection between yacas and R.
I didn't find any info on the problem by googling it unfortunately! Any
ideas what it might be?

Thanks again,
M

On Thu, Oct 1, 2009 at 3:50 PM, Jorge Ivan Velez
wrote:

> Hi Zemajik,
> Try this:
>
> > y <- function(a) paste(a, '*x', sep="")
> > y(2)
> [1] "2*x"
>
> Also, take a look at the Ryacas package.
>
> HTH,
> Jorge
>
>
> On Thu, Oct 1, 2009 at 9:46 AM, ZeMajik <> wrote:
>
>> Hey,
>> I'm trying to find how to perform operations with a variable treated as a
>> symbol.
>> For, an extremely simple, example I want to integrate a*x with respect to
>> x
>> and I want to find the indefinite integral of this, (a*x^2/2), or the
>> definite integral with some interval for x.
>>
>> Another example of such a use would be to create a function
>> y<-function(x) {a*x}
>> and by typig y(2) I would get the result 2*a
>>
>> Is there a way to treat variables as merely "symbols"?
>> Any help much appreciated
>>
>> -M
>>
>>[[alternative HTML version deleted]]
>>
>> __
>> R-help@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>
>

[[alternative HTML version deleted]]

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


Re: [R] Debug

2009-10-01 Thread Tammy Ma



From: metal_lical...@live.com
To: r-help@r-project.org
Subject: Debug
Date: Thu, 1 Oct 2009 15:21:42 +0300








Hi, R-Users,'
I have written a programe to process the bunch of files in one folder.
 But there is a error came out;
How can I know which file returns error when being processed?
I have tested the first 1-10th files, no any problem. But the problems is I 
have more than 500 files. How can I know which file has the problem?

Thanks 
Tammy
  
Invite your mail contacts to join your friends list with Windows Live Spaces. 
It's easy! Try it!  
_
Invite your mail contacts to join your friends list with Windows Live Spaces. 
It's easy!
http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us
[[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] Maintaining sort order when transpose

2009-10-01 Thread Kevin Wright
An example would be helpful, but if I understand correctly, can't you do
something like

TDF=t(DF)
TDF=TDF[,rownames(DF)]

Kevin Wright


On Thu, Oct 1, 2009 at 9:04 AM, Dry, Jonathan R <
jonathan@astrazeneca.com> wrote:

> Hi all - I have a data frame and have sorted it by a particular column,
> with rownames set to a different variable.  I wish to transpose this data
> frame, naming columns by the rowname variable but maintaining the sorted
> order through to the order of columns in my transposed table, however use of
>  t(DF) results in a transposed table where the columns are ordered
> alphabetically by the original rownames.  Any ideas how I can get around
> this?
>
> --
> AstraZeneca UK Limited is a company incorporated in Engl...{{dropped:21}}
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

[[alternative HTML version deleted]]

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


[R] cdplot????

2009-10-01 Thread kayj



I am having difficulties interpreting a cdplot, I have a binary variable y
that I want to cdplot against a continuous variable x,below is the R command

 cdplot(y~x, data=mydata)

you get a plot with a dark shaded area and a light shaded area. what do
these areas mean? and how to interpret the plot?

you help is greatly appreciated


-- 
View this message in context: 
http://www.nabble.com/cdplot-tp25696905p25696905.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] typo in install manual

2009-10-01 Thread Duncan Murdoch

On 10/1/2009 5:37 AM, Daniel Dekic wrote:

http://cran.r-project.org/doc/manuals/R-admin.pdf
page 8 and page 13

testInstallPackages("recommended")
-> testInstalledPackages("recommended")



Thanks, will fix.


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] GAM question

2009-10-01 Thread joris meys
Hi Daniel,

I presume you mean coefficients by values. Try ?gamObject and read the
info in the help file. A GAM object (returned by the function gam() )
contains an element coefficients that is easily accessible. That one
contains all estimated coefficients, including those for the smooth
functions.

On Thu, Oct 1, 2009 at 1:49 PM, Daniel Rabczenko  wrote:
> Hello evyrone,
> I would be grateful if you could help me in (I hope) simple problem.
> I fit a gam model (from mgcv package) with several smooth functions .
> I don't know how to extract values of just one smooth function. Can you
> please help me in this?
> Kind regards,
> Daniel Rabczenko
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/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] package:snow, timeOut for makeSOCKcluster()

2009-10-01 Thread Markus Loecher
Dear snow users,
is there any way to specify a max time after which makeSOCKcluster() stops
trying to create socket connections and gives up/returns ?
In my current setup (MAC OSX 10.5.8, R version 2.9) I have to force quit R
if the host specified in makeSOCKcluster() either does not exist or does not
respond.
On Linux, I can at least manually interrupt the function via Ctrl-C

Any help would be greatly appreciated,

Thanks,

Markus

[[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] re ading and analyzing a word document

2009-10-01 Thread spencerg

library(sos)
tm <- findFn('text mining')
tm


 This produced 15 matches, which you could also find using 
"RSiteSearch('text mining', 'function')".  The difference is that 
findFn{sos} displays the results in a table sorted to place the package 
with the most matches first.  In this case, there is actually a "Text 
Mining Package" called "tm".  "summary(tm)" says these 15 matches are in 
11 packages.  The first of the 11 is "FactoMineR". 



 Hope this helps. 
 Spencer Graves



David Winsemius wrote:


On Oct 1, 2009, at 12:18 AM, cls59 wrote


PDXRugger wrote:


Considering your instructions:

#Define words to find
to.find <- c( 'the', 'is', 'are' ,'dr')
#Read in the file...
file.text <- readLines( 'data/letter.txt' )
#Count number of occurnces of deined word in text
line.matches <- unlist( lapply( to.find, grep, x = 
unlist(file.text[2]) )

)

Result:

line.matches

[1] 1 1 1

This is not right of course as there are actually four words and 
secondly

becasue the searched words appear multiple times.




The example I gave was only meant to identify those lines on which 
matches

occurred. Using x = unlist(file.text[2]) only feeds one line of the file
into the matching routine so the result indicates that all the 
matches were

on line 1-- the only line present for searching.

If you want to count the individual occurrences of the words on each 
line,

you may need to look at using a function such as gregexpr. grep only
indicates if a match or matches is present in a line of text-- gregexpr
indicates at which positions those matches occur in the line.

However, you may be getting to the point with this where R is no 
longer an
appropriate tool for this job. R is amazingly flexible it is possible 
that
it can give you what you want. However, R was not designed to perform 
text

processing-- Perl comes to mind as being a language that was explicitly
designed to perform these sorts of operations.


Perhaps you should use the R-search facilities for such questions:

http://finzi.psych.upenn.edu/R/library/tau/html/00Index.html
http://finzi.psych.upenn.edu/views/NaturalLanguageProcessing.html
http://www.jstatsoft.org/v25/i05/

R may not have been designed for text processing, but it is rather 
amazing how much has been done.







--
Spencer Graves, PE, PhD
President and Chief Operating Officer
Structure Inspection and Monitoring, Inc.
751 Emerson Ct.
San José, CA 95126
ph:  408-655-4567

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Color of graph

2009-10-01 Thread Jorge Ivan Velez
Hi Ashta,
See the "..." in ?abline.

HTH,
Jorge


On Thu, Oct 1, 2009 at 9:57 AM, Ashta <> wrote:

> I am trying to plot a line graph for 3 or more regression lines
>
> abline(m1)
> abline(m2)
> abline(m3)
>
> Can I change the color of each line? if so how?
>
> Thanks in advance
> Ashta
>
>[[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

[[alternative HTML version deleted]]

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


Re: [R] Color of graph

2009-10-01 Thread Charlie Sharpsteen
On Thu, Oct 1, 2009 at 6:57 AM, Ashta  wrote:

> I am trying to plot a line graph for 3 or more regression lines
>
> abline(m1)
> abline(m2)
> abline(m3)
>
> Can I change the color of each line? if so how?
>
> Thanks in advance
> Ashta
>

Try passing the 'col' parameter to abline:

abline( m1, col = 'red' )
ablime( m1, col = 'blue' )
abline( m1, col = 'purple' )

See ?par for other plot parameters like col that can be set this way. ?rgb
gives an example of setting color by RGB value. Other specifications such as
HSV are possible. The colors() function will show a list of all built colors
that may be specified using a string such as 'red' . ?rainbow will show
information concerning built in functions for generating color palettes. The
RColorBrewer package also contains some great palettes.

Also, a help search such as:

??'colors'

Will turn up all kinds of other functions that may deal with setting or
creating colors.

Hope this helps!

-Charlie

[[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] Color of graph

2009-10-01 Thread smu

abline(m1, col="red")

regards,
 Stefan

On Thu, Oct 01, 2009 at 09:57:11AM -0400, Ashta wrote:
> I am trying to plot a line graph for 3 or more regression lines
> 
> abline(m1)
> abline(m2)
> abline(m3)
> 
> Can I change the color of each line? if so how?
> 
> Thanks in advance
> Ashta
> 
>   [[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] Color of graph

2009-10-01 Thread Henrique Dallazuanna
Try this:

abline(m1, col = 'blue')
abline(m1, col = 'red')
abline(m1, col = 'green')

On Thu, Oct 1, 2009 at 10:57 AM, Ashta  wrote:
> I am trying to plot a line graph for 3 or more regression lines
>
> abline(m1)
> abline(m2)
> abline(m3)
>
> Can I change the color of each line? if so how?
>
> Thanks in advance
> Ashta
>
>        [[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] (no subject)

2009-10-01 Thread Andris Jankevics
Actually that is stated in paper abstract:

http://www.krebsregister.saarland.de/improve/periodR_en.html

Andris

2009/10/1 "Jens Oehlschlägel" :
> Hi,
> Does anyone know where the following package is available:
>
> Holleczek B, Gondos A, Brenner H.
> PeriodR - an R package to calculate long term survival estimates using period 
> analysis.
> Methods of Information in Medicine 2009; 48: 123-128.
>
> Thanks
> Jens Oehlschlägel
> --
> GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/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] Getting formatted character from call

2009-10-01 Thread Gabor Grothendieck
Please read the last line to every message to r-help.  There is no
reproducible code in your post.

Anyways, it works for me:

> class(call("round", 1.5))
[1] "call"

> as.character(call("round", 1.5))
[1] "round" "1.5"

> format(call("round", 1.5))
[1] "round(1.5)"


On Thu, Oct 1, 2009 at 7:58 AM, Iago Mosqueira  wrote:
> Hi,
>
> I need to get a character vector from an object of class call. But
> using as.character() returns something based on the internal structure
> of the object, and not, as I would like, some akin to the output of
> show() on a call object.
>
> Any idea on how to obtain the same output returned by show?
>
> Thanks,
>
>
> Iago Mosqueira
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/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] (no subject)

2009-10-01 Thread Jorge Ivan Velez
Hi Jens,
Take a look at http://www.krebsregister.saarland.de/improve/periodR_en.html

HTH,
Jorge


2009/10/1 "Jens Oehlschlägel" <>

> Hi,
> Does anyone know where the following package is available:
>
> Holleczek B, Gondos A, Brenner H.
> PeriodR - an R package to calculate long term survival estimates using
> period analysis.
> Methods of Information in Medicine 2009; 48: 123-128.
>
> Thanks
> Jens Oehlschlägel
> --
> GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/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] The problem of readLines

2009-10-01 Thread Henrique Dallazuanna
>From the help page for readLines:

" If the final line is incomplete (no final EOL marker) the
 behaviour depends on whether the connection is blocking or not.
 For a non-blocking text-mode connection the incomplete line is
 pushed back, silently.  For all other connections the line will be
 accepted, with a warning. "

You can disable the warning with;

readLines('your_file', warn = FALSE)

On Thu, Oct 1, 2009 at 9:39 AM, Tammy Ma  wrote:
>
> Dear R-users,
>
>
> I use "readLines" to read data, but when processing the large data set, there 
> are few files which can not be readed in:
>
> 48: In readLines(name_c[i]) ... :
>  incomplete final line found on 'C:/Documents and Settings/lma/My 
> Documents/habitdata/244052900243997/calllog/calllog_log-20050505T121611.txt'
> ...
>
>
>
> Whats the problem about this?
>
> Regards,
> Tammy
>
>
>
> _
> More than messages–check out the rest of the Windows Live™.
> http://www.microsoft.com/windows/windowslive/
>        [[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] Evaluating expresssions as parameter values

2009-10-01 Thread Erich Neuwirth

Let us walk through my problem step by step:

1.
print(xyplot(yield ~ variety | site,groups=year,data=barley))
2.
print(xyplot(as.formula("yield ~ variety |  
site"),groups=year,data=barley))


The above two statements work, the next one does not work

3.
print(xyplot(as.formula("yield ~ variety | site"),groups=parse 
(text="year"),data=barley))


But the following one works

4.
arglist<-list(as.formula("yield ~ variety | site"),groups=parse 
(text="year"),data=barley)

print(do.call("xyplot",arglist))


why does 3 not work and 4 work?
Is there a way of coercing the string "year" into something which can  
directly be used in

3 as the argument used with groups= ???


The next one

print(xyplot(as.formula("yield ~ variety | site"),groups=eval(parse 
(text="year")),data=barley))


also works, but in this case the groups expression is evaluated before  
xyplot is applied,

and I think this is bad style (at least, if not worse).


On Sep 30, 2009, at 1:20 PM, Deepayan Sarkar wrote:


xyplot(Sepal.Length ~ Petal.Length, iris, groups = ~Species)


__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Color of graph

2009-10-01 Thread Ashta
I am trying to plot a line graph for 3 or more regression lines

abline(m1)
abline(m2)
abline(m3)

Can I change the color of each line? if so how?

Thanks in advance
Ashta

[[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] Maintaining sort order when transpose

2009-10-01 Thread Dry, Jonathan R
Hi all - I have a data frame and have sorted it by a particular column, with 
rownames set to a different variable.  I wish to transpose this data frame, 
naming columns by the rowname variable but maintaining the sorted order through 
to the order of columns in my transposed table, however use of  t(DF) results 
in a transposed table where the columns are ordered alphabetically by the 
original rownames.  Any ideas how I can get around this?

--
AstraZeneca UK Limited is a company incorporated in Engl...{{dropped:21}}

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] The problem of readLines

2009-10-01 Thread Tammy Ma

Dear R-users,


I use "readLines" to read data, but when processing the large data set, there 
are few files which can not be readed in:

48: In readLines(name_c[i]) ... :
  incomplete final line found on 'C:/Documents and Settings/lma/My 
Documents/habitdata/244052900243997/calllog/calllog_log-20050505T121611.txt'
...



Whats the problem about this?

Regards,
Tammy


  
_
More than messages–check out the rest of the Windows Live™.
http://www.microsoft.com/windows/windowslive/
[[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

2009-10-01 Thread Martin Morgan
hassan paylakhi wrote:
> hi
> I am going to crazy.I want to use beadarray package in R, but I cant.
>  when I want install it, I encounter to this message "Loading required
> package: hwriter
> Loading required package: sma
> Error in library(pkg, character.only = TRUE, logical.return = TRUE, lib.loc
> = lib.loc) :
>   'sma' is not a valid installed package"
> I cant find sma and hwriter packages, it seems that they are not anymore.
> could you help me plz?

Hi Hassan --

The sma author no longer wishes to maintain this package, and beadarray
depends on sma. The workaround is to manually install sma from its
archive: download

  http://cran.fhcrc.org/src/contrib/Archive/sma/sma_0.5.15.tar.gz

and install.packages("sma_0.5.15.tar.gz", repos=NULL).

beadarray is a Bioconductor packages, so please follow up on the
Bioconductor mailing list

  http://bioconductor.org/docs/mailList.html

Martin

> 
> thanks in advance
> Paylakhi
> 
>   [[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.


-- 
Martin Morgan
Computational Biology / Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N.
PO Box 19024 Seattle, WA 98109

Location: Arnold Building M1 B861
Phone: (206) 667-2793

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Getting formatted character from call

2009-10-01 Thread Iago Mosqueira
Hi,

I need to get a character vector from an object of class call. But
using as.character() returns something based on the internal structure
of the object, and not, as I would like, some akin to the output of
show() on a call object.

Any idea on how to obtain the same output returned by show?

Thanks,


Iago Mosqueira

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] (no subject)

2009-10-01 Thread Jens Oehlschlägel
Hi,
Does anyone know where the following package is available: 

Holleczek B, Gondos A, Brenner H.
PeriodR - an R package to calculate long term survival estimates using period 
analysis.
Methods of Information in Medicine 2009; 48: 123-128.

Thanks
Jens Oehlschlägel
-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] typo in install manual

2009-10-01 Thread Daniel Dekic

http://cran.r-project.org/doc/manuals/R-admin.pdf
page 8 and page 13

testInstallPackages("recommended")
-> testInstalledPackages("recommended")

same problem in .html


--
CTM Clinical Trials Management GmbH
Mariahilferstraße 47/III/3/5
1060 Vienna, Austria

Phone: +43 (0) 1 / 585 80 63
Fax:   +43 (0) 1 / 585 79 67
E-mail: d.de...@clinicaltrials.at
Homepage: www.clinicaltrials.at

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] set package: more information about syntax

2009-10-01 Thread Jarek Jasiewicz




Dear All!

I have a few question about proper syntax for fuzzy rules in sets 
package (there is only little help about it):


1) how to use negation (NOT) operator there is only OR (||) in example 
it is NOT, !!, !. I also assume that AND is &&

2) where it can be set. For example:

area %is NOT% large
area %is% NOT large
area %is% !large
etc...

3) how brackets works (as in typical logical operation, are allowed - 
some expert system do not allow use brackets)

Is proper following syntax?

(slope %is% flat && elevation %is% is high) || area %is% large, form 
%is% plateau


Where I can find more information about syntax rules used in that 
(fantastic!) package, except in "Generalised and Customisable Sets in 
R" where is nothing about rules. Maybe rules comes from other, more 
general rule syntax, if yes,I would be grateful for the source


thanks and greetings
Jarek

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

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


I add this question because I cannot form any proper rule when I use ! 
(negation) or I use more complex rules rules with brackets I always receive:


Error in gset_charfun(x) : Argument 'x' must be a generalized set.

in fact function fuzzy_inferance works only if I use maximum two 
arguments rules without brackets.


Jarek

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Treating variables as symbols

2009-10-01 Thread Henrique Dallazuanna
Try this:

y <- function(a)
substitute(a * x, list(a = a))

On Thu, Oct 1, 2009 at 10:46 AM, ZeMajik  wrote:
> Hey,
> I'm trying to find how to perform operations with a variable treated as a
> symbol.
> For, an extremely simple, example I want to integrate a*x with respect to x
> and I want to find the indefinite integral of this, (a*x^2/2), or the
> definite integral with some interval for x.
>
> Another example of such a use would be to create a function
> y<-function(x) {a*x}
> and by typig y(2) I would get the result 2*a
>
> Is there a way to treat variables as merely "symbols"?
> Any help much appreciated
>
> -M
>
>        [[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] pass "..." to multiple sub-functions

2009-10-01 Thread Peter Ruckdeschel
Dear Baptiste,

> I know I have seen this discussed before but I haven't been successful
> in searching for "ellipsis", "dots", "..." in the archives. I would
> like to filter "..." arguments according to their name, and dispatch
> them to two sub-functions, say fun1 and fun2. I looked at lm() but it
> seemed more complicated than I need as it modifies the calling
> function among other things. What is the best approach for this? My
> current version presented below seems very awkward.
> 
> Best regards,
> 
> baptiste
> 
> sessionInfo()
> R version 2.9.2 (2009-08-24)
> i386-apple-darwin8.11.1
> 
> fun1 <- function(col, row){
>   print(col)
>   print(row)
> }
> 
> fun2 <- function(x){
>   print(x)
> }
> 
> foo <- function(..., lty=1){
> 
>   dots <- list(...)
> 
>   cl <- match.call()
> 
>   col <- eval.parent(cl$col)
>   row <- eval.parent(cl$row)
> 
>   params.fun1 <-  c("col", "row")
> 
>   removed <- na.omit(match(names(cl), params.fun1))
>   # index whichever arguments were passed to fun1
> 
>   fun1(col, row)
> 
>   fun2(dots[seq_along(dots)[-removed]])

Instead of passing all remaining arguments stacked into
one list (= 1 argument x to function fun2) you might want
to be able to retain them as distinct arguments;

so you might want to replace fun2 by

  fun2.a <- function(...) print(list(...))

and the call to fun2 in foo by

  do.call(fun2.a, dots.remaining)

where, sticking to your code, you could obtain
dots.remaining as

   removed <- na.omit(match(names(cl), params.fun1))
   dots.remaining <- dots[seq_along(dots)[-removed]]

or by

   removed <- c("lty",params.fun1)
   ## I assume you do not want to pass on argument "lty"...
   dots.remaining <- cl[-1] ### remove the function name
   dots.remaining <- dots.remaining[! names(dots.remaining)
 %in% removed]

Best, Peter

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Treating variables as symbols

2009-10-01 Thread Jorge Ivan Velez
Hi Zemajik,
Try this:

> y <- function(a) paste(a, '*x', sep="")
> y(2)
[1] "2*x"

Also, take a look at the Ryacas package.

HTH,
Jorge


On Thu, Oct 1, 2009 at 9:46 AM, ZeMajik <> wrote:

> Hey,
> I'm trying to find how to perform operations with a variable treated as a
> symbol.
> For, an extremely simple, example I want to integrate a*x with respect to x
> and I want to find the indefinite integral of this, (a*x^2/2), or the
> definite integral with some interval for x.
>
> Another example of such a use would be to create a function
> y<-function(x) {a*x}
> and by typig y(2) I would get the result 2*a
>
> Is there a way to treat variables as merely "symbols"?
> Any help much appreciated
>
> -M
>
>[[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

[[alternative HTML version deleted]]

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


[R] Treating variables as symbols

2009-10-01 Thread ZeMajik
Hey,
I'm trying to find how to perform operations with a variable treated as a
symbol.
For, an extremely simple, example I want to integrate a*x with respect to x
and I want to find the indefinite integral of this, (a*x^2/2), or the
definite integral with some interval for x.

Another example of such a use would be to create a function
y<-function(x) {a*x}
and by typig y(2) I would get the result 2*a

Is there a way to treat variables as merely "symbols"?
Any help much appreciated

-M

[[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 for 3D Plotting Data on 'Irregular' Grid

2009-10-01 Thread Lorenzo Isella

Dear All,
Here is what I am trying to achieve: I would like to plot some data in 3D.
Usually, one has a matrix of the kind

y_1(x_1) , y_1(x_2).y_1(x_i)
y_2(x_1) , y_2(x_2).y_2(x_i)
...
y_n(x_1) , y_n(x_2)..y_n(x_i)


where e.g. y_2(x_1) is the value of y at time 2 at point x_1 (see that 
the grid in x is the same for the y values at all times).
Instead, in my case, the quantity y is observed at each time on a 
different grid in x; in other words not only do I have a different 
number of observations (y values) at each time, but I also have 
observations taken on a a different x grid each time.
As a matter of fact, it is as if I had a set of independent 
observations, for each of which I can create effortlessly a 2D plot, 
that I want to stitch together into a 3D plot.
I have no idea of how to achieve that. Examples I have found with 
lattice or scatterplot3D all assume a regular grid like the one I 
described above.

Any help is really appreciated.
Many thanks

Lorenzo

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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 use Subpopulation data?

2009-10-01 Thread KABELI MEFANE

Thanks 
 
i was not aware of str, i have a very large code since i am new to r.
I forgot to mention that the package is sampling. Actually i have this 
simulated code:
 
n <- c(100,400,1000,1500,2000)
x <- c(2,3,3,3,5)
y <- c(7,7,9,10,10)
s <- function(mn, mx, n) {sample(mn:mx, n, replace=TRUE)}
rating=unlist(mapply(s, x, y, n))

Hypermarket <- matrix(rnorm(100, mean=5, sd=5000))
Supermarket <- matrix(rnorm(400, mean=34000, sd=3000))
Minimarket  <- matrix(rnorm(1000, mean=1,sd=2000))
Cornershop  <- matrix(rnorm(1500, mean=2500, sd=500))
Spazashop   <- matrix(rnorm(2000, mean=1000, sd=250))
dat=data.frame(type=c(rep("Hypermarket",100), rep("Supermarket",400),
rep("Minimarket",1000),rep("Cornershop",1500), rep("Spazashop",2000)),
value=c(Hypermarket, Supermarket, Minimarket, Cornershop,Spazashop))
 
##sample frame
sampleframe=data.frame(type=c(rep("Hypermarket",100), rep("Supermarket",400),
rep("Minimarket",1000),rep("Cornershop",1500), rep("Spazashop",2000)),
value=c(Hypermarket, Supermarket, Minimarket, Cornershop,Spazashop),
ratings =cbind(rating))
 
## package sampling
 
stra=strata(sampleframe,c("type","value","rating"),size=c(20,80,200,300,400),
method="srswor")
sample.strat<-getdata(sampleframe,stra)

sample.strat

now i want to find different estimates from sample.strat
 
Help appreciated.





  
[[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] re ad.delim skips first column (why?)

2009-10-01 Thread HBaize


I can't determine what is going on in you example, but my approach would be
to read the text file into a text editor that will display hidden characters
(tab, etc.) so you can see the pattern. It could be that there is an extra
tab in some locations. You could then use the editor's replace function to
remove the control characters that are causing the problem. 


Giovanni Dall'Olio wrote:
> 
> Hi people,
> I have a text file like this one posted:
> 
> 
> When I use read.delim (or any read function) on it, R skips the first
> column, and I don' understand why.
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/read.delim-skips-first-column-%28why-%29-tp24466023p25696875.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] question

2009-10-01 Thread David Winsemius


On Oct 1, 2009, at 4:33 AM, hassan paylakhi wrote:


hi
I am going to crazy.I want to use beadarray package in R, but I cant.
when I want install it, I encounter to this message "Loading required
package: hwriter
Loading required package: sma
Error in library(pkg, character.only = TRUE, logical.return = TRUE,  
lib.loc

= lib.loc) :
 'sma' is not a valid installed package"
I cant find sma and hwriter packages, it seems that they are not  
anymore.

could you help me plz?


Binary versions of sma and hwriter can be found on your CRAN repository.

How they get installed may depend to some extent on which repository  
you use and your OS (which you have not offered).


?install.packages

--

David Winsemius, MD
Heritage Laboratories
West Hartford, CT

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


Re: [R] re ading and analyzing a word document

2009-10-01 Thread David Winsemius


On Oct 1, 2009, at 12:18 AM, cls59 wrote


PDXRugger wrote:


Considering your instructions:

#Define words to find
to.find <- c( 'the', 'is', 'are' ,'dr')
#Read in the file...
file.text <- readLines( 'data/letter.txt' )
#Count number of occurnces of deined word in text
line.matches <- unlist( lapply( to.find, grep, x =  
unlist(file.text[2]) )

)

Result:

line.matches

[1] 1 1 1

This is not right of course as there are actually four words and  
secondly

becasue the searched words appear multiple times.




The example I gave was only meant to identify those lines on which  
matches
occurred. Using x = unlist(file.text[2]) only feeds one line of the  
file
into the matching routine so the result indicates that all the  
matches were

on line 1-- the only line present for searching.

If you want to count the individual occurrences of the words on each  
line,

you may need to look at using a function such as gregexpr. grep only
indicates if a match or matches is present in a line of text--  
gregexpr

indicates at which positions those matches occur in the line.

However, you may be getting to the point with this where R is no  
longer an
appropriate tool for this job. R is amazingly flexible it is  
possible that
it can give you what you want. However, R was not designed to  
perform text
processing-- Perl comes to mind as being a language that was  
explicitly

designed to perform these sorts of operations.


Perhaps you should use the R-search facilities for such questions:

http://finzi.psych.upenn.edu/R/library/tau/html/00Index.html
http://finzi.psych.upenn.edu/views/NaturalLanguageProcessing.html
http://www.jstatsoft.org/v25/i05/

R may not have been designed for text processing, but it is rather  
amazing how much has been done.





--

David Winsemius, MD
Heritage Laboratories
West Hartford, CT

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


Re: [R] creating R roll in Centos OS

2009-10-01 Thread Marc Schwartz

On Oct 1, 2009, at 2:44 AM, Sukhbir Rattan wrote:


Hi

I have Centos Operating System.

I m installing R on it. For this I have to create roll of R.

So, how to create the roll of R, regarding this what to be  
downloaded and

from where?

Plz help.

By
Sukhbir Singh Rattan.



If by "roll", you are referring to an RPM, they are available via the  
"EPEL", which is a repository that provides RPMs for RHEL and CentOS.  
More information is here:


  https://fedoraproject.org/wiki/EPEL

There are instructions for configuring your system to use the EPEL  
(via 'yum') and how to download and install RPMs from it.


Once you get the EPEL configured on your system, you can install R by  
using:


  sudo yum install R


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.


[R] GAM question

2009-10-01 Thread Daniel Rabczenko

Hello evyrone,
I would be grateful if you could help me in (I hope) simple problem.
I fit a gam model (from mgcv package) with several smooth functions .
I don't know how to extract values of just one smooth function. Can you 
please help me in this?

Kind regards,
Daniel Rabczenko

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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   >