Re: [R] including images in a plot

2007-09-28 Thread Frede Aakmann Tøgersen
Perhaps

http://finzi.psych.upenn.edu/R/Rhelp02a/archive/94069.html

is a good starting point?


Med venlig hilsen
Frede Aakmann Tøgersen
 

 

> -Oprindelig meddelelse-
> Fra: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] På vegne af Steve C. Wang
> Sendt: 28. september 2007 01:15
> Til: [EMAIL PROTECTED]
> Emne: [R] including images in a plot
> 
> 
> Does anyone know if it is possible to incorporate image files 
> (e.g., jpgs or gifs) in an R graphic?
> 
> I would like to make a scatterplot in which each point is a 
> small picture of the animal represented by each value. Each 
> picture would be a graphics file. Is there some way to use 
> such files as plot symbols in R?
> 
> Cheers,
> 
> Steve
> 
> 
> --
> 
> Steve C. Wang
> Assistant Professor of Statistics
> Swarthmore College
> http://www.swarthmore.edu/NatSci/swang1
> 
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/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] TukeyHSD doubts

2007-09-28 Thread Prof Brian Ripley

This is a repost of
https://stat.ethz.ch/pipermail/r-help/2007-September/141727.html
Please do study the posting guide to see why you did not get an answer and 
what to do when you do not.


It is nothing to do with TukeyHSD, as the differences are there in the 
means.


It is clear that your covariates are havng an effect on the fit. 
Presumably you suspected that because you tried a fit with them included, 
and the fit with covariates is therefore the one to use.


As the posting guide points out this is not a list for statistical advice, 
so please make use of your local statistical advice service for help on 
the substantive issues here.


On Thu, 27 Sep 2007, Mariana Botelho wrote:


Hello,

I have some doubts on TukeyHSD application.

I want to investigate the effects of depth, latitude and month variation on
the length of a fish. These are orthogonal and observational data.

For this, I have made an aov model (L~month+lat+prof+month*lat), after
applying drop1 and step functions. But when I applied TukeyHSD I had
unexpected results.

For instance, I have three levels for latitude and the mean and standard
deviation of lengths are:


aggregate(LtMm,list(FLat=FLat),mean)


 FLatx

1 24.5 431.8745

2   25 415.9973

3 25.5 416.0420




aggregate(LtMm,list(FLat=FLat),sd)


 FLatx

1 24.5 114.6516

2   25 108.9774

3 25.5 105.5219



So, it's expected to have 25 and 25.5 levels closer than 24.5, and we see
this making a simple aov model:


aov.LtArL <-aov(LtMm~FLat)



TukeyHSD(aov.LtArL, ordered = TRUE)


 Tukey multiple comparisons of means

   95% family-wise confidence level

   factor levels have been ordered



Fit: aov(formula = LtMm ~ FLat)



$FLat

difflwr  upr p adj

25.5-250.04474535 -16.009079 16.09857 0.764

24.5-25   15.87715429  -5.371913 37.12622 0.1860347

24.5-25.5 15.83240894  -3.213078 34.87790 0.1251572



Nevertheless, the complete model indicates just the opposite:


aov.LtAr<-aov(LtMm~FMes+FLat+FProf+FMes*FLat)



TukeyHSD(aov.LtAr,"FLat",ordered=T)


 Tukey multiple comparisons of means

   95% family-wise confidence level

   factor levels have been ordered



Fit: aov(formula = LtMm ~ FMes + FLat + FProf + FMes * FLat)



$FLat

 difflwr  upr p adj

24.5-25.5  6.46322 -11.706623 24.63306 0.6815646

25-25.5   19.72066   4.404934 35.03639 0.0072350

25-24.513.25744  -7.014670 33.52955 0.2751153

Which should be the right interpretation?

Thanks in advance for any help!

Best regards,

Mariana L. L. A. Botelho

MSc candidate

São Paulo Fisheries Institute

Brazil

[[alternative HTML version deleted]]




--
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] ifelse and dates do not work together: What workaround?

2007-09-28 Thread Gabor Grothendieck
See ?replace to do it in one line.

On 9/27/07, Farrel Buchinsky <[EMAIL PROTECTED]> wrote:
> I encountered the above problem. I went to the help files and
> discovered the reason why. My insight as to why it was happening did
> not immediately provide me with a solution by which I could accomplish
> what I needed to do. I turned to the help archive. I encountered a
> thread on which somebody pointed this problem out and was mildly
> castigated for not having looked at the help file. Alas no workaround
> was provided.
>
> ifelse(test, yes, no) is wonderful since it works well in a dataframe
> but only if yes and no are something simple, such as a numeric vector.
> But if yes and no are dates then it does not work.
>
> My workaround was quite inelegant.
> Instead of the elegance of
> official.date<-ifelse(is.na(x),dateyes,dateno)
>
> I resorted to conditional indexing.
> official.date<-dateno #only apporopriate when x is not missing
> official.date[is.na(x)]<-dateyes[is.na(x)]
>
>
> Original thread:
> On Sat, 3 Jun 2006, ivo welch wrote:
>
> > I wonder if this is an intentional feature or an oversight.
>
> These are documented properties of the functions you are using.
>
> > in some column summaries or in ifelse operations, apparently I am losing
> > the date property of my vector.
> >
> ...
> >> ifelse( is.na(c), e, c )
> > [1] 4017 4048 4076   # date property is lost
>
> As documented. From ?ifelse:
>
> Value:
>
>  A vector of the same length and attributes (including class) as
>  'test' and data values from the values of 'yes' or 'no'.  The mode
>  of the answer will be coerced from logical to accommodate first
>  any values taken from 'yes' and then any values taken from 'no'.
>
> Note that the class is taken from 'test'.
>
> > PS: this time I do not need help.  I can write my code around this.
>
> Help in pointing you to the posting guide and its recommended reading of
> the help page might still be helpful.
>
>
>
>
>
> --
> Farrel Buchinsky
> GrandCentral Tel: (412) 567-7870
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/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] converting numbers in "YYYYMM" format to last calendar day and last exchange trading day of the month

2007-09-28 Thread Gabor Grothendieck
Using as.yearmon and as.Date.yearmon with frac=1 (both from
the zoo package), the last calendar day of the month is:

library(zoo)
d <- c("200701", "200702")

lastday <- as.Date(as.yearmon(d, "%Y%m"), frac = 1)

and the zoo quickref

vignette("zoo-quickref")

has a nextfri function that you can modify to be lastfri.  See
the help desk article in R News 4/1 for more on dates and times.

Now make a vector of holidays, h, and for each last friday
decrement it by 1 until its no longer in h.


On 9/27/07, Thomas Pujol <[EMAIL PROTECTED]> wrote:
>I have a vector that contains month and year in the format MM 
> (e.g."200701", "200702")
>
>  I wish to do to things:
> 1. I need  to convert to a date that is the last calendar day of each 
> month.
>
> 2. I need  to convert this to a date that is the last U.S. stock-exchange 
> trading day  of each month.
>Any advice is appreciated,
>  mymonths <- c(200701, 200702)
>
> -
>
>[[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] Legend

2007-09-28 Thread S Ellison
>>> P Ehlers <[EMAIL PROTECTED]> 26/09/2007 11:06:54 >>>
>a <- .33
>b <- .55
>legend("bottom", fill=c("red","blue"),
>  legend=c(bquote(p == .(a)), bquote(p == .(b))), bty="n")

paste should do it:

legend("bottom", fill=c("red","blue"),
  legend=paste("p=", c(a,b), sep=""), bty="n")

and would be even easier if a and b were already in a vector.

> I have following syntax for putting a legend :
> 
> legend("bottom", fill=c("red","blue"), legend=expression(p==0.30, p==0.50), 
> bty="n")
> 
> However what I want is that : the value "0.30" should be a value of a 
> variable instead of a constant, so that I can put the name of this variable 
> and in legend it's value will be displayed. Can anyone tell me how to do that?
> 
> Regards,
> 
> 
> thanks in advance
>
> -
>  Why delete messages? Unlimited storage is just a click away.
>   [[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.

***
This email contains information which may be confidential and/or privileged, 
and is intended only for the individual(s) or organisation(s) named above. If 
you are not the intended recipient, then please note that any disclosure, 
copying, distribution or use of the contents of this email is prohibited. 
Internet communications are not 100% secure and therefore we ask that you 
acknowledge this. If you have received this email in error, please notify the 
sender or contact +44(0)20 8943 7000 or [EMAIL PROTECTED] immediately, and 
delete this email and any attachments and copies from your system. Thank you. 

LGC Limited. Registered in England 2991879. 
Registered office: Queens Road, Teddington, Middlesex TW11 0LY, UK
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] RMySQL installing problems

2007-09-28 Thread andreiabb

Dear forum,

I'm trying to install RMySQL but I'm having problems in loading it, here is
the message that I'm getting in R
install.packages("RMySQL", dependencies=TRUE)
trying URL
'http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/2.5/RMySQL_0.6-0.zip'
Content type 'application/zip' length 391364 bytes
opened URL
downloaded 382Kb

package 'RMySQL' successfully unpacked and MD5 sums checked

The downloaded packages are in
C:\TEMP\RtmpqsmLsb\downloaded_packages
updating HTML package descriptions

> local({pkg <- select.list(sort(.packages(all.available = TRUE)))
+ if(nchar(pkg)) library(pkg, character.only=TRUE)})
Error in dyn.load(x, as.logical(local), as.logical(now)) : 
unable to load shared library
'C:/PROGRA~1/R/R-25~1.1/library/RMySQL/libs/RMySQL.dll':
  LoadLibrary failure:  The specified module could not be found.


Error: package/namespace load failed for 'RMySQL'


Can someone give me a tip?

Thanks

Regards

Andreia Fonseca

PhD candidate
Wageningen University

Animal Breeding and Genomics Centre

Marijkweg 40

P.O. Box 338

6700 AH Wageningen

  Tel: +31 (0)  317483194


-- 
View this message in context: 
http://www.nabble.com/RMySQL-installing-problems-tf4533729.html#a12938345
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] BATCH run library problem

2007-09-28 Thread Flash
I have installed R-2.5.1 on my linux machine (Ubuntu LTS 6.01) by
compiling the source. I have no problem to install packages on my
local folder,

/home/flash/R_LIBS

And I have no problem to load the package inside of R. for example,

>library(cluster)


However, when I'm trying to run batch command, for example,

$R CMD BATCH work1.r work1.out


( work1.r file begins with library commands, like)

library(cluster)
..


then I have the following error (copied from work1.out)
> library(cluster)
Error in library(cluster) : there is no package called 'adapt'
Execution halted

I checked the environment variables.

> options("lib")
$lib
[1] "/home/flash/R_LIBS"

> Sys.getenv("R_LIBS")
  R_LIBS
"~flash/R_LIBS"

In shell, env returns many variables and I have

R_LIBS=/home/flash/R_LIBS:/usr/local/lib64/R/library.


The only way to avoid this problem is to copy cluster directory from
/home/flash/R_LIBS to /usr/local/lib64/R/library/   .

How can I fix this problem? (or do I have to copy package directory
whenever I install new one?) Thanks in advance..

Flash.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Converting to mode numeric within a matrix

2007-09-28 Thread Sergey Goriatchev
Hello,

I create a matrix:

best <- matrix(0, ncol=2, nrow=num.selected,
dimnames=list(the.best$.Name, c("Probability(%)", "Inside")))

best[,1] <- as.numeric(the.best$Total*100)

best[,2] <- ifelse(the.best$Weight==0, "No", "Yes")

What I want is the second column of mode numeric, but it is of mode
character, despite the attempt to convert it to numeric with
as.numeric(). It must have something to do with the second column of
the matrix, where I write No/Yes.
What should I do to have the first column of mode numeric?
Also, how can I output No/Yes in the second column without citation
marks around them?

Thanks in advance
Sergey

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] ifelse and dates do not work together: What workaround?

2007-09-28 Thread Peter Dalgaard
Gabor Grothendieck wrote:
> See ?replace to do it in one line.
>   
Also, don't miss the bleeding obvious (or so one might think...):

> z <- ifelse(TRUE, as.Date("2007-01-01"), as.Date("2007-01-02"))
> class(z) <- "Date"
> z
[1] "2007-01-01"

In the special case of censoring, you can also get away with

end <- pmin(died, endofstudy, na.rm=TRUE)

(This has the side effect of eliminating deaths recorded after end of
follow-up, which is generally a Good Thing.)

> On 9/27/07, Farrel Buchinsky <[EMAIL PROTECTED]> wrote:
>   
>> I encountered the above problem. I went to the help files and
>> discovered the reason why. My insight as to why it was happening did
>> not immediately provide me with a solution by which I could accomplish
>> what I needed to do. I turned to the help archive. I encountered a
>> thread on which somebody pointed this problem out and was mildly
>> castigated for not having looked at the help file. Alas no workaround
>> was provided.
>>
>> ifelse(test, yes, no) is wonderful since it works well in a dataframe
>> but only if yes and no are something simple, such as a numeric vector.
>> But if yes and no are dates then it does not work.
>>
>> My workaround was quite inelegant.
>> Instead of the elegance of
>> official.date<-ifelse(is.na(x),dateyes,dateno)
>>
>> I resorted to conditional indexing.
>> official.date<-dateno #only apporopriate when x is not missing
>> official.date[is.na(x)]<-dateyes[is.na(x)]
>>
>>
>> Original thread:
>> On Sat, 3 Jun 2006, ivo welch wrote:
>>
>> 
>>> I wonder if this is an intentional feature or an oversight.
>>>   
>> These are documented properties of the functions you are using.
>>
>> 
>>> in some column summaries or in ifelse operations, apparently I am losing
>>> the date property of my vector.
>>>
>>>   
>> ...
>> 
 ifelse( is.na(c), e, c )
 
>>> [1] 4017 4048 4076   # date property is lost
>>>   
>> As documented. From ?ifelse:
>>
>> Value:
>>
>>  A vector of the same length and attributes (including class) as
>>  'test' and data values from the values of 'yes' or 'no'.  The mode
>>  of the answer will be coerced from logical to accommodate first
>>  any values taken from 'yes' and then any values taken from 'no'.
>>
>> Note that the class is taken from 'test'.
>>
>> 
>>> PS: this time I do not need help.  I can write my code around this.
>>>   
>> Help in pointing you to the posting guide and its recommended reading of
>> the help page might still be helpful.
>>
>>
>>
>>
>>
>> --
>> Farrel Buchinsky
>> GrandCentral Tel: (412) 567-7870
>>
>> __
>> R-help@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/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.
>   


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

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


[R] Writing successful self-starting models for nlme

2007-09-28 Thread I R Cleasby


Hi fellow R users,

My problem is the following:

I wish to use the nlme package to analyse the growth curves of house sparrow
chicks, 
especially in relation to factors such as sex,  position in the weight hierarchy
etc. as fixed effects and chick ID nested within BroodID as random effects.

 The equation I wish to use to describe the chick growth is the logistic
growth function:

  W = Asym/ (1+exp(-K*(x-xmid))

  Where Asym = Asymptotic size, K is the rate constant of the equation and xmid
is the inflection point

This is very similar to the forumla used by the self-start function SSlogis,
the Asym and xmid
 parameters are the same, however parameter K in the above equation is not the
same as parameter scal in
the simple logistic equation used by R. 

My initial solution to this was to create my own self-start function using
the logistInit
 function in Pinheiro & Bates (2000) as a guide. Thus, my function went as
follows:


logisticSS<-

 function(mCall, LHS, data)
 {
 xy <- sortedXyData(mCall[["x"]], LHS, data)
  if (nrow(xy) <3){
  stop ("Too few distinct input values to fit a logistic")
 }
 Asym <- max(abs(xy[,"y"]))
xmid<-NLSstClosestX(xy, 0.5*Asym)
 K <- (0.781/(NLSstClosestX(xy, 0.8*Asym)-NLSstClosestX(xy, 0.15*Asym)))*4
 value<-c(Asym, xmid, K)
 names(value)<- mCall[c("Asym", "xmid", "K")]
value
 }

I then constructed a selfStart model by:

logistic<- 

selfStart ( ~ Asym/ (1 + exp ( - K * ( x  - xmid))), initial = logisticSS,
parameters = c ("Asym", "xmid", "K"))

  for which the getInitial function is able to provide initial values.

 Problems arise when I try and use this function in an nlsList call, where I get
a warning saying: number of iterations exceeds 50, and when I use it with the
nlme, which can spend hours computing. only to result in failure to converge.
 
   My question is how would I go about improving my self start function to
allieviate these problems. I am sure there is a way to do it but I have been
unsuccessful in finding it so far. Any help would be much appreciated.

   Thank you,

  Ian Roberts

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

2007-09-28 Thread Michael Stegh
Dear List,

is there a way to send the contents of a variable (e.g. a list) directly to a 
laser printer. I am 
aware that I could save the variable to a ascii-file and then print the file, 
but I would prefer to 
print from R directly. 

I have been looking for a way to do so for the better part of the day now, but 
I could figure out 
how to do so.

Thanks,

Michael Stegh

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


[R] Creating nice looking lists: how?

2007-09-28 Thread Sergey Goriatchev
Hello,

For my functions I want to create output similar in appearance to that
of what you get when you print a summary of lm model:

Residuals:
  Min1Q Median3Q   Max
-0.209209 -0.043133  0.001793  0.044105  0.234750

Coefficients:
 Estimate  Std. Error  t valuePr(>|t|)
(Intercept)  0.981762   0.004089 240.103  < 2e-16 ***
Factor 1-0.009581   0.006381  -1.501 0.134296
Factor 2-0.008993   0.009182  -0.979 0.328163
Factor 3 0.029960   0.009547   3.138 0.001866 **
Factor 4-0.026575   0.007370  -3.606 0.000363 ***
Factor 5-0.004847   0.006382  -0.760 0.448138
Factor 6 0.005099   0.006483   0.786 0.432202
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

I want:
1) no $ before the list component names
2) component names that take values from outside variables
(ex.: number <- 10
   There are 'number' factors in the model:)

There is not much information on how to create nice output in terms of
lists, so I was looking for core to write the summary(lm) output, but
could not find much. Obviously, I can type summary.lm, but it does not
show how to create the name "Coefficients:"

Could someone give me pointers on how to create nice lists?

Thanks
Sergey

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

2007-09-28 Thread hadley wickham
Hi Jeff,

That looks like a nice initiative.  However, if you are interested in
getting contributions from the community, it might be good to spell
out how others might use the content of the site.  Currently you have
copyright r-cookbook.com, but maybe you could consider a creative
commons (http://creativecommons.org/) license instead?

Hadley

On 9/27/07, Jeff <[EMAIL PROTECTED]> wrote:
> R Community,
>
> I've put together a website that I thought this mailing list might be
> interested in: http://www.r-cookbook.com
>
> It's a (free) community-driven content management system for R
> "recipes", or working examples.  Some of the features of the site are
> code highlighting, recipe ratings, recipe comments, personal "recipe
> boxes" to save your favorite recipes, community tagging, RSS feeds
> for each user and for each tag, and similar recipe recommendations.
>
> Although I imagine that many users will sort/search/find recipes by
> tags, I've implemented a linear organization for recipes as well:
> guides.  These will be compilations of "recipes", organized in a
> logical fashion as to promote understanding of the topic of that
> particular guide and introduced with user-contributed pages.  Over
> time, hopefully with the help of the community, more guides will be
> created and the ones I have will be filled-in to actually be useful.
> I have started several guides to give you an idea of the sort of
> thing I'm thinking: Introduction to R, Longitudinal Modeling in R,
> Exploratory Data Analysis in R, and more here, http://www.r-
> cookbook.com/guide
>
> A couple of features that will be worked on in the near future are
> (1) the design of the site and (2) working on a more interactive code
> display (right now, functions are highlighted and linked to the r-
> docs, but that's it).
>
> I hope some of you might find the site useful and perhaps even
> consider contributing your own recipes.  If you have any suggestions
> or feature requests, I'd be glad to hear them!
>
> Jeff.
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>


-- 
http://had.co.nz/

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

2007-09-28 Thread bbolker



S Bina wrote:
> 
> Hi, 
> 
> I cannot find the function kurtosis. Is it sth additional I am meant to
> download? I use the MacOS X version of R.
> 
> Many thanks
> Samira
> 
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
> 
> 

 Don't think R has a built in kurtosis() function, but
see e.g.

http://finzi.psych.upenn.edu/R/Rhelp02a/archive/84433.html

  RSiteSearch("kurtosis") would probably have gotten you some answers.

   cheers
 Ben
-- 
View this message in context: 
http://www.nabble.com/kurtosis-tf4533680.html#a12940268
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] Graphics and LaTeX documents with the same font

2007-09-28 Thread jiho

On 2007-September-28  , at 16:57 , Frank E Harrell Jr wrote:
> jiho wrote:
>> On 2007-September-28  , at 15:18 , Paul Smith wrote:
>>> On 9/28/07, Prof Brian Ripley <[EMAIL PROTECTED]> wrote:
> I know how to export graphics as pdf files and then how to include
> them in LaTeX documents. However, I do not know how to do in   
> order to
> have the text of the graphics written with the font selected  
> for the
> LaTeX document. Is that possible?
 [...]
>> If you don't mind an extra step between R and LaTeX, you could  
>> use  Inkscape to modify your graphics:
>>  http://www.inkscape.org/
>> It is a (very nice!) vector graphics editor which:
>> - works with SVGs (as produced with the RSvgDevice package)
>> - imports PDFs (really well in the latest development version)
>> - is available for free, on most platforms
>> and
>> - exports PDFs that nicely integrate in LaTeX documents
>> - exports PSTricks graphics
>> Then two roads are opened for you:
>> 1- either get a TTF version of the LaTeX fonts (there are  
>> packages  for this on all linux distros I know, for use with Lyx  
>> and you can  probably find them on the web otherwise) and change  
>> all the fonts to  those once your document is in Inkscape (select  
>> all > text and font >  select the font)
>> 2- or open the document with inkscape and export it to pstricks
>> I personally use Inkscape on all my R graphics because I find it   
>> easier and quicker to get decent graphics and R and refine their  
>> look  in Inkscape than to get them perfect in R in one shot  
>> ( though with  ggplot2 things are improving on R's side).

> As this works against principles of reproducible research, I  
> wouldn't recommend it.

Do you consider that changing the font size of the graphic would be  
altering the research result? Or laying out a 2d contour and a 3d  
plot in parallel, or changing the line color/pattern...? My  
modifications are usually of this kind. Of course those things are  
doable with R but they are usually immensely easier in a graphics  
program (where the color palettes are predefined, the dash patterns  
are more diverse etc.).

For example, I often find myself using the same plot in an article, a  
presentation, and a poster, usually with different color palettes and  
font requirements. I just open the pdf, change the colors, font and  
font size to match the design of the article/presentation/poster,  
realign the labels a bit and re-save it. I don't think that I am  
doing any harm to my result or present any false information to the  
readers, I just make the graphics easier on their eyes.

But maybe I am a bit too much of a purist on these maters. I just  
find that, much too often, research results that represent months of  
work are presented as narrow, black and white (possibly even  
pixallated!) captures of article graphics which don't do justice to  
the quality of the work behind them. I don't think there is any harm  
in making (good) science look a bit "sexier", do you?

Jean-Olivier Irisson
---
UMR 5244 CNRS-EPHE-UPVD, 52 av Paul Alduy, 66860 Perpignan Cedex, France
+336 21 05 19 90
http://jo.irisson.free.fr/work/

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

2007-09-28 Thread Jeff Spies
Hi Philippe,

I don't want to be competing in any way with any of the fantastic  
official R resources that exist; I only want to supplement them.
Although this list is probably not the best place to discuss the  
proper use of wiki's for documentation/learning, I'll make a few  
comments on the role, I believe, R-Cookbook.com can play.

First of all, R-Cookbook.com offers two organization schemes,  
dictated by the users: linear and (what's being call) non-linear.   
Recipes can be placed in guides in order to organize content linearly  
in a way more familiar to most users.  Recipes can also be free- 
tagged, not only by the author, but by the community (much like a  
wiki--although you've actually implemented a linear scheme for tips  
and lack the non-linear aspect).

Secondly, some people like to retain authorship of these sorts of  
things, and not only for selfish reasons, like self promotion.   
First, they get to control how their message is delivered--other's  
can't edit it.  My guess is that you have the wiki configured as most  
wiki's are--community editing rights.  To counter the issues  
associated with individual-control in a community-oriented site, at R- 
Cookbook.com, other users can comment on the recipe, or express their  
regards for the quality of the recipe via the rating system.  Or they  
can create a recipe on the same topic, and the "similar recipe"  
engine should display it beneath the recipe in question.  Some people  
also like to retain authorship merely so their friends/students/fans  
can keep track of their work.  At R-Cookbook.com, users get a url  
specific to their recipes (in the format http://www.r-cookbook.com/ 
recipes/[username]) along with a feed of all of their recipes.  Also,  
this multi-level feed system is not available (I don't believe) via  
dokuwiki's framework.  If a person were only interested in  
visualization, they could use their favorite RSS news reader, and  
only keep track of recipes related to visualization.  Or if a person  
had a great deal of respect for a few authors, they could track their  
contributions the same way.

In principle, a wiki may not be the best place to store "recipes"  
either.  Because most wiki's like to have one article per topic, the  
community is forced to establish a "best" article via community  
editing.  At R-Cookbook.com, there can be more than one recipe for a  
certain problem/issue, letting the community decide the preferred  
solution via ratings/comments.  Sure, having more than one article  
can be done with a wiki's, but it almost defeats the purpose--I'm a  
purist, sorry.  ;)

More generally, recipes on R-Cookbook.com are free to go a different  
direction as what has been currently established as tips on the wiki  
(I know this can change, but I'm just saying...).  "Recipes" can be  
very problem specific, related to many topics, or very specific to  
the authors data, or whatever the case may be--not necessarily  
related to one method of analysis or one function.  Where would  
something like that go in your current linear organization of tips?   
At R-Cookbook.com, I would still appreciate and value the  
contribution because someone might find it useful, and they could  
discover it via tags, the search engine, a user feed, or the similar  
recommendation engine.  Personally, I just don't see a place for that  
sort of entry in the wiki.

With all of that said, if there is anything at R-cookbook.com that  
you believe would benefit the wiki more than perhaps a link to the  
recipe, the content is freely available to the public, and it is in  
your rights to put it there.

Again, the site is purely to support the community, and I really  
don't believe it is in competition with what your wiki offers.  I'd  
be glad to continue this discussion off-list and appreciate you  
bringing up the point though, it's a good question, that I hope I've  
answered.

Jeff.

On Sep 28, 2007, at 4:11 AM, Philippe Grosjean wrote:

> Hello Jeff,
>
> Good initiative,... but why not to put this in the official R Wiki
> (http://wiki.r-project.org)? There is a section named 'tips' dedicated
> to such little recipes
> (http://wiki.r-project.org/rwiki/doku.php?id=tips:tips). It should be
> better to centralize all these little tips, don't you think so?
>
> Should you have difficulties to use the Wiki, just tell me, and I will
> help...
> Best,
>
> Philippe Grosjean
>
> ..<°}))><
>   ) ) ) ) )
> ( ( ( ( (Prof. Philippe Grosjean
>   ) ) ) ) )
> ( ( ( ( (Numerical Ecology of Aquatic Systems
>   ) ) ) ) )   Mons-Hainaut University, Belgium
> ( ( ( ( (
> ..
>
> Jeff wrote:
>> R Community,
>>
>> I've put together a website that I thought this mailing list might be
>> interested in: http://www.r-cookbook.com
>>
>> It's a (free) community-driven content management system for R
>> "recipes", or working exampl

[R] orientlib

2007-09-28 Thread Abu Naser

Hi All user,

I have been using R-2.5.1. dose orientlib support this version? I would like to 
try. it.
I have been wondering how to install the library.

With regards,
abu
_
Celeb spotting – Play CelebMashup and win cool prizes

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Graphics and LaTeX documents with the same font

2007-09-28 Thread Frank E Harrell Jr
Paul Smith wrote:
> On 9/28/07, Prof Brian Ripley <[EMAIL PROTECTED]> wrote:
>>> I know how to export graphics as pdf files and then how to include
>>> them in LaTeX documents. However, I do not know how to do in order to
>>> have the text of the graphics written with the font selected for the
>>> LaTeX document. Is that possible?
>> Well, it depends on what that font is.  But if it is TeX font,
>> see the section called 'TeX fonts' in ?postscript and the detailed
>> description in the article in R-news 6/2 by Paul Murrell and myself.
>>
>> If it is an Adobe Type1 font such as Times New Roman, just specify an
>> appropriate family in the pdf() call.
>>
>> Dietrich Trenkler wrote:
>>
>>> maybe you will find the psfrag package useful.
>> I doubt it will be even usable with PDF (there are pdfrack and Xfigfrag,
>> though), and with postscript it is at best a kludge as R does its own
>> micro-positioning of text based on the font metrics.
> 
> Thanks to both. PSTricks
> 
> http://en.wikipedia.org/wiki/PSTricks
> 
> draws figures that, when inserted in a LaTeX document, their font
> matches the one selected for the LaTeX document. If I may, I would
> like to submit to your consideration the suggestion of implementing
> the exportation of R graphics to PSTricks.
> 
> Paul

See http://biostat.mc.vanderbilt.edu/PsFrag for a way to semi-automate 
the process.

Frank

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

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


Re: [R] Creating nice looking lists: how?

2007-09-28 Thread Ptit_Bleu

Hi,

I don't know if it will help you but to retrieve the slope of lm(y~x), I use
:
coefficients(lm(y~x))[2]
([1] for the intercept)

I should not tell this but It took me a long time to find this obvious
thing.

Have a nice week-end,
Ptit Bleu.



Sergey Goriatchev wrote:
> 
> Hello,
> 
> For my functions I want to create output similar in appearance to that
> of what you get when you print a summary of lm model:
> 
> Residuals:
>   Min1Q Median3Q   Max
> -0.209209 -0.043133  0.001793  0.044105  0.234750
> 
> Coefficients:
>  Estimate  Std. Error  t valuePr(>|t|)
> (Intercept)  0.981762   0.004089 240.103  < 2e-16 ***
> Factor 1-0.009581   0.006381  -1.501 0.134296
> Factor 2-0.008993   0.009182  -0.979 0.328163
> Factor 3 0.029960   0.009547   3.138 0.001866 **
> Factor 4-0.026575   0.007370  -3.606 0.000363 ***
> Factor 5-0.004847   0.006382  -0.760 0.448138
> Factor 6 0.005099   0.006483   0.786 0.432202
> ---
> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
> 
> I want:
> 1) no $ before the list component names
> 2) component names that take values from outside variables
> (ex.: number <- 10
>There are 'number' factors in the model:)
> 
> There is not much information on how to create nice output in terms of
> lists, so I was looking for core to write the summary(lm) output, but
> could not find much. Obviously, I can type summary.lm, but it does not
> show how to create the name "Coefficients:"
> 
> Could someone give me pointers on how to create nice lists?
> 
> Thanks
> Sergey
> 
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/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/Creating-nice-looking-lists%3A-how--tf4534730.html#a12942721
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] off topic: Job advert - computational biologist

2007-09-28 Thread Crispin Miller
Hi,
I hope you don't mind me posting this to the list:
 
We are seeking a postdoctoral scientist to join the Applied
Computational Biology and Bioinformatics group at the Paterson Institute
for Cancer Research. The role will be to develop novel approaches for
the analysis of high throughput genomic data, such as those arising from
Affymetrix microarray experiments. 
 
We are an interdisciplinary team that brings together skills in computer
science, biology and mathematics, and are focused on the development and
application of bioinformatics tools to support the interpretation of
complex datasets (see, for example, http://xmap.picr.man.ac.uk
 ). The ideal candidate will be excited by
the interface between computer science, mathematics and biology, and
will have a strong desire to see their work applied directly in
collaboration with both bench-scientists and clinicians. Significant
programming experience is a pre-requisite and applications from
candidates with strong R programming skills are particularly encouraged.

Full details are here:
http://www.paterson.man.ac.uk/jobs/viewjob.asp?Job=PI/07/20
 
 
regards
Crispin
 



This email is confidential and intended solely for the use o...{{dropped}}

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

2007-09-28 Thread Birgit Lemcke
Hello!

I am R beginner and I have a question obout a simple matching.

I have to datasets that i read in with:

MalVar29_37<-read.table("MalVar29_37.csv", sep = ";")
FemVar29_37<-read.table("FemVar29_37.csv", sep = ";")

They look like this and show binary variables:

 V1 V2 V3 V4 V5 V6 V7 V8 V9
10  0  0  0  0  1  0  0  0
20  0  0  0  0  1  0  0  0
30  0  0  0  0  1  0  0  0
4   NA NA NA NA NA NA NA NA NA
50  1  0  0  0  1  0  0  0

 V1 V2 V3 V4 V5 V6 V7 V8 V9
11  1  0  0  0  0  0  0  0
20  1  0  0  1  1  0  0  0
31  0  0  1  0  0  0  0  0
40  1  0  0  1  0  0  0  0
50  1  0  0  0  0  0  0  0

each with 348 rows.

I would like to perform a simple matching but only row 1 compared to  
row1, row 2 compared to row 2 (paired)...giving back a number as  
dissimilarity for each comparison.

How can i do that?

Thanks in advance

Birgit




Birgit Lemcke
Institut für Systematische Botanik
Zollikerstrasse 107
CH-8008 Zürich
Switzerland
Ph: +41 (0)44 634 8351
[EMAIL PROTECTED]






[[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] Graphics and LaTeX documents with the same font

2007-09-28 Thread Frank E Harrell Jr
jiho wrote:
> On 2007-September-28  , at 15:18 , Paul Smith wrote:
>> On 9/28/07, Prof Brian Ripley <[EMAIL PROTECTED]> wrote:
 I know how to export graphics as pdf files and then how to include
 them in LaTeX documents. However, I do not know how to do in  
 order to
 have the text of the graphics written with the font selected for the
 LaTeX document. Is that possible?
>>> Well, it depends on what that font is.  But if it is TeX font,
>>> see the section called 'TeX fonts' in ?postscript and the detailed
>>> description in the article in R-news 6/2 by Paul Murrell and myself.
>>>
>>> If it is an Adobe Type1 font such as Times New Roman, just specify an
>>> appropriate family in the pdf() call.
>>>
>>> Dietrich Trenkler wrote:
>>>
 maybe you will find the psfrag package useful.
>>> I doubt it will be even usable with PDF (there are pdfrack and  
>>> Xfigfrag,
>>> though), and with postscript it is at best a kludge as R does its own
>>> micro-positioning of text based on the font metrics.
>> Thanks to both. PSTricks
>>
>> http://en.wikipedia.org/wiki/PSTricks
>>
>> draws figures that, when inserted in a LaTeX document, their font
>> matches the one selected for the LaTeX document. If I may, I would
>> like to submit to your consideration the suggestion of implementing
>> the exportation of R graphics to PSTricks.
> 
> If you don't mind an extra step between R and LaTeX, you could use  
> Inkscape to modify your graphics:
>   http://www.inkscape.org/
> It is a (very nice!) vector graphics editor which:
> - works with SVGs (as produced with the RSvgDevice package)
> - imports PDFs (really well in the latest development version)
> - is available for free, on most platforms
> and
> - exports PDFs that nicely integrate in LaTeX documents
> - exports PSTricks graphics
> Then two roads are opened for you:
> 1- either get a TTF version of the LaTeX fonts (there are packages  
> for this on all linux distros I know, for use with Lyx and you can  
> probably find them on the web otherwise) and change all the fonts to  
> those once your document is in Inkscape (select all > text and font >  
> select the font)
> 2- or open the document with inkscape and export it to pstricks
> 
> I personally use Inkscape on all my R graphics because I find it  
> easier and quicker to get decent graphics and R and refine their look  
> in Inkscape than to get them perfect in R in one shot ( though with  
> ggplot2 things are improving on R's side).
> 
> Cheers,
> 
> JiHO

As this works against principles of reproducible research, I wouldn't 
recommend it.

Frank

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

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


[R] Graphics and LaTeX documents with the same font

2007-09-28 Thread Paul Smith
Dear All,

I know how to export graphics as pdf files and then how to include
them in LaTeX documents. However, I do not know how to do in order to
have the text of the graphics written with the font selected for the
LaTeX document. Is that possible?

Thanks in advance,

Paul

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


Re: [R] Help with "old" function in "base"

2007-09-28 Thread Prof Brian Ripley
Kernel density estimation is in package stats, and has been for over 3 
years. That package has a C entry point registered as R_band_den_bin which 
may be what you are looking for.

On Fri, 28 Sep 2007, Van Wyk, Jaap wrote:

> Hi
>
> I think there was a built-in function (perhaps C-code) called
> "band_den_bin" in the base library (used for kernel density estimators).
>
> Is there a newer version of this function. I have an old routine using
> this but it won't run in the newer version of R.
>
> Any help is much appreciated.
>
> Jacob
>
>
>
>
>
> Jacob L van Wyk
>
> Dept of Statistics
>
> University of Johannesburg, APK Campus
>
> Box 524
>
> Auckland Park 2006
>
> South Africa
>
>
>
>
>   [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

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

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


[R] Help with "old" function in "base"

2007-09-28 Thread Van Wyk, Jaap
Hi

I think there was a built-in function (perhaps C-code) called
"band_den_bin" in the base library (used for kernel density estimators).

Is there a newer version of this function. I have an old routine using
this but it won't run in the newer version of R.

Any help is much appreciated.

Jacob

 

 

Jacob L van Wyk

Dept of Statistics

University of Johannesburg, APK Campus

Box 524

Auckland Park 2006

South Africa

 


[[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] Plots with discontinuity balls

2007-09-28 Thread Duncan Murdoch
Paul Smith wrote:
> On 9/28/07, Duncan Murdoch <[EMAIL PROTECTED]> wrote:
>   
>>> Can R plot graphs like the one at
>>>
>>> http://www.mathwords.com/f/f_assets/floor_graph.gif
>>>
>>> with the balls at the discontinuity points?
>>>   
>> You can use segments() to draw the segments and symbols() to draw the
>> balls.  For example,
>>
>> plot(1,1,type='n', xlim=c(1,10), ylim=c(1,10))
>> segments(1:9, 1:9, 2:10, 1:9)
>> symbols(2:10, 1:9, circles=rep(0.1,9), inches=FALSE, bg="white",add=T)
>> symbols(1:9, 1:9, circles=rep(0.1,9), inches=FALSE, bg="black",add=T)
>>
>> This depends on the order of drawing, because the white background of
>> the first circles obscures the ends of the segments.
>> 
>
> Thanks, Jim and Duncan. It would help to have transparent backgrounds
> for the white balls.
>   
Then it's even easier:  just use points(), with pch=1, e.g.

plot(1,1,type='n', xlim=c(1,10), ylim=c(1,10))
segments(1:9, 1:9, 2:10, 1:9)
points(2:10, 1:9, pch=1, cex=2)
points(1:9, 1:9, pch=16, cex=2)


> Paul
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/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] Graphics and LaTeX documents with the same font

2007-09-28 Thread jiho

On 2007-September-28  , at 15:18 , Paul Smith wrote:
> On 9/28/07, Prof Brian Ripley <[EMAIL PROTECTED]> wrote:
>>> I know how to export graphics as pdf files and then how to include
>>> them in LaTeX documents. However, I do not know how to do in  
>>> order to
>>> have the text of the graphics written with the font selected for the
>>> LaTeX document. Is that possible?
>>
>> Well, it depends on what that font is.  But if it is TeX font,
>> see the section called 'TeX fonts' in ?postscript and the detailed
>> description in the article in R-news 6/2 by Paul Murrell and myself.
>>
>> If it is an Adobe Type1 font such as Times New Roman, just specify an
>> appropriate family in the pdf() call.
>>
>> Dietrich Trenkler wrote:
>>
>>> maybe you will find the psfrag package useful.
>>
>> I doubt it will be even usable with PDF (there are pdfrack and  
>> Xfigfrag,
>> though), and with postscript it is at best a kludge as R does its own
>> micro-positioning of text based on the font metrics.
>
> Thanks to both. PSTricks
>
> http://en.wikipedia.org/wiki/PSTricks
>
> draws figures that, when inserted in a LaTeX document, their font
> matches the one selected for the LaTeX document. If I may, I would
> like to submit to your consideration the suggestion of implementing
> the exportation of R graphics to PSTricks.

If you don't mind an extra step between R and LaTeX, you could use  
Inkscape to modify your graphics:
http://www.inkscape.org/
It is a (very nice!) vector graphics editor which:
- works with SVGs (as produced with the RSvgDevice package)
- imports PDFs (really well in the latest development version)
- is available for free, on most platforms
and
- exports PDFs that nicely integrate in LaTeX documents
- exports PSTricks graphics
Then two roads are opened for you:
1- either get a TTF version of the LaTeX fonts (there are packages  
for this on all linux distros I know, for use with Lyx and you can  
probably find them on the web otherwise) and change all the fonts to  
those once your document is in Inkscape (select all > text and font >  
select the font)
2- or open the document with inkscape and export it to pstricks

I personally use Inkscape on all my R graphics because I find it  
easier and quicker to get decent graphics and R and refine their look  
in Inkscape than to get them perfect in R in one shot ( though with  
ggplot2 things are improving on R's side).

Cheers,

JiHO
---
http://jo.irisson.free.fr/

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Is there a model like that in R?

2007-09-28 Thread Gustaf Rydevik
On 9/28/07, Manuel Ramon <[EMAIL PROTECTED]> wrote:
> Hi to everyone,
>
>
>
> I am starting to work with a model that is not familiar to me.
>
> The model would be like that:
>
>
>
>y = . - a*max(Q(i) - Q(0), 0) + .
>
>
>
> where Q(i) is the accumulated effect of a variable at time i and Q(0) a
> threshold above it there is effect on y.  The value of Q(i) could be
> estimated as:
>
>
>
>   Q(i+1) = Q(i) + b*max(s(i) - s(0), 0) + c*min(s(i) - s(0), 0) + .
>
>
>
> Where s would be the effect that produces the accumulate effect of Q, s(i)
> would be this effect at time i and s(0) another threshold above it the
> accumulative effect is produced. The coefficient b would be the rate of
> accumulation and c the rate of decay.
>
>
>
> What kind of model is it? Is it somewhat similar to time series?
>
>
>
> I appreciate your help.
>
>
>
> Manuel Ramon
>

I'm not sure what you're describing, but something is wrong for your
definition of Q(i).

For i=1:

Q(1) = Q(0) + b*max(s(0) - s(0), 0) + c*min(s(0) - s(0), 0) +
.=Q(0)+b*0+c*0=Q(0).
Thus, Q(n)=Q(n-1)=...=Q(0)

In addition, what is intended by the dots and the final plus in "y = .
- a*max(Q(i) - Q(0), 0) + ."?

I think you have to describe things a bit more careful, if we are to
understand what's happening.

Best,

Gustaf


-- 
Gustaf Rydevik, M.Sci.
tel: +46(0)703 051 451
address:Essingetorget 40,112 66 Stockholm, SE
skype:gustaf_rydevik

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] lmer giving negative, or no, estimated standard errors

2007-09-28 Thread Chaloner, Kathryn
R Users,

 

Emine Bayman sent this out earlier and we do not think it went through.
Appologies if it did. 

 

We want to fit GLMM with lmer with binomial data and a one-way random

effects model (overall mean is a fixed effect and there are random
effects for each binomial). 

We are using the Laplace method. We are simulating multiple data sets
and use the

Laplace method with control = list (usePQL = FALSE)). For most data sets
it works well, 

but for some we get an error message 

(Error in if (any(sd < 0)) return("'sd' slot has negative entries") :

missing value where TRUE/FALSE needed) 

In these cases we get an estimate for the fixed effect but do not get an

estimate for se.fixef (its negative).  If we change the method to PQL or
change 

control = list (usePQL = TRUE) 

then we get estimates for both fixed effect and se.fixef, but in the

example below the estimates of fixed effects are different for 3 of 4

cases - and the standard errors. Could someone please help us? 

 

Which, if any, of the estimates for

the intercept is the best one? And why are they different?

 

I think the problem occurs because the MLE for the between group
variance

is zero and so the estimate becomes negative. The different estimates

may have to do with pooling or not pooling the between and within sum of
squares

to estimate both the fixed effect and its standard error - but we can
find no

documentation for this.

 

Thanks,  Can anyone help us please?  Is there any documentation that
might help?

 

Kathryn Chaloner

Dept of Biostat

Univ Iowa

[EMAIL PROTECTED]

And Emine Bayman, PhD student.

[EMAIL PROTECTED]

 

Here is one example data set with very different estimates for the fixed

effect and its standard error:

 

install.packages("nlme")

install.packages("Matrix")

install.packages("lme4")

install.packages("car")

library(nlme)

library(Matrix)

library(lme4)

library(car)

library(arm)

y <- c(14, 9, 19, 12, 10, 12, 8, 11, 15, 4, 14, 13, 8, 3)

n <- c( 20, 20, 20, 20, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18)

center <- seq(1:14)

 

example1 <- lmer(cbind( y, n - y) ~ 1   + ( 1 | center) ,

family = binomial, niter = 50, method = "Laplace", control = list

(usePQL = FALSE))

fixef(example1)

se.fixef(example1)

 

example2 <- lmer(cbind( y, n - y) ~ 1   + ( 1 | center) ,

family = binomial, niter = 50, method = "Laplace", control = list

(usePQL = TRUE))

fixef(example2)

se.fixef(example2)

 

example3 <- lmer(cbind( y, n - y) ~ 1   + ( 1 | center) ,

family = binomial, niter = 50, method = "PQL",control = list (usePQL =

TRUE))

fixef(example3)

se.fixef(example3)

 

example4 <- lmer(cbind( y, n - y) ~ 1   + ( 1 | center) ,

family = binomial, niter = 50, method = "PQL",control = list (usePQL =

FALSE))

fixef(example4)

se.fixef(example4)


[[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] Drawing functions on Cartesian coordinate systems

2007-09-28 Thread Paul Smith
Dear All,

Can R draw plots of functions on a Cartesian coordinate system with
axes like the ones shown at

http://en.wikipedia.org/wiki/Image:Cartesian-coordinate-system-with-circle.svg

?

I have already searched the R web-site, but found nothing.

Thanks in advance,

Paul

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Graphics and LaTeX documents with the same font

2007-09-28 Thread hadley wickham
> Yes there is harm.  But to make bold lines, easy to read titles is fine.
>   See the spar function in
> http://biostat.mc.vanderbilt.edu/SgraphicsHints for a starter.  Also see
> the setps, ps.slide, and setpdf functions in the Hmisc package.

I was interested to see that you have code for drawing scatterplots
with multiple y-axes.  As far as I know the only legitimate use for a
double-axis plot is to confuse or mislead the reader (and this is not
a very ethical use case).  Perhaps you have a counter-example?

Hadley

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

2007-09-28 Thread Jeffrey Robert Spies
> The next problem for me is now to deal with the NAs. I thought  
> perhaps it is possible to exclude the variable from the row  
> comparison if in one of the rows is an NA?

If you exclude the NAs in one dataset, you'll need to exclude the  
exact same row in the other dataset.  The question to ask here is:   
qualitatively, is a row of NAs and a row of binary values completely  
dissimilar?  I assumed so in my first specification of the solution,  
but perhaps that is not the case.  And what about a row with just one  
NA.  Do you exclude the whole row, impute a value, or count it in  
your measure of dissimilarity.  You could also choose to penalize NAs  
more than a mismatch, if you'd like.  This all depends on your data.

> Furthermore it would be useful than to divide the resulting number  
> by the number of used variables for the comparison to get back a  
> number between 0 and 1.

One nice thing about creating a dissimilar function and using apply,  
is that we only need to alter that function:

dissimilar <- function(tRow){
length(tRow[tRow==FALSE])/length(tRow)
}

You wanted to divide the number of FALSEs by the number of variables  
in the comparison, hence dividing tRow[tRow==FALSE]) by length 
(tRow).  Remember, tRow is each row of the comparison passed from apply.

> Unfortunately I am able to understand what happens if somebody  
> gives me the code but I am not able at the moment to write it by  
> myself. I hope this will change by and by.

The more examples you see and play with, the more you'll understand.

> So I would be very pleased if you could help me once again.
>
> Greetings
>
> Birgit

Cheers,

Jeff.

>
> Am 28.09.2007 um 18:25 schrieb Jeffrey Robert Spies:
>
>> Not sure how you want to handle the NAs, but you could try the
>> following:
>>
>> #start
>> MalVar29_37 <- read.table(textConnection("V1 V2 V3 V4 V5 V6 V7 V8 V9
>> 0  0  0  0  0  1  0  0  0
>> 0  0  0  0  0  1  0  0  0
>> 0  0  0  0  0  1  0  0  0
>> NA NA NA NA NA NA NA NA NA
>> 0  1  0  0  0  1  0  0  0"), header=TRUE)
>>
>> FemVar29_37 <- read.table(textConnection(" V1 V2 V3 V4 V5 V6 V7
>> V8 V9
>> 1  1  0  0  0  0  0  0  0
>> 0  1  0  0  1  1  0  0  0
>> 1  0  0  1  0  0  0  0  0
>> 0  1  0  0  1  0  0  0  0
>> 0  1  0  0  0  0  0  0  0"), header=TRUE)
>>
>> comparison <- MalVar29_37 == FemVar29_37
>>
>> dissimilar <- function(tRow){
>>  length(tRow[tRow==FALSE])
>> }
>>
>> dissimilarity <- apply(comparison, c(1), dissimilar)
>> dissimilarity
>> # finish
>>
>> Variable comparison is an entry by entry comparison, resulting in
>> values of TRUE or FALSE.  I've defined a function dissimilar as the
>> number of FALSEs in a given object (tRow).  Variable dissimilarity is
>> then the application of this dissimilar function for each row of
>> comparison.  In this example, 0 means all of the entries in a row
>> matche, 9 means none of them matched.  You can see the solution here
>> in recipe form: http://www.r-cookbook.com/node/40
>>
>> Hope this helps,
>>
>> Jeff.
>>
>> On Sep 28, 2007, at 11:13 AM, Birgit Lemcke wrote:
>>
>>> Hello!
>>>
>>> I am R beginner and I have a question obout a simple matching.
>>>
>>> I have to datasets that i read in with:
>>>
>>> MalVar29_37<-read.table("MalVar29_37.csv", sep = ";")
>>> FemVar29_37<-read.table("FemVar29_37.csv", sep = ";")
>>>
>>> They look like this and show binary variables:
>>>
>>>  V1 V2 V3 V4 V5 V6 V7 V8 V9
>>> 10  0  0  0  0  1  0  0  0
>>> 20  0  0  0  0  1  0  0  0
>>> 30  0  0  0  0  1  0  0  0
>>> 4   NA NA NA NA NA NA NA NA NA
>>> 50  1  0  0  0  1  0  0  0
>>>
>>>  V1 V2 V3 V4 V5 V6 V7 V8 V9
>>> 11  1  0  0  0  0  0  0  0
>>> 20  1  0  0  1  1  0  0  0
>>> 31  0  0  1  0  0  0  0  0
>>> 40  1  0  0  1  0  0  0  0
>>> 50  1  0  0  0  0  0  0  0
>>>
>>> each with 348 rows.
>>>
>>> I would like to perform a simple matching but only row 1 compared to
>>> row1, row 2 compared to row 2 (paired)...giving back a number as
>>> dissimilarity for each comparison.
>>>
>>> How can i do that?
>>>
>>> Thanks in advance
>>>
>>> Birgit
>>>
>>>
>>>
>>>
>>> Birgit Lemcke
>>> Institut für Systematische Botanik
>>> Zollikerstrasse 107
>>> CH-8008 Zürich
>>> Switzerland
>>> Ph: +41 (0)44 634 8351
>>> [EMAIL PROTECTED]
>>>
>>>
>>>
>>>
>>>
>>>
>>> [[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.
>
> Birgit Lemcke
> Institut für Systematische Botanik
>

[R] error message from dbConnect, using ROracle

2007-09-28 Thread Muller, John H

I am trying to use ROracle (v 0.5-8) with R on Windows (v 2.5.1)
 
I get an error message when I run the following code
> library(DBI)
> library(ROracle)
> m <- dbDriver("Oracle")
> con <- dbConnect(m, dsn='',   uid='', pwd='')   
Note masked real values with ###
 
The error is on the last statement and the error message is
Error in function (classes, fdef, mtable)  : 
unable to find an inherited method for function "dbConnect", for
signature "OraDriver"

I searched some of the R help archives and found a post by someone else
with the same problem
  but did not see any responses.
I am somewhat new to DBI so not sure where to look to try to find the
cause of the error.
Trying to use DBI and ROracle because I want to try out some of the big
data handling features of SqLiteDF.
 
Any help you can offer would be greatly appreciated.
 
Thanks and best regards,
 
- john muller

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

2007-09-28 Thread Giusy

Hello,
I'm starting with data analysis with R, and I'd like to know if there is in
any package a function to have price elasticity of an item.
For example I have information about sale quantity and price, and I want to
know if the series is sensitive to the price.
Sale Quantity   Price
34  4$
23  4$
46  5$
21  5$
46  5$
...  ...
So I have 2 time series..I think about correlation function, but I'm
wondering if there is a more specific function.
Thank you very much
Giusy
-- 
View this message in context: 
http://www.nabble.com/Elasticity-tf4535801.html#a12944924
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] RMySQL NA/NULL value storage error

2007-09-28 Thread Chris Stubben


Adam Wilson-4 wrote:
> 
> I am running R 2.5.1, RMySQL 0.6 , and DBI 0.2-3 on Windows XP
> 
> Like others, I am having trouble with NA/Null value conversions between R
> and a MySQL database via DBI, but I could not find my exact problem in the
> archives.  Most of the time NA values in R get transferred correctly to
> the
> database and back again, unless (apparently) if they are in the last
> column
> of the table being saved.
> 

I have the R 2.5.0, RMySQL 0.6 , and DBI 0.2-3 on Linux and don't get this
problem.

What do you get running 

>  str(x)

>  dbGetQuery(test,"describe x")
   Field   Type Null Key Default Extra
 1X1 double  YES
 2X2 double  YES
 3X3 double  YES
 4X4 double  YES

>  dbGetInfo(test)$serverVersion
 [1] "5.0.41"


Chris


-- 
View this message in context: 
http://www.nabble.com/RMySQL-NA-NULL-value-storage-error-tf4531309.html#a12943167
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] Graphics and LaTeX documents with the same font

2007-09-28 Thread Paul Smith
On 9/28/07, Frank E Harrell Jr <[EMAIL PROTECTED]> wrote:
> >> I know how to export graphics as pdf files and then how to include
> >> them in LaTeX documents. However, I do not know how to do in
> >> order to
> >> have the text of the graphics written with the font selected for the
> >> LaTeX document. Is that possible?
> > [...]
> >>> If you don't mind an extra step between R and LaTeX, you could use
> >>> Inkscape to modify your graphics:
> >>> http://www.inkscape.org/
> >>> It is a (very nice!) vector graphics editor which:
> >>> - works with SVGs (as produced with the RSvgDevice package)
> >>> - imports PDFs (really well in the latest development version)
> >>> - is available for free, on most platforms
> >>> and
> >>> - exports PDFs that nicely integrate in LaTeX documents
> >>> - exports PSTricks graphics
> >>> Then two roads are opened for you:
> >>> 1- either get a TTF version of the LaTeX fonts (there are packages
> >>> for this on all linux distros I know, for use with Lyx and you can
> >>> probably find them on the web otherwise) and change all the fonts to
> >>> those once your document is in Inkscape (select all > text and font
> >>> >  select the font)
> >>> 2- or open the document with inkscape and export it to pstricks
> >>> I personally use Inkscape on all my R graphics because I find it
> >>> easier and quicker to get decent graphics and R and refine their
> >>> look  in Inkscape than to get them perfect in R in one shot ( though
> >>> with  ggplot2 things are improving on R's side).
> >
> >> As this works against principles of reproducible research, I wouldn't
> >> recommend it.
> >
> > Do you consider that changing the font size of the graphic would be
> > altering the research result? Or laying out a 2d contour and a 3d plot
>
> Not per se, but accidents happen when editing graphics.  More
> importantly it creates more work.  Datasets get updated/corrected and
> graphics need to be reproduced.
>
> > in parallel, or changing the line color/pattern...? My modifications are
> > usually of this kind. Of course those things are doable with R but they
> > are usually immensely easier in a graphics program (where the color
> > palettes are predefined, the dash patterns are more diverse etc.).
> >
> > For example, I often find myself using the same plot in an article, a
> > presentation, and a poster, usually with different color palettes and
> > font requirements. I just open the pdf, change the colors, font and font
> > size to match the design of the article/presentation/poster, realign the
> > labels a bit and re-save it. I don't think that I am doing any harm to
> > my result or present any false information to the readers, I just make
> > the graphics easier on their eyes.
>
> A great application for a wrapper graphics function with an argument for
> presentation mode.
>
> >
> > But maybe I am a bit too much of a purist on these maters. I just find
> > that, much too often, research results that represent months of work are
> > presented as narrow, black and white (possibly even pixallated!)
> > captures of article graphics which don't do justice to the quality of
> > the work behind them. I don't think there is any harm in making (good)
> > science look a bit "sexier", do you?
>
> Yes there is harm.  But to make bold lines, easy to read titles is fine.
>   See the spar function in
> http://biostat.mc.vanderbilt.edu/SgraphicsHints for a starter.  Also see
> the setps, ps.slide, and setpdf functions in the Hmisc package.

Thanks to all for your thoughts and ideas.

Paul

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Graphics and LaTeX documents with the same font

2007-09-28 Thread Paul Smith
On 9/28/07, Prof Brian Ripley <[EMAIL PROTECTED]> wrote:
> > I know how to export graphics as pdf files and then how to include
> > them in LaTeX documents. However, I do not know how to do in order to
> > have the text of the graphics written with the font selected for the
> > LaTeX document. Is that possible?
>
> Well, it depends on what that font is.  But if it is TeX font,
> see the section called 'TeX fonts' in ?postscript and the detailed
> description in the article in R-news 6/2 by Paul Murrell and myself.
>
> If it is an Adobe Type1 font such as Times New Roman, just specify an
> appropriate family in the pdf() call.
>
> Dietrich Trenkler wrote:
>
> > maybe you will find the psfrag package useful.
>
> I doubt it will be even usable with PDF (there are pdfrack and Xfigfrag,
> though), and with postscript it is at best a kludge as R does its own
> micro-positioning of text based on the font metrics.

Thanks to both. PSTricks

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

draws figures that, when inserted in a LaTeX document, their font
matches the one selected for the LaTeX document. If I may, I would
like to submit to your consideration the suggestion of implementing
the exportation of R graphics to PSTricks.

Paul

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

2007-09-28 Thread Erich Neuwirth
According to the docs package e1071 has kurtosis.

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

2007-09-28 Thread John Kane

--- Samuel Okoye <[EMAIL PROTECTED]> wrote:

> Hello,
>
>   if we suppose that
>
>   times <- c("2006-05-14", "2006-06-12",
> "2006-06-12", "2006-05-14", "2006-05-14",
> "2006-06-12")
>   value <- c(2,3,1,4,3,1)
>
>   then with
>
>   plot(times, value)

Have you tried this?

I think you mean
boxplot( value ~ times)
>
>   we have two boxplots in one graph for 2006-05-14
> and 2006-06-12 respectively! Is it possible to have
> them in a scatterplot? 

I don't see how since time is a character variable.
However if you do 
times <- as.Date (c("2006-05-14", "2006-06-12",
 "2006-06-12", "2006-05-14", "2006-05-14",
 "2006-06-12")) 
then you can. 
> and if I sort the data as
>
>   x <- data.frame(times, value)
>   x <- x[order(times),]
>
>   Is it possible to create a new variable which
> contains 1 for 2006-05-14 and 2 for 2006-06-12?
>
y <-  ifelse(x[,1]=="2006-05-14", 1 , 2)
 x <- cbind(x,y) ; x

It was not clear exactly what you wanted to plot so
this may be closer to what you wanted than converting
to as.Date and ploting


 plot(x[,3],x[,2], col="red",xaxt="n", xlab="times",
ylab="value")
 axis(side=1, at=c(1,2), labels=c("2006-06-12", "2006-06-12"))

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Graphics and LaTeX documents with the same font

2007-09-28 Thread Prof Brian Ripley
On Fri, 28 Sep 2007, Paul Smith wrote:

> Dear All,
>
> I know how to export graphics as pdf files and then how to include
> them in LaTeX documents. However, I do not know how to do in order to
> have the text of the graphics written with the font selected for the
> LaTeX document. Is that possible?

Well, it depends on what that font is.  But if it is TeX font,
see the section called 'TeX fonts' in ?postscript and the detailed 
description in the article in R-news 6/2 by Paul Murrell and myself.

If it is an Adobe Type1 font such as Times New Roman, just specify an 
appropriate family in the pdf() call.

Dietrich Trenkler wrote:

> maybe you will find the psfrag package useful.

I doubt it will be even usable with PDF (there are pdfrack and Xfigfrag, 
though), and with postscript it is at best a kludge as R does its own 
micro-positioning of text based on the font metrics.

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

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


Re: [R] different colors for two wireframes in same plot

2007-09-28 Thread deepayan . sarkar
On 9/27/07, marcg <[EMAIL PROTECTED]> wrote:
> Thanks a lot
>
> This already looks nice and I already checked the ?wireframe, but with no
> examples and as newcommer its hard to find out a correct code.
>
> If we set drape=F in the example:
>
> g <- expand.grid(x = 1:10, y = 5:15, gr = 1:2)
> g$z <- log((g$x^g$g + g$y^2) * g$gr)
> wireframe(z ~ x * y, data = g, groups = gr,
>   scales = list(arrows = FALSE),
>   drape = F, colorkey = TRUE,
>   screen = list(z = 30, x = -60))
>
> you get a two color pic of these layers - and what I'm actually looking for
> is making just the UPPER (toplayer) transparent.

Generally seaking, partially transparent colors can be specified in
the form "#RRGGBBAA" (it's hard to see where to document this in a way
that ``newcomers'' can find -- suggestions welcome). Using this:

wireframe(z ~ x * y, data = g, groups = gr,
  col.groups = c("#00FF", "#FF00FFAA"))

-Deepayan


>
> Thanks for further help
>
> marc
>
>  Original-Nachricht 
> > Datum: Thu, 27 Sep 2007 11:29:19 +0200
> > Von: "Frede Aakmann Tøgersen" <[EMAIL PROTECTED]>
> > An: "marcg" <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
> > Betreff: SV: [R] different colors for two wireframes in same plot
>
> > You can obtain some transparency setting the alpha transparency. This is
> > device dependent though. Using the pdf device you can do this obtaining
> > transparency of both surfaces (the version must be at least 1.4 for
> > semitransparent output to be understood):
> >
> >
> > pdf("test.pdf",version="1.4")
> > wireframe(z ~ x * y, data = g, groups = gr,
> >   scales = list(arrows = FALSE),
> >   drape = TRUE, colorkey = TRUE,
> >   screen = list(z = 30, x = -60),
> >   par.settings = list(regions=list(alpha=0.75)))
> > dev.off()
> >
> > See ?wireframe for the "at, col.regions, alpha.regions" arguments.
> >
> > Does this suffice?
> >
> >
> > Med venlig hilsen
> > Frede Aakmann Tøgersen
> >
> >
> >
> >
> > > -Oprindelig meddelelse-
> > > Fra: [EMAIL PROTECTED]
> > > [mailto:[EMAIL PROTECTED] På vegne af marcg
> > > Sendt: 27. september 2007 09:22
> > > Til: [EMAIL PROTECTED]
> > > Emne: [R] different colors for two wireframes in same plot
> > >
> > > Hello R,
> > >
> > > According to:
> > >
> > > g <- expand.grid(x = 1:10, y = 5:15, gr = 1:2) g$z <-
> > > log((g$x^g$g + g$y^2) * g$gr) wireframe(z ~ x * y, data = g,
> > > groups = gr,
> > >   scales = list(arrows = FALSE),
> > >   drape = TRUE, colorkey = TRUE,
> > >   screen = list(z = 30, x = -60))
> > >
> > > i have two wireframes in one plot.
> > >
> > > How could i change the color of the top - one to transparent
> > > (or only the grid). I want to give insight to the lower layer.
> > >
> > > Could one make an if-statment like (if gr==1 do drape=F or
> > > color=none) if gr=2 do drape=T, colorkey=T)
> > >
> > > Thanks for your help
> > >
> > > Marc
> > >
> > > --
> > > Pt! Schon vom neuen GMX MultiMessenger gehört?
> > > Der kanns mit allen: http://www.gmx.net/de/go/multimessenger
> > >
> > > __
> > > R-help@r-project.org mailing list
> > > https://stat.ethz.ch/mailman/listinfo/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.
>
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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 nice looking lists: how?

2007-09-28 Thread Charles C. Berry
On Fri, 28 Sep 2007, Sergey Goriatchev wrote:

> Hello,
>
> For my functions I want to create output similar in appearance to that
> of what you get when you print a summary of lm model:
>
> Residuals:
>  Min1Q Median3Q   Max
> -0.209209 -0.043133  0.001793  0.044105  0.234750
>
> Coefficients:
> Estimate  Std. Error  t valuePr(>|t|)
> (Intercept)  0.981762   0.004089 240.103  < 2e-16 ***
> Factor 1-0.009581   0.006381  -1.501 0.134296
> Factor 2-0.008993   0.009182  -0.979 0.328163
> Factor 3 0.029960   0.009547   3.138 0.001866 **
> Factor 4-0.026575   0.007370  -3.606 0.000363 ***
> Factor 5-0.004847   0.006382  -0.760 0.448138
> Factor 6 0.005099   0.006483   0.786 0.432202
> ---
> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
>
> I want:
> 1) no $ before the list component names
> 2) component names that take values from outside variables
> (ex.: number <- 10
>   There are 'number' factors in the model:)
>
> There is not much information on how to create nice output in terms of
> lists, so I was looking for core to write the summary(lm) output, but
> could not find much. Obviously, I can type summary.lm, but it does not
> show how to create the name "Coefficients:"

page( stats:::print.summary.lm, 'print' )

is what you want.

It is called when auto-printing class "summary.lm" objects.

Some print methods for summary methods do a lot of calculation, and I 
sometimes find it confusing that those calculations are not included in 
the summary nethod and spend a lot of time searching thru summary.whatnot 
till I wake up and remember to look at print.summary.whatnot.

Chuck

>
> Could someone give me pointers on how to create nice lists?
>
> Thanks
> Sergey
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

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

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


Re: [R] simple matching with R

2007-09-28 Thread Jeffrey Robert Spies
Not sure how you want to handle the NAs, but you could try the  
following:

#start
MalVar29_37 <- read.table(textConnection("V1 V2 V3 V4 V5 V6 V7 V8 V9
0  0  0  0  0  1  0  0  0
0  0  0  0  0  1  0  0  0
0  0  0  0  0  1  0  0  0
NA NA NA NA NA NA NA NA NA
0  1  0  0  0  1  0  0  0"), header=TRUE)

FemVar29_37 <- read.table(textConnection(" V1 V2 V3 V4 V5 V6 V7  
V8 V9
1  1  0  0  0  0  0  0  0
0  1  0  0  1  1  0  0  0
1  0  0  1  0  0  0  0  0
0  1  0  0  1  0  0  0  0
0  1  0  0  0  0  0  0  0"), header=TRUE)

comparison <- MalVar29_37 == FemVar29_37

dissimilar <- function(tRow){
length(tRow[tRow==FALSE])
}

dissimilarity <- apply(comparison, c(1), dissimilar)
dissimilarity
# finish

Variable comparison is an entry by entry comparison, resulting in  
values of TRUE or FALSE.  I've defined a function dissimilar as the  
number of FALSEs in a given object (tRow).  Variable dissimilarity is  
then the application of this dissimilar function for each row of  
comparison.  In this example, 0 means all of the entries in a row  
matche, 9 means none of them matched.  You can see the solution here  
in recipe form: http://www.r-cookbook.com/node/40

Hope this helps,

Jeff.

On Sep 28, 2007, at 11:13 AM, Birgit Lemcke wrote:

> Hello!
>
> I am R beginner and I have a question obout a simple matching.
>
> I have to datasets that i read in with:
>
> MalVar29_37<-read.table("MalVar29_37.csv", sep = ";")
> FemVar29_37<-read.table("FemVar29_37.csv", sep = ";")
>
> They look like this and show binary variables:
>
>  V1 V2 V3 V4 V5 V6 V7 V8 V9
> 10  0  0  0  0  1  0  0  0
> 20  0  0  0  0  1  0  0  0
> 30  0  0  0  0  1  0  0  0
> 4   NA NA NA NA NA NA NA NA NA
> 50  1  0  0  0  1  0  0  0
>
>  V1 V2 V3 V4 V5 V6 V7 V8 V9
> 11  1  0  0  0  0  0  0  0
> 20  1  0  0  1  1  0  0  0
> 31  0  0  1  0  0  0  0  0
> 40  1  0  0  1  0  0  0  0
> 50  1  0  0  0  0  0  0  0
>
> each with 348 rows.
>
> I would like to perform a simple matching but only row 1 compared to
> row1, row 2 compared to row 2 (paired)...giving back a number as
> dissimilarity for each comparison.
>
> How can i do that?
>
> Thanks in advance
>
> Birgit
>
>
>
>
> Birgit Lemcke
> Institut für Systematische Botanik
> Zollikerstrasse 107
> CH-8008 Zürich
> Switzerland
> Ph: +41 (0)44 634 8351
> [EMAIL PROTECTED]
>
>
>
>
>
>
>   [[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] errorbar il lattice plot

2007-09-28 Thread Federico Calboli
Hi Everyone,

I would like to add errorbars to a lattice plot. I already have a function that 
adds error bars to a plot (originally written by George Gilchrist) which takes 
as arguments the coordinates of the point and then the size of the error bar. I 
would like to integrate it in my lattice code but I seem to be stumped.

I can put the error bar function inside my code as if it were a panel function, 
but it then sits there quite unused. I am not even clear how what data object 
to 
put the standard errors for the thing to work...

My code (the version that at least draws a plot):

xyplot(inbreeding~generations|breeds, data = trellisplot, type = 'l', layout = 
c(2,5), col = 'black', lwd = 3,
errbar = function(x, y, err, down = T, width = 0.005, lwd = 1, plot = T, 
colour="black")
{
   up <- y + err
   dn <- y - err
   x.range <- max(x) - min(x)
   wid.lf <- x - (x.range * width)
   wid.rt <- x + (x.range * width)
   if(plot == F) {
 return(data.frame(x, up, dn))
   }
   else {
 if(down == F) {
   segments(x, up, x, y, lwd = lwd, lty = 1, col = colour)
   segments(wid.lf, up, wid.rt, up, lwd = lwd, lty = 1, col = colour)
 }
 else {
   segments(x, up, x, dn, lwd = lwd, lty = 1, col = colour)
   segments(wid.lf, up, wid.rt, up, lwd = lwd, lty = 1, col = colour)
   segments(wid.lf, dn, wid.rt, dn, lwd = lwd, lty = 1, col = colour)
 }
 invisible(data.frame(x, up, dn))
   }
}
)


Regards,

Federico Calboli

-- 
Federico C. F. Calboli
Department of Epidemiology and Public Health
Imperial College, St Mary's Campus
Norfolk Place, London W2 1PG

Tel  +44 (0)20 7594 1602 Fax (+44) 020 7594 3193

f.calboli [.a.t] imperial.ac.uk
f.calboli [.a.t] gmail.com

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


[R] kurtosis

2007-09-28 Thread S Bina
Hi, 

I cannot find the function kurtosis. Is it sth additional I am meant to
download? I use the MacOS X version of R.

Many thanks
Samira

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Converting to mode numeric within a matrix

2007-09-28 Thread R Help
Your problem is that a matrix can't be a mix of data types, but a data
frame can.  Try the following code.

newBest = as.data.frame(best)

Now you can convert the column of numbers in newBest to numbers from
the factors they start as.  Check the help file for data.frame(...)
for more details of how to label correctly.

Sam

On 9/28/07, Sergey Goriatchev <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I create a matrix:
>
> best <- matrix(0, ncol=2, nrow=num.selected,
> dimnames=list(the.best$.Name, c("Probability(%)", "Inside")))
>
> best[,1] <- as.numeric(the.best$Total*100)
>
> best[,2] <- ifelse(the.best$Weight==0, "No", "Yes")
>
> What I want is the second column of mode numeric, but it is of mode
> character, despite the attempt to convert it to numeric with
> as.numeric(). It must have something to do with the second column of
> the matrix, where I write No/Yes.
> What should I do to have the first column of mode numeric?
> Also, how can I output No/Yes in the second column without citation
> marks around them?
>
> Thanks in advance
> Sergey
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/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] Plots with discontinuity balls

2007-09-28 Thread Paul Smith
On 9/28/07, Duncan Murdoch <[EMAIL PROTECTED]> wrote:
> > Can R plot graphs like the one at
> >
> > http://www.mathwords.com/f/f_assets/floor_graph.gif
> >
> > with the balls at the discontinuity points?
>
> You can use segments() to draw the segments and symbols() to draw the
> balls.  For example,
>
> plot(1,1,type='n', xlim=c(1,10), ylim=c(1,10))
> segments(1:9, 1:9, 2:10, 1:9)
> symbols(2:10, 1:9, circles=rep(0.1,9), inches=FALSE, bg="white",add=T)
> symbols(1:9, 1:9, circles=rep(0.1,9), inches=FALSE, bg="black",add=T)
>
> This depends on the order of drawing, because the white background of
> the first circles obscures the ends of the segments.

Thanks, Jim and Duncan. It would help to have transparent backgrounds
for the white balls.

Paul

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

2007-09-28 Thread Philippe Grosjean
Hello Jeff,

Good initiative,... but why not to put this in the official R Wiki 
(http://wiki.r-project.org)? There is a section named 'tips' dedicated 
to such little recipes 
(http://wiki.r-project.org/rwiki/doku.php?id=tips:tips). It should be 
better to centralize all these little tips, don't you think so?

Should you have difficulties to use the Wiki, just tell me, and I will 
help...
Best,

Philippe Grosjean

..<°}))><
  ) ) ) ) )
( ( ( ( (Prof. Philippe Grosjean
  ) ) ) ) )
( ( ( ( (Numerical Ecology of Aquatic Systems
  ) ) ) ) )   Mons-Hainaut University, Belgium
( ( ( ( (
..

Jeff wrote:
> R Community,
> 
> I've put together a website that I thought this mailing list might be  
> interested in: http://www.r-cookbook.com
> 
> It's a (free) community-driven content management system for R  
> "recipes", or working examples.  Some of the features of the site are  
> code highlighting, recipe ratings, recipe comments, personal "recipe  
> boxes" to save your favorite recipes, community tagging, RSS feeds  
> for each user and for each tag, and similar recipe recommendations.
> 
> Although I imagine that many users will sort/search/find recipes by  
> tags, I've implemented a linear organization for recipes as well:  
> guides.  These will be compilations of "recipes", organized in a  
> logical fashion as to promote understanding of the topic of that  
> particular guide and introduced with user-contributed pages.  Over  
> time, hopefully with the help of the community, more guides will be  
> created and the ones I have will be filled-in to actually be useful.   
> I have started several guides to give you an idea of the sort of  
> thing I'm thinking: Introduction to R, Longitudinal Modeling in R,  
> Exploratory Data Analysis in R, and more here, http://www.r- 
> cookbook.com/guide
> 
> A couple of features that will be worked on in the near future are  
> (1) the design of the site and (2) working on a more interactive code  
> display (right now, functions are highlighted and linked to the r- 
> docs, but that's it).
> 
> I hope some of you might find the site useful and perhaps even  
> consider contributing your own recipes.  If you have any suggestions  
> or feature requests, I'd be glad to hear them!
> 
> Jeff.
> 
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/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] plot graph with error bars trouble

2007-09-28 Thread Marcelo Laia
Hi,

I have a data set like this:

MutantRepTime   OD
02H02100.029
02H02200.029
02H02300.023
02H02180.655
02H02280.615
02H02380.557
02H021121.776
02H02212 1.859
02H023121.668
02H021163.379
02H022163.726
02H023163.367
306100.033
306200.035
306300.034
30618 0.377
306280.488
306380.409
3061121.106
3062121.348
3063121.246
3061162.706
3062163.073
3063163.038

I need to plot a graph OD over the time for each one mutant with error bars.

I try the package sciplot, but this package is set up to handle
factorial treatments, so the spacing in x-axis is fixed to be equal.
Than, with it I got something like this:

|
|
|
|
|
+-
08  12  16

But, I would like spacing between 0 and 8 2-fold the spacign between 8
and 12, like this:

|
|
|
|
|
+--
04  8  12  16

Could you point me out another way to do this with out using sciplot?
Any suggestion is very appreciated.

In advance, I doesn't have a good knowledge about R language.

Thank you very much

-- 
Marcelo Luiz de Laia

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Is there a model like that in R?

2007-09-28 Thread Manuel Ramon
Hi to everyone,

 

I am starting to work with a model that is not familiar to me. 

The model would be like that:

 

   y = . - a*max(Q(i) - Q(0), 0) + .

 

where Q(i) is the accumulated effect of a variable at time i and Q(0) a
threshold above it there is effect on y.  The value of Q(i) could be
estimated as:

 

  Q(i+1) = Q(i) + b*max(s(i) - s(0), 0) + c*min(s(i) - s(0), 0) + .

 

Where s would be the effect that produces the accumulate effect of Q, s(i)
would be this effect at time i and s(0) another threshold above it the
accumulative effect is produced. The coefficient b would be the rate of
accumulation and c the rate of decay.

 

What kind of model is it? Is it somewhat similar to time series?

 

I appreciate your help.

 

Manuel Ramon 


[[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] File selection by condition

2007-09-28 Thread Svempa

I have a large number of textfiles, and one matix in every texfile. I now
want to find an easy way to select those textfiles that contain at least one
value over a certain limit, and collect those matrices in a vector or
something alike. How do I do that?

-- 
View this message in context: 
http://www.nabble.com/File-selection-by-condition-tf4534428.html#a12940278
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] Cairo on windows

2007-09-28 Thread Michael Lawrence
On 9/27/07, Moisan Yves <[EMAIL PROTECTED]> wrote:
>
> > My experience is that cairoDevice is a lot slower than Cairo,
> especially
> on Windows, and about equally flaky.  If you see how many layers are
> involved with Cairo on Windows you will not be surprised.
>
> Actually, I ended up trying to load deviceCairo simply because it was
> the only other package with the string "Cairo" in it besides "Cairo"
> itself ;-).  I suspected some interaction between the two libraries
> (deviceCairo and Cairo) so that's why I tried to load it hoping it would
> solve the flakiness of the CairoWin display.


My guess is the problem is due to an older version of GTK+. Although
cairoDevice only requires GTK+ 2.8.x (which is probably what you have
installed), the Windows binary of cairoDevice on CRAN is probably built
against GTK+ 2.10.x, just like RGtk2.

I've added a feature to cairoDevice and RGtk2 recently that will
automatically try to install the latest binary of GTK+ on Mac and Windows
when loading the library fails.

That said, I'd really like to merge cairoDevice (specifically the
RGtk2-embedding feature) with the Cairo package. Having one less package to
maintain would be nice.

> If all you need is semi-transparency support I suggest you try R 2.6.0
> RC
> which supports it in the windows() device.
>
> Thanx for the tip.
>
> Yves Moisan
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/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] Drawing functions on Cartesian coordinate systems

2007-09-28 Thread Charles Annis, P.E.
Yes, R can do that.  Well, actually YOU can do that using R.

But it is hard to believe that you looked very hard before writing.  Did you
look at these R functions?

?plot
?line
?points
?arrows



Charles Annis, P.E.

[EMAIL PROTECTED]
phone: 561-352-9699
eFax:  614-455-3265
http://www.StatisticalEngineering.com
 
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Paul Smith
Sent: Friday, September 28, 2007 1:12 PM
To: r-help
Subject: [R] Drawing functions on Cartesian coordinate systems

Dear All,

Can R draw plots of functions on a Cartesian coordinate system with
axes like the ones shown at

http://en.wikipedia.org/wiki/Image:Cartesian-coordinate-system-with-circle.s
vg

?

I have already searched the R web-site, but found nothing.

Thanks in advance,

Paul

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

2007-09-28 Thread S Ellison
Sorry!
paste(x*100,"%")



>>> Marc Schwartz <[EMAIL PROTECTED]> 27/09/2007 15:56:05 >>>
On Thu, 2007-09-27 at 14:36 +0100, stat stat wrote:
> I am wondering if there is any procedure to write a particular value
> in Percentage format, still maintaining it's numeric character. for
> example I want to write '.33' as '33%' 

See ?sprintf

> sprintf("%.0f%%", .33 * 100)
[1] "33%"


Note that the trailing '%' needs to be doubled to be recognized as the
character and not a format specifier.

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.

***
This email contains information which may be confidential and/or privileged, 
and is intended only for the individual(s) or organisation(s) named above. If 
you are not the intended recipient, then please note that any disclosure, 
copying, distribution or use of the contents of this email is prohibited. 
Internet communications are not 100% secure and therefore we ask that you 
acknowledge this. If you have received this email in error, please notify the 
sender or contact +44(0)20 8943 7000 or [EMAIL PROTECTED] immediately, and 
delete this email and any attachments and copies from your system. Thank you. 

LGC Limited. Registered in England 2991879. 
Registered office: Queens Road, Teddington, Middlesex TW11 0LY, UK
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] simple matching with R

2007-09-28 Thread Birgit Lemcke
Thanks a lot for both solutions of my problem.

I tried it immediately and I understood how they are working.

The next problem for me is now to deal with the NAs. I thought  
perhaps it is possible to exclude the variable from the row  
comparison if in one of the rows is an NA?
Furthermore it would be useful than to divide the resulting number by  
the number of used variables for the comparison to get back a number  
between 0 and 1.

Unfortunately I am able to understand what happens if somebody gives  
me the code but I am not able at the moment to write it by myself. I  
hope this will change by and by.

So I would be very pleased if you could help me once again.

Greetings

Birgit


Am 28.09.2007 um 18:25 schrieb Jeffrey Robert Spies:

> Not sure how you want to handle the NAs, but you could try the
> following:
>
> #start
> MalVar29_37 <- read.table(textConnection("V1 V2 V3 V4 V5 V6 V7 V8 V9
> 0  0  0  0  0  1  0  0  0
> 0  0  0  0  0  1  0  0  0
> 0  0  0  0  0  1  0  0  0
> NA NA NA NA NA NA NA NA NA
> 0  1  0  0  0  1  0  0  0"), header=TRUE)
>
> FemVar29_37 <- read.table(textConnection(" V1 V2 V3 V4 V5 V6 V7
> V8 V9
> 1  1  0  0  0  0  0  0  0
> 0  1  0  0  1  1  0  0  0
> 1  0  0  1  0  0  0  0  0
> 0  1  0  0  1  0  0  0  0
> 0  1  0  0  0  0  0  0  0"), header=TRUE)
>
> comparison <- MalVar29_37 == FemVar29_37
>
> dissimilar <- function(tRow){
>   length(tRow[tRow==FALSE])
> }
>
> dissimilarity <- apply(comparison, c(1), dissimilar)
> dissimilarity
> # finish
>
> Variable comparison is an entry by entry comparison, resulting in
> values of TRUE or FALSE.  I've defined a function dissimilar as the
> number of FALSEs in a given object (tRow).  Variable dissimilarity is
> then the application of this dissimilar function for each row of
> comparison.  In this example, 0 means all of the entries in a row
> matche, 9 means none of them matched.  You can see the solution here
> in recipe form: http://www.r-cookbook.com/node/40
>
> Hope this helps,
>
> Jeff.
>
> On Sep 28, 2007, at 11:13 AM, Birgit Lemcke wrote:
>
>> Hello!
>>
>> I am R beginner and I have a question obout a simple matching.
>>
>> I have to datasets that i read in with:
>>
>> MalVar29_37<-read.table("MalVar29_37.csv", sep = ";")
>> FemVar29_37<-read.table("FemVar29_37.csv", sep = ";")
>>
>> They look like this and show binary variables:
>>
>>  V1 V2 V3 V4 V5 V6 V7 V8 V9
>> 10  0  0  0  0  1  0  0  0
>> 20  0  0  0  0  1  0  0  0
>> 30  0  0  0  0  1  0  0  0
>> 4   NA NA NA NA NA NA NA NA NA
>> 50  1  0  0  0  1  0  0  0
>>
>>  V1 V2 V3 V4 V5 V6 V7 V8 V9
>> 11  1  0  0  0  0  0  0  0
>> 20  1  0  0  1  1  0  0  0
>> 31  0  0  1  0  0  0  0  0
>> 40  1  0  0  1  0  0  0  0
>> 50  1  0  0  0  0  0  0  0
>>
>> each with 348 rows.
>>
>> I would like to perform a simple matching but only row 1 compared to
>> row1, row 2 compared to row 2 (paired)...giving back a number as
>> dissimilarity for each comparison.
>>
>> How can i do that?
>>
>> Thanks in advance
>>
>> Birgit
>>
>>
>>
>>
>> Birgit Lemcke
>> Institut für Systematische Botanik
>> Zollikerstrasse 107
>> CH-8008 Zürich
>> Switzerland
>> Ph: +41 (0)44 634 8351
>> [EMAIL PROTECTED]
>>
>>
>>
>>
>>
>>
>>  [[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.

Birgit Lemcke
Institut für Systematische Botanik
Zollikerstrasse 107
CH-8008 Zürich
Switzerland
Ph: +41 (0)44 634 8351
[EMAIL PROTECTED]






[[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] Expressing number in percentage

2007-09-28 Thread S Ellison
Or paste(x,"%")



>>> Marc Schwartz <[EMAIL PROTECTED]> 27/09/2007 15:56:05 >>>
On Thu, 2007-09-27 at 14:36 +0100, stat stat wrote:
> I am wondering if there is any procedure to write a particular value
> in Percentage format, still maintaining it's numeric character. for
> example I want to write '.33' as '33%' 

See ?sprintf

> sprintf("%.0f%%", .33 * 100)
[1] "33%"


Note that the trailing '%' needs to be doubled to be recognized as the
character and not a format specifier.

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.

***
This email contains information which may be confidential and/or privileged, 
and is intended only for the individual(s) or organisation(s) named above. If 
you are not the intended recipient, then please note that any disclosure, 
copying, distribution or use of the contents of this email is prohibited. 
Internet communications are not 100% secure and therefore we ask that you 
acknowledge this. If you have received this email in error, please notify the 
sender or contact +44(0)20 8943 7000 or [EMAIL PROTECTED] immediately, and 
delete this email and any attachments and copies from your system. Thank you. 

LGC Limited. Registered in England 2991879. 
Registered office: Queens Road, Teddington, Middlesex TW11 0LY, UK
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] plot or boxplot!

2007-09-28 Thread Uwe Ligges


Samuel Okoye wrote:
> Hello,
>
>   if we suppose that
>
>   times <- c("2006-05-14", "2006-06-12", "2006-06-12", "2006-05-14", 
> "2006-05-14", "2006-06-12")
>   value <- c(2,3,1,4,3,1)
>
>   then with
>
>   plot(times, value)
>
>   we have two boxplots in one graph for 2006-05-14 and 2006-06-12 
> respectively! Is it possible to have them in a scatterplot? and if I sort the 
> data as
>
>   x <- data.frame(times, value)
>   x <- x[order(times),]
>
>   Is it possible to create a new variable which contains 1 for 2006-05-14 and 
> 2 for 2006-06-12?


If you not also want to make it some time/date object, you can simply it 
a factor, hence type

times <- factor(times)

Uwe Ligges


>   Thank you very much in advance!
> 
> 
>
> -
> Luggage? GPS? Comic books? 
> 
>   [[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] ELF file OS ABI invalid yes?????

2007-09-28 Thread Peter Dalgaard
vittorio wrote:
> Compilation of MCMCpack under freebsd 6.2 i386 fails because of the following 
> cryptic error: 
>
> * Installing *source* package 'MCMCpack' ...
> checking for C++ compiler default output file name... a.out
> checking whether the C++ compiler works... yes
> checking whether we are cross compiling... no
> checking for suffix of executables...
> checking for suffix of object files... o
> checking whether we are using the GNU C++ compiler... grep: error while 
> loading shared libraries: /usr/local/lib/libpcre.so.0: ELF file OS ABI 
> invalid
> yes
> checking whether c++ accepts -g... grep: error while loading shared 
> libraries: /usr/local/lib/libpcre.so.0: ELF file OS ABI invalid
> yes
>
> What should I do?
>   
First check whether this has anything to do with R at all.

Does grep work from the command line? Looks like it is picking up a
shared library in /usr/local/lib, which is not valid.  Googling for the
error message ("yes" is not part of it) suggests that this happens if
you run something under Linux emulation but pick up a native BSD
library, which in turn suggest that your path to binaries and/or
libraries might be messed up. Does this ring any bells?

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

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


Re: [R] Graphics and LaTeX documents with the same font

2007-09-28 Thread Frank E Harrell Jr
jiho wrote:
> 
> On 2007-September-28  , at 16:57 , Frank E Harrell Jr wrote:
>> jiho wrote:
>>> On 2007-September-28  , at 15:18 , Paul Smith wrote:
 On 9/28/07, Prof Brian Ripley <[EMAIL PROTECTED]> wrote:
>> I know how to export graphics as pdf files and then how to include
>> them in LaTeX documents. However, I do not know how to do in  
>> order to
>> have the text of the graphics written with the font selected for the
>> LaTeX document. Is that possible?
> [...]
>>> If you don't mind an extra step between R and LaTeX, you could use  
>>> Inkscape to modify your graphics:
>>> http://www.inkscape.org/
>>> It is a (very nice!) vector graphics editor which:
>>> - works with SVGs (as produced with the RSvgDevice package)
>>> - imports PDFs (really well in the latest development version)
>>> - is available for free, on most platforms
>>> and
>>> - exports PDFs that nicely integrate in LaTeX documents
>>> - exports PSTricks graphics
>>> Then two roads are opened for you:
>>> 1- either get a TTF version of the LaTeX fonts (there are packages  
>>> for this on all linux distros I know, for use with Lyx and you can  
>>> probably find them on the web otherwise) and change all the fonts to  
>>> those once your document is in Inkscape (select all > text and font 
>>> >  select the font)
>>> 2- or open the document with inkscape and export it to pstricks
>>> I personally use Inkscape on all my R graphics because I find it  
>>> easier and quicker to get decent graphics and R and refine their 
>>> look  in Inkscape than to get them perfect in R in one shot ( though 
>>> with  ggplot2 things are improving on R's side).
> 
>> As this works against principles of reproducible research, I wouldn't 
>> recommend it.
> 
> Do you consider that changing the font size of the graphic would be 
> altering the research result? Or laying out a 2d contour and a 3d plot 

Not per se, but accidents happen when editing graphics.  More 
importantly it creates more work.  Datasets get updated/corrected and 
graphics need to be reproduced.

> in parallel, or changing the line color/pattern...? My modifications are 
> usually of this kind. Of course those things are doable with R but they 
> are usually immensely easier in a graphics program (where the color 
> palettes are predefined, the dash patterns are more diverse etc.).
> 
> For example, I often find myself using the same plot in an article, a 
> presentation, and a poster, usually with different color palettes and 
> font requirements. I just open the pdf, change the colors, font and font 
> size to match the design of the article/presentation/poster, realign the 
> labels a bit and re-save it. I don't think that I am doing any harm to 
> my result or present any false information to the readers, I just make 
> the graphics easier on their eyes.

A great application for a wrapper graphics function with an argument for 
presentation mode.

> 
> But maybe I am a bit too much of a purist on these maters. I just find 
> that, much too often, research results that represent months of work are 
> presented as narrow, black and white (possibly even pixallated!) 
> captures of article graphics which don't do justice to the quality of 
> the work behind them. I don't think there is any harm in making (good) 
> science look a bit "sexier", do you?

Yes there is harm.  But to make bold lines, easy to read titles is fine. 
  See the spar function in 
http://biostat.mc.vanderbilt.edu/SgraphicsHints for a starter.  Also see 
the setps, ps.slide, and setpdf functions in the Hmisc package.

Cheers
Frank

> 
> Jean-Olivier Irisson
> ---
> UMR 5244 CNRS-EPHE-UPVD, 52 av Paul Alduy, 66860 Perpignan Cedex, France
> +336 21 05 19 90
> http://jo.irisson.free.fr/work/
> 


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

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


[R] transparency of one layer in multiple wireframe plot

2007-09-28 Thread mdgi
Sorry sending this again - is anyone familiar with multiple transparent 
wireframe plots?

I already checked the ?wireframe, but with no examples and as newcommer its 
hard to find out a correct code.

If we set drape=F in the example:

g <- expand.grid(x = 1:10, y = 5:15, gr = 1:2)
g$z <- log((g$x^g$g + g$y^2) * g$gr)
wireframe(z ~ x * y, data = g, groups = gr,
  scales = list(arrows = FALSE),
  drape = F, colorkey = TRUE,
  screen = list(z = 30, x = -60))

you get a two color pic of these layers - and what I'm actually looking for is 
making just the UPPER (toplayer) transparent.

Thanks for further help

marc

 Original-Nachricht 
> Datum: Thu, 27 Sep 2007 11:29:19 +0200
> Von: "Frede Aakmann Tøgersen" <[EMAIL PROTECTED]>
> An: "marcg" <[EMAIL PROTECTED]>, [EMAIL PROTECTED]
> Betreff: SV: [R] different colors for two wireframes in same plot

> You can obtain some transparency setting the alpha transparency. This is
> device dependent though. Using the pdf device you can do this obtaining
> transparency of both surfaces (the version must be at least 1.4 for
> semitransparent output to be understood):
> 
> 
> pdf("test.pdf",version="1.4")
> wireframe(z ~ x * y, data = g, groups = gr,
>   scales = list(arrows = FALSE),
>   drape = TRUE, colorkey = TRUE,
>   screen = list(z = 30, x = -60),
>   par.settings = list(regions=list(alpha=0.75)))
> dev.off()
> 
> See ?wireframe for the "at, col.regions, alpha.regions" arguments.
> 
> Does this suffice?
> 
> 
> Med venlig hilsen
> Frede Aakmann Tøgersen
>  
> 
>  
> 
> > -Oprindelig meddelelse-
> > Fra: [EMAIL PROTECTED] 
> > [mailto:[EMAIL PROTECTED] På vegne af marcg
> > Sendt: 27. september 2007 09:22
> > Til: [EMAIL PROTECTED]
> > Emne: [R] different colors for two wireframes in same plot
> > 
> > Hello R,
> > 
> > According to:
> > 
> > g <- expand.grid(x = 1:10, y = 5:15, gr = 1:2) g$z <- 
> > log((g$x^g$g + g$y^2) * g$gr) wireframe(z ~ x * y, data = g, 
> > groups = gr,
> >   scales = list(arrows = FALSE),
> >   drape = TRUE, colorkey = TRUE,
> >   screen = list(z = 30, x = -60))
> > 
> > i have two wireframes in one plot.
> > 
> > How could i change the color of the top - one to transparent 
> > (or only the grid). I want to give insight to the lower layer.
> > 
> > Could one make an if-statment like (if gr==1 do drape=F or 
> > color=none) if gr=2 do drape=T, colorkey=T)
> > 
> > Thanks for your help
> > 
> > Marc
> > 
> > --
> > Pt! Schon vom neuen GMX MultiMessenger gehört?
> > Der kanns mit allen: http://www.gmx.net/de/go/multimessenger
> > 
> > __
> > R-help@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/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.

-- 
Pt! Schon vom neuen GMX MultiMessenger gehört?
Der kanns mit allen: http://www.gmx.net/de/go/multimessenger

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Graphics and LaTeX documents with the same font

2007-09-28 Thread Dietrich Trenkler
Paul Smith schrieb:
> Dear All,
>
> I know how to export graphics as pdf files and then how to include
> them in LaTeX documents. However, I do not know how to do in order to
> have the text of the graphics written with the font selected for the
> LaTeX document. Is that possible?
>
> Thanks in advance,
>
> Paul
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
>   
Hi Paul,

maybe you will find the psfrag package useful.

Dietrich

-- 
Dietrich Trenkler c/o Universitaet Osnabrueck 
Rolandstr. 8; D-49069 Osnabrueck, Germany
email: [EMAIL PROTECTED]

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


Re: [R] Password-protect script files

2007-09-28 Thread S Ellison
> Is there any way to password-protect script files (either within R or
> otherwise)?

The question seemed to me to be more about password protection against 
modification, rather than encryption.

I'd have thought this was something a decent OS could take care of. It seems as 
daft to try to get a stats package to manage security well as to get a security 
package to manage stats. Especially an open source research package!
Under Unix it's easy; mark the files read-only for users and read-write for 
'r-editors' (or put them in a directory with those properties).
Under windows, stick the scripts in a shared folder with password-protected 
read-only access.

But better still, tie the whole lot up in a package and put the package under 
proper version control, so that users simply load the package and script 
editors act within formal change control. If you really want the stuff 
protected and encrypted as well, the package could decrypt on the fly as part 
of the function call (.


>>> Marc Schwartz <[EMAIL PROTECTED]> 26/09/2007 22:00:44 >>>
You might want to review this thread:

  http://thread.gmane.org/gmane.comp.lang.r.general/94290/ 

which covers perhaps a similar concern.

You can ignore my first reply, which covers protecting all files by
encrypting an entire partition, not just the R code file.

If that is not helpful, we will need to gain further insight into your
functional requirements.

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.

***
This email contains information which may be confidential and/or privileged, 
and is intended only for the individual(s) or organisation(s) named above. If 
you are not the intended recipient, then please note that any disclosure, 
copying, distribution or use of the contents of this email is prohibited. 
Internet communications are not 100% secure and therefore we ask that you 
acknowledge this. If you have received this email in error, please notify the 
sender or contact +44(0)20 8943 7000 or [EMAIL PROTECTED] immediately, and 
delete this email and any attachments and copies from your system. Thank you. 

LGC Limited. Registered in England 2991879. 
Registered office: Queens Road, Teddington, Middlesex TW11 0LY, UK
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Barnard's exact test

2007-09-28 Thread João Fadista
Dear all,
 
I would like to know if there is any R package that has the Barnard´s exact 
test. I also like to have any opinions about which test is more powerful: 
Fisher´s exact test or Barnard´s exact test. 

 
Best regards

João Fadista
Ph.d. student



 UNIVERSITY OF AARHUS   
Faculty of Agricultural Sciences
Dept. of Genetics and Biotechnology 
Blichers Allé 20, P.O. BOX 50   
DK-8830 Tjele   

Phone:   +45 8999 1900  
Direct:  +45 8999 1900  
E-mail:  [EMAIL PROTECTED]    
Web: www.agrsci.org 


News and news media  .

This email may contain information that is confidential. Any use or publication 
of this email without written permission from Faculty of Agricultural Sciences 
is not allowed. If you are not the intended recipient, please notify Faculty of 
Agricultural Sciences immediately and delete this email.


[[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] ELF file OS ABI invalid yes?????

2007-09-28 Thread Rainer Hurling
Hello Vittorio,

I am running FreeBSD 7.0-CURRENT (i386) from yesterday and I am able to 
compile MCMCpack_0.9-1.tar.gz without any problem on R-2.6.0 RC 
(2007-09-27 r43002).

Native FreeBSD devel/pcre-7.3 and lang/gcc42 packages are installed. 
Please look if your library versions are ok.

Regards,
Rainer


vittorio schrieb:
> Compilation of MCMCpack under freebsd 6.2 i386 fails because of the following 
> cryptic error: 
> 
> * Installing *source* package 'MCMCpack' ...
> checking for C++ compiler default output file name... a.out
> checking whether the C++ compiler works... yes
> checking whether we are cross compiling... no
> checking for suffix of executables...
> checking for suffix of object files... o
> checking whether we are using the GNU C++ compiler... grep: error while 
> loading shared libraries: /usr/local/lib/libpcre.so.0: ELF file OS ABI 
> invalid
> yes
> checking whether c++ accepts -g... grep: error while loading shared 
> libraries: /usr/local/lib/libpcre.so.0: ELF file OS ABI invalid
> yes
> 
> What should I do?
> 
> Ciao
> Vittorio

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

2007-09-28 Thread deepayan . sarkar
On 9/28/07, Federico Calboli <[EMAIL PROTECTED]> wrote:
> Hi Everyone,
>
> I would like to add errorbars to a lattice plot. I already have a function
> that
> adds error bars to a plot (originally written by George Gilchrist) which
> takes
> as arguments the coordinates of the point and then the size of the error
> bar. I
> would like to integrate it in my lattice code but I seem to be stumped.
>
> I can put the error bar function inside my code as if it were a panel
> function,
> but it then sits there quite unused. I am not even clear how what data
> object to
> put the standard errors for the thing to work...

I'm not sure why you expect anything to happen. Your 'errbar' argument
gets passed to the panel function panel.xyplot, but of course it knows
nothing about any such argument and ignores it. Even if you manage to
get 'errbar' executed, it's not clear where the 'err' values are going
to come from. Finally, for a lattice panel function, you need to
replace segments() by panel.segments(), etc.

Lattice does contain a demo showing how to draw confidence intervals; see

file.show(system.file("demo/intervals.R", package = "lattice"))

There have been a couple of follow up messages dealing with how to
extend this to grouped displays; these are found easily by an online
search.

-Deepayan

>
> My code (the version that at least draws a plot):
>
> xyplot(inbreeding~generations|breeds, data = trellisplot, type = 'l', layout
> =
> c(2,5), col = 'black', lwd = 3,
> errbar = function(x, y, err, down = T, width = 0.005, lwd = 1, plot = T,
> colour="black")
> {
>up <- y + err
>dn <- y - err
>x.range <- max(x) - min(x)
>wid.lf <- x - (x.range * width)
>wid.rt <- x + (x.range * width)
>if(plot == F) {
>  return(data.frame(x, up, dn))
>}
>else {
>  if(down == F) {
>segments(x, up, x, y, lwd = lwd, lty = 1, col = colour)
>segments(wid.lf, up, wid.rt, up, lwd = lwd, lty = 1, col = colour)
>  }
>  else {
>segments(x, up, x, dn, lwd = lwd, lty = 1, col = colour)
>segments(wid.lf, up, wid.rt, up, lwd = lwd, lty = 1, col = colour)
>segments(wid.lf, dn, wid.rt, dn, lwd = lwd, lty = 1, col = colour)
>  }
>  invisible(data.frame(x, up, dn))
>}
> }
> )
>
>
> Regards,
>
> Federico Calboli
>
> --
> Federico C. F. Calboli
> Department of Epidemiology and Public Health
> Imperial College, St Mary's Campus
> Norfolk Place, London W2 1PG
>
> Tel  +44 (0)20 7594 1602 Fax (+44) 020 7594 3193
>
> f.calboli [.a.t] imperial.ac.uk
> f.calboli [.a.t] gmail.com
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

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


Re: [R] RMySQL installing problems

2007-09-28 Thread Prof Brian Ripley
You do need the RMySQL client DLLs in your PATH.  Also make sure that your 
MySQL version is not one listed as problematic at

http://www.stats.ox.ac.uk/pub/RWin/ReadMe

On Fri, 28 Sep 2007, andreiabb wrote:

>
> Dear forum,
>
> I'm trying to install RMySQL but I'm having problems in loading it, here is
> the message that I'm getting in R
> install.packages("RMySQL", dependencies=TRUE)
> trying URL
> 'http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/2.5/RMySQL_0.6-0.zip'
> Content type 'application/zip' length 391364 bytes
> opened URL
> downloaded 382Kb
>
> package 'RMySQL' successfully unpacked and MD5 sums checked
>
> The downloaded packages are in
>C:\TEMP\RtmpqsmLsb\downloaded_packages
> updating HTML package descriptions
>
>> local({pkg <- select.list(sort(.packages(all.available = TRUE)))
> + if(nchar(pkg)) library(pkg, character.only=TRUE)})
> Error in dyn.load(x, as.logical(local), as.logical(now)) :
>unable to load shared library
> 'C:/PROGRA~1/R/R-25~1.1/library/RMySQL/libs/RMySQL.dll':
>  LoadLibrary failure:  The specified module could not be found.
>
>
> Error: package/namespace load failed for 'RMySQL'
>
>
> Can someone give me a tip?
>
> Thanks
>
> Regards
>
> Andreia Fonseca
>
> PhD candidate
> Wageningen University
>
> Animal Breeding and Genomics Centre
>
>Marijkweg 40
>
>P.O. Box 338
>
>6700 AH Wageningen
>
>  Tel: +31 (0)  317483194
>
>
>

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

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


Re: [R] Plots with discontinuity balls

2007-09-28 Thread Paul Smith
On 9/28/07, Duncan Murdoch <[EMAIL PROTECTED]> wrote:
> >>> Can R plot graphs like the one at
> >>>
> >>> http://www.mathwords.com/f/f_assets/floor_graph.gif
> >>>
> >>> with the balls at the discontinuity points?
> >>>
> >> You can use segments() to draw the segments and symbols() to draw the
> >> balls.  For example,
> >>
> >> plot(1,1,type='n', xlim=c(1,10), ylim=c(1,10))
> >> segments(1:9, 1:9, 2:10, 1:9)
> >> symbols(2:10, 1:9, circles=rep(0.1,9), inches=FALSE, bg="white",add=T)
> >> symbols(1:9, 1:9, circles=rep(0.1,9), inches=FALSE, bg="black",add=T)
> >>
> >> This depends on the order of drawing, because the white background of
> >> the first circles obscures the ends of the segments.
> >>
> >
> > Thanks, Jim and Duncan. It would help to have transparent backgrounds
> > for the white balls.
> >
> Then it's even easier:  just use points(), with pch=1, e.g.
>
> plot(1,1,type='n', xlim=c(1,10), ylim=c(1,10))
> segments(1:9, 1:9, 2:10, 1:9)
> points(2:10, 1:9, pch=1, cex=2)
> points(1:9, 1:9, pch=16, cex=2)

Thanks, Duncan. That is a nice solution.

Paul

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

2007-09-28 Thread Duncan Murdoch
On 9/28/2007 11:20 AM, Abu Naser wrote:
> Hi All user,
> 
> I have been using R-2.5.1. dose orientlib support this version? I would like 
> to try. it.
> I have been wondering how to install the library.

As far as I know it is fine.  You install it as you would install any 
other package, but that depends on what platform you're using.  If 
you're using Windows, the easiest way is to use the "Packages | Install 
packages..." menu item.

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] Drawing functions on Cartesian coordinate systems

2007-09-28 Thread Greg Snow
I think he wants the axes crossing at 0,0 not on the outer edges like
the default.

You can put the axes in the plot (though it tends to distract rather
than help in many cases) by:

> axis(1, pos=0)
> axis(2, pos=0)

You will need to draw the arrowheads yourself.  There are options (under
?par) for tick length and how to suppress the default axes.

Hope this helps,

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

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Charles Annis, P.E.
> Sent: Friday, September 28, 2007 11:32 AM
> To: 'Paul Smith'; 'r-help'
> Subject: Re: [R] Drawing functions on Cartesian coordinate systems
> 
> Yes, R can do that.  Well, actually YOU can do that using R.
> 
> But it is hard to believe that you looked very hard before 
> writing.  Did you look at these R functions?
> 
> ?plot
> ?line
> ?points
> ?arrows
> 
> 
> 
> Charles Annis, P.E.
> 
> [EMAIL PROTECTED]
> phone: 561-352-9699
> eFax:  614-455-3265
> http://www.StatisticalEngineering.com
>  
> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Paul Smith
> Sent: Friday, September 28, 2007 1:12 PM
> To: r-help
> Subject: [R] Drawing functions on Cartesian coordinate systems
> 
> Dear All,
> 
> Can R draw plots of functions on a Cartesian coordinate 
> system with axes like the ones shown at
> 
> http://en.wikipedia.org/wiki/Image:Cartesian-coordinate-system
> -with-circle.s
> vg
> 
> ?
> 
> I have already searched the R web-site, but found nothing.
> 
> Thanks in advance,
> 
> Paul
> 
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/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] Creating nice looking lists: how?

2007-09-28 Thread Katharine Mullen
The source code for print.summary.lm and summary.lm is in the file
/src/library/stats/R/lm.R of the R source code, which you can download
from CRAN if you don't have it already.  The file lm.R is also at
https://svn.r-project.org/R/trunk/src/library/stats/R/lm.R

On Fri, 28 Sep 2007, Sergey Goriatchev wrote:

> Hello,
>
> For my functions I want to create output similar in appearance to that
> of what you get when you print a summary of lm model:
>
> Residuals:
>   Min1Q Median3Q   Max
> -0.209209 -0.043133  0.001793  0.044105  0.234750
>
> Coefficients:
>  Estimate  Std. Error  t valuePr(>|t|)
> (Intercept)  0.981762   0.004089 240.103  < 2e-16 ***
> Factor 1-0.009581   0.006381  -1.501 0.134296
> Factor 2-0.008993   0.009182  -0.979 0.328163
> Factor 3 0.029960   0.009547   3.138 0.001866 **
> Factor 4-0.026575   0.007370  -3.606 0.000363 ***
> Factor 5-0.004847   0.006382  -0.760 0.448138
> Factor 6 0.005099   0.006483   0.786 0.432202
> ---
> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
>
> I want:
> 1) no $ before the list component names
> 2) component names that take values from outside variables
> (ex.: number <- 10
>There are 'number' factors in the model:)
>
> There is not much information on how to create nice output in terms of
> lists, so I was looking for core to write the summary(lm) output, but
> could not find much. Obviously, I can type summary.lm, but it does not
> show how to create the name "Coefficients:"
>
> Could someone give me pointers on how to create nice lists?
>
> Thanks
> Sergey
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/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] fitted values in LMER for the fixed-effects only

2007-09-28 Thread Anouk Simard
Hi,

I would like to extract the fitted values from a model using LMER but 
only for the fix portion of the model and not for the fix and random 
portion (e.g it is the procedure outpm or outp in SAS). I am aware of 
the procedure fitted() but I not sure it give the fitted values both for 
the fixed and random or only the fixed. I looked in the r help and the r 
list and I haven’t not found much details about it excepted this 
comments from Douglas Bates in January 2006 :

“Would it help if there were an option in the fitted method to allow for 
fixed-effects only versus fixed- and random-effects? As you say, because 
lmer models do not need to be hierarchical it is not obvious what it 
would mean to include some but not all of the random effects terms in 
the "fitted values". However, it is easy and unambiguous to define 
fitted values for the fixed-effects only.

Up until a few days ago there was an option to do this but then I 
changed the calculation of the fitted values in an attempt to clean up 
the code. The calculation of the level = 0 fitted values in the new 
representation of the fitted model is quite easy. It is

[EMAIL PROTECTED] %*% fixef(fm1)”

I tried the last formula, but I want to confirm that this is still the 
proper and best way to get fitted values for the fix effects using lmer.

Thanks

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


Re: [R] Drawing functions on Cartesian coordinate systems

2007-09-28 Thread Paul Smith
On 9/28/07, Greg Snow <[EMAIL PROTECTED]> wrote:
> I think he wants the axes crossing at 0,0 not on the outer edges like
> the default.
>
> You can put the axes in the plot (though it tends to distract rather
> than help in many cases) by:
>
> > axis(1, pos=0)
> > axis(2, pos=0)
>
> You will need to draw the arrowheads yourself.  There are options (under
> ?par) for tick length and how to suppress the default axes.

Thanks, Greg, for your suggestion. That is in line with what I was
looking for. However, I still have  one more question. Take the
following code:

curve(sin(x),-pi,pi,axes=F,ylab="",xlab="")
axis(1, pos=0)
axis(2, pos=0,at=c(-1,-0.5,0.5,1))

How can I have the y axis labels rotated clockwise?

Paul





> > -Original Message-
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED] On Behalf Of Charles Annis, P.E.
> > Sent: Friday, September 28, 2007 11:32 AM
> > To: 'Paul Smith'; 'r-help'
> > Subject: Re: [R] Drawing functions on Cartesian coordinate systems
> >
> > Yes, R can do that.  Well, actually YOU can do that using R.
> >
> > But it is hard to believe that you looked very hard before
> > writing.  Did you look at these R functions?
> >
> > ?plot
> > ?line
> > ?points
> > ?arrows
> >
> >
> >
> > Charles Annis, P.E.
> >
> > [EMAIL PROTECTED]
> > phone: 561-352-9699
> > eFax:  614-455-3265
> > http://www.StatisticalEngineering.com
> >
> > -Original Message-
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED] On Behalf Of Paul Smith
> > Sent: Friday, September 28, 2007 1:12 PM
> > To: r-help
> > Subject: [R] Drawing functions on Cartesian coordinate systems
> >
> > Dear All,
> >
> > Can R draw plots of functions on a Cartesian coordinate
> > system with axes like the ones shown at
> >
> > http://en.wikipedia.org/wiki/Image:Cartesian-coordinate-system
> > -with-circle.s
> > vg
> >
> > ?
> >
> > I have already searched the R web-site, but found nothing.
> >
> > Thanks in advance,
> >
> > Paul
> >
> > __
> > R-help@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/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] File selection by condition

2007-09-28 Thread jim holtman
Read the files in, select those that meet the criteria and store them in a list

match.list <- list()
for (i in list.files(pattern="some pattern")){
x.in <- read.table(i)
if (your match criteria) match.list[[i]] <- x.in
}

On 9/28/07, Svempa <[EMAIL PROTECTED]> wrote:
>
> I have a large number of textfiles, and one matix in every texfile. I now
> want to find an easy way to select those textfiles that contain at least one
> value over a certain limit, and collect those matrices in a vector or
> something alike. How do I do that?
>
> --
> View this message in context: 
> http://www.nabble.com/File-selection-by-condition-tf4534428.html#a12940278
> Sent from the R help mailing list archive at Nabble.com.
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>


-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem you are trying to solve?

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


[R] P-P plot

2007-09-28 Thread Maura E Monville
Sorry for my silly questions. I'm a beginner with R and most statistics
concepts.
I carried out a simple linear regression where the dependent variable is
explained through a combination of powers
of cos(independent variable).
I can see R returned a good R^2 factor (> 0.99) but I have a hard time at
interpreting all the other info that R prints out by using summary(
regression.results), residuals(regression.results), anova(regression.results),

plot(regression.results).
I know sometimes R^2 might be misleading ..

I see that R provided a Q-Q plot by default.
Is it possible to get a P-P plot ? I searched for that but did not get
anywhere ...

Thank you in advance.
Best regards,

-- 
Maura E.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] Découvrez Bordeaux inscrit au patrimoine de l'UNESCO !

2007-09-28 Thread redaction

 [1]voyages et vacances 
  Destination vacances
   voyages et vacances

[2]Merveilles de l'Egypte

   voyages et vacances

[3]La Sicile mystérieuse

   voyages et vacances

[4]Athènes et ses joyaux

   vacances et séjour chateau de bonaguil

[5]Les Cyclades en Grèce

   voyages et vacances

[6]Mykonos la magnifique

   voyages et vacances

[7]Delos archéologique

   voyages et vacances

[8]Majorque la grande

   voyages et vacances

[9]La Provence insolite

   voyages et vacances

[10]Arcachon et son climat

   voyages et vacances

[11]Cap Ferret, le village

   voyages et vacances

[12]La Dune du Pilat

   voyages et vacances

[13]Andernos les bains

   voyages et vacances

[14]Bassin d'Arcachon

  voyages et vacances
  Découvertes Week End
   voyages et vacances

[15]Sarlat en Périgord

   voyages et vacances

[16]Bordeaux à l'Unesco 

   voyages et vacances

[17]La Dune du Pilat

   voyages et vacances

[18]Le Mont Saint Michel

   voyages et vacances

[19]Vieux port de La Rochelle

   voyages et vacances

[20]Montmartre à Paris 

   voyages et vacances

[21]Pèlerinage à Lourdes

   vacances et séjour à mykonos, hotel et restaurant

[22]Château de Bonaguil

  voyages et vacances
 Parcs à Thèmes
   voyages et vacances

[23]Zoo de la Palmyre

   voyages et vacances

[24]Aquarium de La Rochelle

   nager avec les dauphins du marineland d'antibes

[25]Marineland d'Antibes

   nager avec les dauphins du marineland d'antibes

[26]Village du Bournat

   nager avec les dauphins du marineland d'antibes

[27]Aquarium du Bugues

   nager avec les dauphins du marineland d'antibes

[28]La Vallée des singes

   voyages et vacances

[29]Ecomusée de Marquèze

  voyages et vacances
   Sortir en Week End
   voyages et vacances

[30]Les Gorges du Verdon

   voyages et vacances

[31]L'ile de Port Cros

   voyages et vacances

[32]Les chambres d'hôtes

   voyages et vacances

[33]Les Sorties en région

   voyages et vacances

[34]Les bonnes tables

  voyages et vacances
  Découvertes en images
   [rect-jaune.gif]

[35]Diaporamas

   voyages et vacances

[36]Galerie Vidéos

   voyages et vacances

[37]Visites virtuelles

  voyages et vacances
Services en ligne
   sur les traces d'Amélie Poulin à Montmartre, voyage et vacances paris hotel
   et restaurant

[38]Récits de vacances

   voyages et vacances

[39]Météo France

   voyages et vacances

[40]Préparatifs à la loupe

   voyages et vacances

[41]Locations de vacances

   voyages et vacances

[42]Vente de photographies

   voyages et vacances

[43]Bons plans Cinéma

  voyages et vacances
   [44]Vols : promotion et offres dernière minute sur Voyages-sncf.com 
 [45]Location de voiture : meilleur prix garanti sur Voyages-sncf.com 
   [46]24 000 hôtels à prix spécialement négociés sur Voyages-sncf.com 
[47]Séjours : promotions et dernière minutes sur Voyages-sncf.com 

  [EMBED]

   voyages et vacances à bordeaux inscrite au patrimoine de l'Unesco
   voyages et vacances à bordeaux inscrite au patrimoine de l'Unesco
   voyages et vacances à bordeaux inscrite au patrimoine de l'Unesco
   [48]Ce guide
   dans vos favoris
   voyages et vacances à bordeaux inscrite au patrimoine de l'Unesco
   [49]Acheter des photographies 
   voyages et vacances à bordeaux inscrite au patrimoine de l'Unesco
   Nos promotions
   dans votre BAL
   ___ [ok.gif]-Submit
   voyages et vacances à bordeaux inscrite au patrimoine de l'Unesco
   [50]S'inscrire à la
   NewsLetter de VoyageSNCF.com
   et gagnez un voyage 
   voyages et vacances à bordeaux inscrite au patrimoine de l'Unesco
   voyages et vacances à bordeaux inscrite au patrimoine de l'Unesco
   voyages et vacances à bordeaux inscrite au patrimoine de l'Unesco

  vacances et séjour en provence maison d 'hote restauarnt hotell
  vacances et séjour en provence maison d 'hote restauarnt hotell

   Découvrez la ville de Bordeaux en images

   [51]Accueil >>[52] Bordeaux

   [espaceur.gif] voyages et vacances à bordeaux inscrite au patrimoine de
   l'Unesco Voyages et vacances à Bordeaux
   voyages et vacances à bordeaux inscrite au patrimoine de l'Unesco
 [53]voyages et vacances à bordeaux inscrite au patrimoine de l'Unesco
   Belle, intelligente et ensoleillée, Bordeaux est entrée dans le 21e siècle
   fermement décidée à retrouver une nouvelle jeunesse. Avec conviction et
   talent, la ville se redessine autour d'un grand projet urbain qui rend à ses
   habitants le plaisir de vivre en ville et crée les conditions d'un nouveau
   développemen

[R] boot.ci and NA values

2007-09-28 Thread Lucia Costanzo
Hi,

I have been trying to run the code below. In the event of non-convergence, 
the statistic in the boot function returns NA as a value. To obtain a BCA 
confidence interval, I use boot.ci but, if NA recorded as a value for the 
statistic for one the replicates the following error appears:

Error in if (const(t, min(1e-08, mean(t)/1e+06))) { :
 missing value where TRUE/FALSE needed

To overcome this, I reformat the output of the bootstrap calculation by 
removing all instances of NA. By doing so the error message does not 
reappear but, I am suspicious of the results.  When I run a simulation 
with 1000 iterations, the coverage probability is 1.

Is this the correct approach for tackling NA values when using boot.ci?

Thanks, Lucia


library(boot)
source(file = "http://www.uoguelph.ca/~lcostanz/mima1.ssc";)

# - Teo Dataset -
studynum <-c(1, 2, 3, 4, 5, 6, 7)
y <- 
c(-0.79851,-0.938269639,-1.252762968,-0.042559614,0.209720531,-2.249410331,-1.181993898)
w <- 
c(0.644007,5.903041825,1.531728665,0.489578714,4.19421878,0.872663243,0.705810147)
genData2<-data.frame(studynum, y, w)

set.seed(4700)

mima.func<-function(x, i) {

x<-x[i,] # select obs. in bootstrap sample
reREML<-mima1(x$y, 1/x$w, mods = c(), method = "REML", out="yes")

if (length(reREML) == 0)
{
ests<-c(NA,NA)
}
else
{
ests<-c(reREML$b,reREML$vart)
}
}

boot.teo4a<-boot(genData2, mima.func, R=2000,)

ci.teo4<-boot.ci(boot.teo4a, conf = c(0.95), type = c("bca"))

#remove all instances of NA
boot.teo4 = boot.teo4a
boot.teo4$t0 = na.omit(boot.teo4$t0)
boot.teo4$t = na.omit(boot.teo4$t)
boot.teo4$R = length(boot.teo4$t[,1])
boot.teo4$call[4] = boot.teo4$R
ci.teo4<-boot.ci(boot.teo4, conf = c(0.95), type = c("bca"))

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

2007-09-28 Thread Greg Snow
Others have shown you where to find the actual printing code for
print.summary.lm, but the short answer is:

Use the cat function for the general text (the word "coefficients:" and
the signif codes at the bottom)
And put the actual coefficients in a matrix, use colnames and rownames
to add column and row headers, then use print.matrix with quote=FALSE to
print out the matrix of coefficients.

For more detailed printing look at ?cat, ?format, and ?sprintf.

Hope this helps,

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

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Sergey Goriatchev
> Sent: Friday, September 28, 2007 8:03 AM
> To: [EMAIL PROTECTED]
> Subject: [R] Creating nice looking lists: how?
> 
> Hello,
> 
> For my functions I want to create output similar in 
> appearance to that of what you get when you print a summary 
> of lm model:
> 
> Residuals:
>   Min1Q Median3Q   Max
> -0.209209 -0.043133  0.001793  0.044105  0.234750
> 
> Coefficients:
>  Estimate  Std. Error  t valuePr(>|t|)
> (Intercept)  0.981762   0.004089 240.103  < 2e-16 ***
> Factor 1-0.009581   0.006381  -1.501 0.134296
> Factor 2-0.008993   0.009182  -0.979 0.328163
> Factor 3 0.029960   0.009547   3.138 0.001866 **
> Factor 4-0.026575   0.007370  -3.606 0.000363 ***
> Factor 5-0.004847   0.006382  -0.760 0.448138
> Factor 6 0.005099   0.006483   0.786 0.432202
> ---
> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
> 
> I want:
> 1) no $ before the list component names
> 2) component names that take values from outside variables
> (ex.: number <- 10
>There are 'number' factors in the model:)
> 
> There is not much information on how to create nice output in 
> terms of lists, so I was looking for core to write the 
> summary(lm) output, but could not find much. Obviously, I can 
> type summary.lm, but it does not show how to create the name 
> "Coefficients:"
> 
> Could someone give me pointers on how to create nice lists?
> 
> Thanks
> Sergey
> 
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/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] Drawing functions on Cartesian coordinate systems

2007-09-28 Thread Greg Snow
Look at the las argument in ?par for the easiest solution (can be passed
to axis). 

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

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Paul Smith
> Sent: Friday, September 28, 2007 1:19 PM
> To: r-help
> Subject: Re: [R] Drawing functions on Cartesian coordinate systems
> 
> On 9/28/07, Greg Snow <[EMAIL PROTECTED]> wrote:
> > I think he wants the axes crossing at 0,0 not on the outer 
> edges like 
> > the default.
> >
> > You can put the axes in the plot (though it tends to 
> distract rather 
> > than help in many cases) by:
> >
> > > axis(1, pos=0)
> > > axis(2, pos=0)
> >
> > You will need to draw the arrowheads yourself.  There are options 
> > (under
> > ?par) for tick length and how to suppress the default axes.
> 
> Thanks, Greg, for your suggestion. That is in line with what 
> I was looking for. However, I still have  one more question. 
> Take the following code:
> 
> curve(sin(x),-pi,pi,axes=F,ylab="",xlab="")
> axis(1, pos=0)
> axis(2, pos=0,at=c(-1,-0.5,0.5,1))
> 
> How can I have the y axis labels rotated clockwise?
> 
> Paul
> 
> 
> 
> 
> 
> > > -Original Message-
> > > From: [EMAIL PROTECTED]
> > > [mailto:[EMAIL PROTECTED] On Behalf Of 
> Charles Annis, P.E.
> > > Sent: Friday, September 28, 2007 11:32 AM
> > > To: 'Paul Smith'; 'r-help'
> > > Subject: Re: [R] Drawing functions on Cartesian coordinate systems
> > >
> > > Yes, R can do that.  Well, actually YOU can do that using R.
> > >
> > > But it is hard to believe that you looked very hard 
> before writing.  
> > > Did you look at these R functions?
> > >
> > > ?plot
> > > ?line
> > > ?points
> > > ?arrows
> > >
> > >
> > >
> > > Charles Annis, P.E.
> > >
> > > [EMAIL PROTECTED]
> > > phone: 561-352-9699
> > > eFax:  614-455-3265
> > > http://www.StatisticalEngineering.com
> > >
> > > -Original Message-
> > > From: [EMAIL PROTECTED]
> > > [mailto:[EMAIL PROTECTED] On Behalf Of Paul Smith
> > > Sent: Friday, September 28, 2007 1:12 PM
> > > To: r-help
> > > Subject: [R] Drawing functions on Cartesian coordinate systems
> > >
> > > Dear All,
> > >
> > > Can R draw plots of functions on a Cartesian coordinate 
> system with 
> > > axes like the ones shown at
> > >
> > > http://en.wikipedia.org/wiki/Image:Cartesian-coordinate-system
> > > -with-circle.s
> > > vg
> > >
> > > ?
> > >
> > > I have already searched the R web-site, but found nothing.
> > >
> > > Thanks in advance,
> > >
> > > Paul
> > >
> > > __
> > > R-help@r-project.org mailing list
> > > https://stat.ethz.ch/mailman/listinfo/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.
> 

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Graphics and LaTeX documents with the same font

2007-09-28 Thread Henrik Bengtsson
On 9/28/07, hadley wickham <[EMAIL PROTECTED]> wrote:
> > Yes there is harm.  But to make bold lines, easy to read titles is fine.
> >   See the spar function in
> > http://biostat.mc.vanderbilt.edu/SgraphicsHints for a starter.  Also see
> > the setps, ps.slide, and setpdf functions in the Hmisc package.
>
> I was interested to see that you have code for drawing scatterplots
> with multiple y-axes.  As far as I know the only legitimate use for a
> double-axis plot is to confuse or mislead the reader (and this is not
> a very ethical use case).  Perhaps you have a counter-example?

Eh... How about all cases where you plot against one variable but want
to show it in different units, e.g. temperature in degrees of
Celsius/Centigrades on one and degrees on Fahrenheit on the other?  I
would say that is a case where you rather want to help the reader, not
mislead her/him.

-Henrik


>
> Hadley
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/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] Drawing functions on Cartesian coordinate systems

2007-09-28 Thread Paul Smith
On 9/28/07, Greg Snow <[EMAIL PROTECTED]> wrote:
> Look at the las argument in ?par for the easiest solution (can be passed
> to axis).

Thanks a lot, Greg! That is it!

Paul


> > -Original Message-
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED] On Behalf Of Paul Smith
> > Sent: Friday, September 28, 2007 1:19 PM
> > To: r-help
> > Subject: Re: [R] Drawing functions on Cartesian coordinate systems
> >
> > On 9/28/07, Greg Snow <[EMAIL PROTECTED]> wrote:
> > > I think he wants the axes crossing at 0,0 not on the outer
> > edges like
> > > the default.
> > >
> > > You can put the axes in the plot (though it tends to
> > distract rather
> > > than help in many cases) by:
> > >
> > > > axis(1, pos=0)
> > > > axis(2, pos=0)
> > >
> > > You will need to draw the arrowheads yourself.  There are options
> > > (under
> > > ?par) for tick length and how to suppress the default axes.
> >
> > Thanks, Greg, for your suggestion. That is in line with what
> > I was looking for. However, I still have  one more question.
> > Take the following code:
> >
> > curve(sin(x),-pi,pi,axes=F,ylab="",xlab="")
> > axis(1, pos=0)
> > axis(2, pos=0,at=c(-1,-0.5,0.5,1))
> >
> > How can I have the y axis labels rotated clockwise?
> >
> > Paul
> >
> >
> >
> >
> >
> > > > -Original Message-
> > > > From: [EMAIL PROTECTED]
> > > > [mailto:[EMAIL PROTECTED] On Behalf Of
> > Charles Annis, P.E.
> > > > Sent: Friday, September 28, 2007 11:32 AM
> > > > To: 'Paul Smith'; 'r-help'
> > > > Subject: Re: [R] Drawing functions on Cartesian coordinate systems
> > > >
> > > > Yes, R can do that.  Well, actually YOU can do that using R.
> > > >
> > > > But it is hard to believe that you looked very hard
> > before writing.
> > > > Did you look at these R functions?
> > > >
> > > > ?plot
> > > > ?line
> > > > ?points
> > > > ?arrows
> > > >
> > > >
> > > >
> > > > Charles Annis, P.E.
> > > >
> > > > [EMAIL PROTECTED]
> > > > phone: 561-352-9699
> > > > eFax:  614-455-3265
> > > > http://www.StatisticalEngineering.com
> > > >
> > > > -Original Message-
> > > > From: [EMAIL PROTECTED]
> > > > [mailto:[EMAIL PROTECTED] On Behalf Of Paul Smith
> > > > Sent: Friday, September 28, 2007 1:12 PM
> > > > To: r-help
> > > > Subject: [R] Drawing functions on Cartesian coordinate systems
> > > >
> > > > Dear All,
> > > >
> > > > Can R draw plots of functions on a Cartesian coordinate
> > system with
> > > > axes like the ones shown at
> > > >
> > > > http://en.wikipedia.org/wiki/Image:Cartesian-coordinate-system
> > > > -with-circle.s
> > > > vg
> > > >
> > > > ?
> > > >
> > > > I have already searched the R web-site, but found nothing.
> > > >
> > > > Thanks in advance,
> > > >
> > > > Paul
> > > >
> > > > __
> > > > R-help@r-project.org mailing list
> > > > https://stat.ethz.ch/mailman/listinfo/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.
> >
>
>

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

2007-09-28 Thread Greg Snow
Does this give you what you want?

fit <- lm( Petal.Width ~ Petal.Length, data=iris)

tmp1 <- resid(fit)
tmp2 <- pnorm( tmp1, 0, summary(fit)$sigma )

par(mfrow=c(2,1))
qqnorm(tmp1)
qqline(tmp1)

plot( ppoints(length(tmp1)), sort(tmp2), xlab='Theoretical Percentiles',
 ylab='Sample Percentiles')
abline(0,1)


Most people these days prefer the qqplot to the pp plot, the qq-plot
gives more room to the set of points that are generally most
interesting.

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

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Maura E Monville
> Sent: Friday, September 28, 2007 1:17 PM
> To: [EMAIL PROTECTED]
> Subject: [R] P-P plot
> 
> Sorry for my silly questions. I'm a beginner with R and most 
> statistics concepts.
> I carried out a simple linear regression where the dependent 
> variable is explained through a combination of powers of 
> cos(independent variable).
> I can see R returned a good R^2 factor (> 0.99) but I have a 
> hard time at interpreting all the other info that R prints 
> out by using summary( regression.results), 
> residuals(regression.results), anova(regression.results),
> 
> plot(regression.results).
> I know sometimes R^2 might be misleading ..
> 
> I see that R provided a Q-Q plot by default.
> Is it possible to get a P-P plot ? I searched for that but 
> did not get anywhere ...
> 
> Thank you in advance.
> Best regards,
> 
> --
> Maura E.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@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Graphics and LaTeX documents with the same font

2007-09-28 Thread Austin, Matt
I find them helpful for displaying the differences in coupled biomarkers
between therapies with different therapeutic targets.  You can quickly
see/show which marker is affected quicker and then the other compensating in
response and how they can be reversed depending on target. Having each
measure on its own actual scale and not having to do something like percent
change over time is very helpful (for many biomarkers it's hard to judge the
clinical relavence of scaled values).  

I believe in looking at the data in numerous ways, to help myself from
confusing or misleading myself--which is not my intent.

--Matt Austin
Statistician, Amgen Inc.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of hadley wickham
Sent: Friday, September 28, 2007 10:14 AM
To: Frank E Harrell Jr
Cc: R-help
Subject: Re: [R] Graphics and LaTeX documents with the same font

> Yes there is harm.  But to make bold lines, easy to read titles is fine.
>   See the spar function in
> http://biostat.mc.vanderbilt.edu/SgraphicsHints for a starter.  Also see
> the setps, ps.slide, and setpdf functions in the Hmisc package.

I was interested to see that you have code for drawing scatterplots
with multiple y-axes.  As far as I know the only legitimate use for a
double-axis plot is to confuse or mislead the reader (and this is not
a very ethical use case).  Perhaps you have a counter-example?

Hadley

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] fitted values in LMER for the fixed-effects only

2007-09-28 Thread Douglas Bates
On 9/28/07, Anouk Simard <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I would like to extract the fitted values from a model using LMER but
> only for the fix portion of the model and not for the fix and random
> portion (e.g it is the procedure outpm or outp in SAS). I am aware of
> the procedure fitted() but I not sure it give the fitted values both for
> the fixed and random or only the fixed. I looked in the r help and the r
> list and I haven't not found much details about it excepted this
> comments from Douglas Bates in January 2006 :
>
> "Would it help if there were an option in the fitted method to allow for
> fixed-effects only versus fixed- and random-effects? As you say, because
> lmer models do not need to be hierarchical it is not obvious what it
> would mean to include some but not all of the random effects terms in
> the "fitted values". However, it is easy and unambiguous to define
> fitted values for the fixed-effects only.
>
> Up until a few days ago there was an option to do this but then I
> changed the calculation of the fitted values in an attempt to clean up
> the code. The calculation of the level = 0 fitted values in the new
> representation of the fitted model is quite easy. It is
>
> [EMAIL PROTECTED] %*% fixef(fm1)"
>
> I tried the last formula, but I want to confirm that this is still the
> proper and best way to get fitted values for the fix effects using lmer.

Yes.

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

2007-09-28 Thread James
Hi,

I am trying to create a plot of a simple P&L graph for an option I'm  
pricing using Rmetrics.  I'm not trying to do anything fancy.  I just  
want to figure out if it's possible to put the x-axis at 0 rather  
than at the bottom the the entire plot.  It seems like something that  
would be relatively easy to do.  Any help or hints would be greatly  
appreciated.  Thanks.

James

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

2007-09-28 Thread Greg Snow
Use xaxt='n' in the original plot to suppress the default axis (or
axes=FALSE to supress both), then axis(1, pos=0) to draw the axis at 0.

Hope this helps,

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

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of James
> Sent: Friday, September 28, 2007 3:13 PM
> To: r-help@r-project.org
> Subject: [R] plot x-axis at 0
> 
> Hi,
> 
> I am trying to create a plot of a simple P&L graph for an 
> option I'm pricing using Rmetrics.  I'm not trying to do 
> anything fancy.  I just want to figure out if it's possible 
> to put the x-axis at 0 rather than at the bottom the the 
> entire plot.  It seems like something that would be 
> relatively easy to do.  Any help or hints would be greatly 
> appreciated.  Thanks.
> 
> James
> 
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/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] plot x-axis at 0

2007-09-28 Thread James
On Sep 28, 2007, at 3:22 PM, Greg Snow wrote:

> Use xaxt='n' in the original plot to suppress the default axis (or
> axes=FALSE to supress both), then axis(1, pos=0) to draw the axis  
> at 0.

That was what I was looking for.  Thank you.  I just need to do a bit  
of refining now.

James

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

2007-09-28 Thread Brian Perron
Hello all,

An elementary question that I am sure can be easily cracked by an R
enthusiast.  Let's say I have multiple scores (y) on subjects (x.sample).
Some subjects have a few more scores than others.  Can somebody suggest some
code that will select the first score for each subject?

For example, the following code generates scores for 5 subjects:

> x <- c(1:5)
> x.sample <- sample(x, 20, replace = TRUE)
> x.sample <- sort(x.sample)
> y <- rnorm(20)
> z <- cbind(x.sample, y)
> z

  x.sample  y
 [1,]1 -1.2006469
 [2,]1  0.7615261
 [3,]1 -0.1287516
 [4,]1 - 1.1796474
 [5,]1 -1.2902519
 [6,]2 -0.1614918
 [7,]2 -0.1464773
 [8,]2 -0.8875417
 [9,]2  0.3062891
[10,]2  0.4398530
[11,]3 -0.5717729
[12,]3 - 0.2938118
[13,]4 -0.2398887
[14,]4  0.8425419
[15,]4  2.5269801
[16,]4 -0.3643613
[17,]5  1.1690564
[18,]5 -0.7644521
[19,]5  1.4178982
[20,]5 - 0.8198921

I am only interested in extracting the first score (y) for each unique
subject (x.sample).  So, I would like to generate the following output.

x.sample   y
[1,]1  -1.2006469
[2,]2  -0.1614918
[3,]3  -0.5717729
[4,]4  -0.2398887
[5,]5   1.1690564

Any assistance would be greatly appreciated.

Regards,
Brian

[[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] Selecting values

2007-09-28 Thread Marc Schwartz
On Fri, 2007-09-28 at 17:48 -0400, Brian Perron wrote:
> Hello all,
> 
> An elementary question that I am sure can be easily cracked by an R
> enthusiast.  Let's say I have multiple scores (y) on subjects (x.sample).
> Some subjects have a few more scores than others.  Can somebody suggest some
> code that will select the first score for each subject?
> 
> For example, the following code generates scores for 5 subjects:
> 
> > x <- c(1:5)
> > x.sample <- sample(x, 20, replace = TRUE)
> > x.sample <- sort(x.sample)
> > y <- rnorm(20)
> > z <- cbind(x.sample, y)
> > z
> 
>   x.sample  y
>  [1,]1 -1.2006469
>  [2,]1  0.7615261
>  [3,]1 -0.1287516
>  [4,]1 - 1.1796474
>  [5,]1 -1.2902519
>  [6,]2 -0.1614918
>  [7,]2 -0.1464773
>  [8,]2 -0.8875417
>  [9,]2  0.3062891
> [10,]2  0.4398530
> [11,]3 -0.5717729
> [12,]3 - 0.2938118
> [13,]4 -0.2398887
> [14,]4  0.8425419
> [15,]4  2.5269801
> [16,]4 -0.3643613
> [17,]5  1.1690564
> [18,]5 -0.7644521
> [19,]5  1.4178982
> [20,]5 - 0.8198921
> 
> I am only interested in extracting the first score (y) for each unique
> subject (x.sample).  So, I would like to generate the following output.
> 
> x.sample   y
> [1,]1  -1.2006469
> [2,]2  -0.1614918
> [3,]3  -0.5717729
> [4,]4  -0.2398887
> [5,]5   1.1690564
> 
> Any assistance would be greatly appreciated.
> 
> Regards,
> Brian

See ?split, ?sapply and ?unique.

Then try this:

> cbind(unique(z[, 1]), sapply(split(z[, 2], z[, 1]), "[", 1))
  [,1]   [,2]
11 -1.2006469
22 -0.1614918
33 -0.5717729
44 -0.2398887
55  1.1690564


The key part of that is:

> split(z[, 2], z[, 1])
$`1`
[1] -1.2006469  0.7615261 -0.1287516 -1.1796474 -1.2902519

$`2`
[1] -0.1614918 -0.1464773 -0.8875417  0.3062891  0.4398530

$`3`
[1] -0.5717729 -0.2938118

$`4`
[1] -0.2398887  0.8425419  2.5269801 -0.3643613

$`5`
[1]  1.1690564 -0.7644521  1.4178982 -0.8198921


which splits 'z' by the values in the first column.

Then we use sapply() to go through the list and subset the first element
in each vector:

> sapply(split(z[, 2], z[, 1]), "[", 1)
 1  2  3  4  5 
-1.2006469 -0.1614918 -0.5717729 -0.2398887  1.1690564 


Then we cbind() that result to the unique values in the first column.

HTH,

Marc Schwartz

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


Re: [R] Selecting values

2007-09-28 Thread Matthew Keller
Is this easier?

x.index <- duplicated(x.sample)==FALSE
cbind(x.sample[x.index],y[x.index])


- Matt

On 9/28/07, Marc Schwartz <[EMAIL PROTECTED]> wrote:
> On Fri, 2007-09-28 at 17:48 -0400, Brian Perron wrote:
> > Hello all,
> >
> > An elementary question that I am sure can be easily cracked by an R
> > enthusiast.  Let's say I have multiple scores (y) on subjects (x.sample).
> > Some subjects have a few more scores than others.  Can somebody suggest some
> > code that will select the first score for each subject?
> >
> > For example, the following code generates scores for 5 subjects:
> >
> > > x <- c(1:5)
> > > x.sample <- sample(x, 20, replace = TRUE)
> > > x.sample <- sort(x.sample)
> > > y <- rnorm(20)
> > > z <- cbind(x.sample, y)
> > > z
> >
> >   x.sample  y
> >  [1,]1 -1.2006469
> >  [2,]1  0.7615261
> >  [3,]1 -0.1287516
> >  [4,]1 - 1.1796474
> >  [5,]1 -1.2902519
> >  [6,]2 -0.1614918
> >  [7,]2 -0.1464773
> >  [8,]2 -0.8875417
> >  [9,]2  0.3062891
> > [10,]2  0.4398530
> > [11,]3 -0.5717729
> > [12,]3 - 0.2938118
> > [13,]4 -0.2398887
> > [14,]4  0.8425419
> > [15,]4  2.5269801
> > [16,]4 -0.3643613
> > [17,]5  1.1690564
> > [18,]5 -0.7644521
> > [19,]5  1.4178982
> > [20,]5 - 0.8198921
> >
> > I am only interested in extracting the first score (y) for each unique
> > subject (x.sample).  So, I would like to generate the following output.
> >
> > x.sample   y
> > [1,]1  -1.2006469
> > [2,]2  -0.1614918
> > [3,]3  -0.5717729
> > [4,]4  -0.2398887
> > [5,]5   1.1690564
> >
> > Any assistance would be greatly appreciated.
> >
> > Regards,
> > Brian
>
> See ?split, ?sapply and ?unique.
>
> Then try this:
>
> > cbind(unique(z[, 1]), sapply(split(z[, 2], z[, 1]), "[", 1))
>   [,1]   [,2]
> 11 -1.2006469
> 22 -0.1614918
> 33 -0.5717729
> 44 -0.2398887
> 55  1.1690564
>
>
> The key part of that is:
>
> > split(z[, 2], z[, 1])
> $`1`
> [1] -1.2006469  0.7615261 -0.1287516 -1.1796474 -1.2902519
>
> $`2`
> [1] -0.1614918 -0.1464773 -0.8875417  0.3062891  0.4398530
>
> $`3`
> [1] -0.5717729 -0.2938118
>
> $`4`
> [1] -0.2398887  0.8425419  2.5269801 -0.3643613
>
> $`5`
> [1]  1.1690564 -0.7644521  1.4178982 -0.8198921
>
>
> which splits 'z' by the values in the first column.
>
> Then we use sapply() to go through the list and subset the first element
> in each vector:
>
> > sapply(split(z[, 2], z[, 1]), "[", 1)
>  1  2  3  4  5
> -1.2006469 -0.1614918 -0.5717729 -0.2398887  1.1690564
>
>
> Then we cbind() that result to the unique values in the first column.
>
> 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.
>


-- 
Matthew C Keller
Postdoctoral Fellow
Virginia Institute for Psychiatric and Behavioral Genetics

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Graphics and LaTeX documents with the same font

2007-09-28 Thread Frank E Harrell Jr
hadley wickham wrote:
>> Yes there is harm.  But to make bold lines, easy to read titles is fine.
>>   See the spar function in
>> http://biostat.mc.vanderbilt.edu/SgraphicsHints for a starter.  Also see
>> the setps, ps.slide, and setpdf functions in the Hmisc package.
> 
> I was interested to see that you have code for drawing scatterplots
> with multiple y-axes.  As far as I know the only legitimate use for a
> double-axis plot is to confuse or mislead the reader (and this is not
> a very ethical use case).  Perhaps you have a counter-example?
> 
> Hadley
> 

Generally I share your dislike of those, and prefer multiple panels with 
different scales.

Cheers
Frank

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

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


Re: [R] Selecting values

2007-09-28 Thread Marc Schwartz
Here is yet another approach using aggregate(), which internally,
basically does what my first solution did:

> aggregate(z[, 2], list(z[, 1]), "[", 1)
  Group.1  x
1   1 -1.2006469
2   2 -0.1614918
3   3 -0.5717729
4   4 -0.2398887
5   5  1.1690564

See ?aggregate

Note that you get a data frame as a result, rather than a matrix.

Also, you could 'collapse' the split() and sapply() part of my first
solution using tapply():

> tapply(z[, 2], z[, 1], "[", 1)
 1  2  3  4  5 
-1.2006469 -0.1614918 -0.5717729 -0.2398887  1.1690564 


As has been said by fortune("Yoda"):

Evelyn Hall: I would like to know how (if) I can extract some of the
information from the summary of my nlme.
Simon Blomberg: This is R. There is no if. Only how.
   -- Evelyn Hall and Simon 'Yoda' Blomberg
  R-help (April 2005)

HTH,

Marc Schwartz

On Fri, 2007-09-28 at 16:12 -0600, Matthew Keller wrote:
> Is this easier?
> 
> x.index <- duplicated(x.sample)==FALSE
> cbind(x.sample[x.index],y[x.index])
> 
> 
> - Matt
> 
> On 9/28/07, Marc Schwartz <[EMAIL PROTECTED]> wrote:
> > On Fri, 2007-09-28 at 17:48 -0400, Brian Perron wrote:
> > > Hello all,
> > >
> > > An elementary question that I am sure can be easily cracked by an R
> > > enthusiast.  Let's say I have multiple scores (y) on subjects (x.sample).
> > > Some subjects have a few more scores than others.  Can somebody suggest 
> > > some
> > > code that will select the first score for each subject?
> > >
> > > For example, the following code generates scores for 5 subjects:
> > >
> > > > x <- c(1:5)
> > > > x.sample <- sample(x, 20, replace = TRUE)
> > > > x.sample <- sort(x.sample)
> > > > y <- rnorm(20)
> > > > z <- cbind(x.sample, y)
> > > > z
> > >
> > >   x.sample  y
> > >  [1,]1 -1.2006469
> > >  [2,]1  0.7615261
> > >  [3,]1 -0.1287516
> > >  [4,]1 - 1.1796474
> > >  [5,]1 -1.2902519
> > >  [6,]2 -0.1614918
> > >  [7,]2 -0.1464773
> > >  [8,]2 -0.8875417
> > >  [9,]2  0.3062891
> > > [10,]2  0.4398530
> > > [11,]3 -0.5717729
> > > [12,]3 - 0.2938118
> > > [13,]4 -0.2398887
> > > [14,]4  0.8425419
> > > [15,]4  2.5269801
> > > [16,]4 -0.3643613
> > > [17,]5  1.1690564
> > > [18,]5 -0.7644521
> > > [19,]5  1.4178982
> > > [20,]5 - 0.8198921
> > >
> > > I am only interested in extracting the first score (y) for each unique
> > > subject (x.sample).  So, I would like to generate the following output.
> > >
> > > x.sample   y
> > > [1,]1  -1.2006469
> > > [2,]2  -0.1614918
> > > [3,]3  -0.5717729
> > > [4,]4  -0.2398887
> > > [5,]5   1.1690564
> > >
> > > Any assistance would be greatly appreciated.
> > >
> > > Regards,
> > > Brian
> >
> > See ?split, ?sapply and ?unique.
> >
> > Then try this:
> >
> > > cbind(unique(z[, 1]), sapply(split(z[, 2], z[, 1]), "[", 1))
> >   [,1]   [,2]
> > 11 -1.2006469
> > 22 -0.1614918
> > 33 -0.5717729
> > 44 -0.2398887
> > 55  1.1690564
> >
> >
> > The key part of that is:
> >
> > > split(z[, 2], z[, 1])
> > $`1`
> > [1] -1.2006469  0.7615261 -0.1287516 -1.1796474 -1.2902519
> >
> > $`2`
> > [1] -0.1614918 -0.1464773 -0.8875417  0.3062891  0.4398530
> >
> > $`3`
> > [1] -0.5717729 -0.2938118
> >
> > $`4`
> > [1] -0.2398887  0.8425419  2.5269801 -0.3643613
> >
> > $`5`
> > [1]  1.1690564 -0.7644521  1.4178982 -0.8198921
> >
> >
> > which splits 'z' by the values in the first column.
> >
> > Then we use sapply() to go through the list and subset the first element
> > in each vector:
> >
> > > sapply(split(z[, 2], z[, 1]), "[", 1)
> >  1  2  3  4  5
> > -1.2006469 -0.1614918 -0.5717729 -0.2398887  1.1690564
> >
> >
> > Then we cbind() that result to the unique values in the first column.
> >
> > 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-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Graphics and LaTeX documents with the same font

2007-09-28 Thread Daniel Lakeland
On Fri, Sep 28, 2007 at 12:13:46PM -0500, hadley wickham wrote:
> > Yes there is harm.  But to make bold lines, easy to read titles is fine.
> >   See the spar function in
> > http://biostat.mc.vanderbilt.edu/SgraphicsHints for a starter.  Also see
> > the setps, ps.slide, and setpdf functions in the Hmisc package.
> 
> I was interested to see that you have code for drawing scatterplots
> with multiple y-axes.  As far as I know the only legitimate use for a
> double-axis plot is to confuse or mislead the reader (and this is not
> a very ethical use case).  Perhaps you have a counter-example?
> 
> Hadley

It can be useful to see multiple timeseries on the same x (time) scale
but with different y scales for each to see if there are time-lag
correlations between different quantities


-- 
Daniel Lakeland
[EMAIL PROTECTED]
http://www.street-artists.org/~dlakelan

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Importing only one function from a package

2007-09-28 Thread Søren Højsgaard
Dear List
 
In a package I want to import the mApply function from the Hmisc package, and I 
would like to import only that function.
 
1) If I write "Depends: Hmisc" in the DESCRIPTION file I get the whole Hmisc 
package, so that is not the way to go ahead.
 
2) According to "Writing R extensions", sec 1.6.1 "Specifying imports and 
exports" I can (as I read it) simply type Hmisc:::mApply() in my code. That 
works, but gives a warning in the check:
 
* checking for unstated dependencies in R code ... WARNING
'::' or ':::' imports not declared from:
  Hmisc
 
3) According to the same section I can (again as I read it) write in the 
NAMESPACE file
importFrom(Hmisc,mApply)
 
Then I get:
 
* checking package dependencies ... ERROR
Namespace dependencies not required:
  Hmisc
 
That message goes away if I write  "Depends: Hmisc" in DESCRIPTION, but then we 
are back to 1) where I started where the whole Hmisc package is loaded.
 
Obviously I have missed a point or two somewhere. Can anyone enlighten me?
 
I use R 2.5.1 on windows XP.
 
Regards
Søren
 
 
 

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Importing only one function from a package

2007-09-28 Thread Matthew Keller
Hi Soren,

What I do in cases like this is just copy the function and place it
into my script at the top (or write it into its own source file and
call it from script). Best,

Matt

On 9/28/07, Søren Højsgaard <[EMAIL PROTECTED]> wrote:
> Dear List
>
> In a package I want to import the mApply function from the Hmisc package, and 
> I would like to import only that function.
>
> 1) If I write "Depends: Hmisc" in the DESCRIPTION file I get the whole Hmisc 
> package, so that is not the way to go ahead.
>
> 2) According to "Writing R extensions", sec 1.6.1 "Specifying imports and 
> exports" I can (as I read it) simply type Hmisc:::mApply() in my code. 
> That works, but gives a warning in the check:
>
> * checking for unstated dependencies in R code ... WARNING
> '::' or ':::' imports not declared from:
>   Hmisc
>
> 3) According to the same section I can (again as I read it) write in the 
> NAMESPACE file
> importFrom(Hmisc,mApply)
>
> Then I get:
>
> * checking package dependencies ... ERROR
> Namespace dependencies not required:
>   Hmisc
>
> That message goes away if I write  "Depends: Hmisc" in DESCRIPTION, but then 
> we are back to 1) where I started where the whole Hmisc package is loaded.
>
> Obviously I have missed a point or two somewhere. Can anyone enlighten me?
>
> I use R 2.5.1 on windows XP.
>
> Regards
> Søren
>
>
>
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>


-- 
Matthew C Keller
Postdoctoral Fellow
Virginia Institute for Psychiatric and Behavioral Genetics
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Importing only one function from a package

2007-09-28 Thread Deepayan Sarkar
On 9/28/07, Søren Højsgaard <[EMAIL PROTECTED]> wrote:
> Dear List
>
> In a package I want to import the mApply function from the Hmisc package, and 
> I would like to import only that function.
>
> 1) If I write "Depends: Hmisc" in the DESCRIPTION file I get the whole Hmisc 
> package, so that is not the way to go ahead.
>
> 2) According to "Writing R extensions", sec 1.6.1 "Specifying imports and 
> exports" I can (as I read it) simply type Hmisc:::mApply() in my code. 
> That works, but gives a warning in the check:
>
> * checking for unstated dependencies in R code ... WARNING
> '::' or ':::' imports not declared from:
>   Hmisc
>
> 3) According to the same section I can (again as I read it) write in the 
> NAMESPACE file
> importFrom(Hmisc,mApply)
>
> Then I get:
>
> * checking package dependencies ... ERROR
> Namespace dependencies not required:
>   Hmisc
>
> That message goes away if I write  "Depends: Hmisc" in DESCRIPTION, but then
> we are back to 1) where I started where the whole Hmisc package is loaded.
>
> Obviously I have missed a point or two somewhere. Can anyone enlighten me?

For both 2) and 3), the correct DESCRIPTION entry is

Imports: Hmisc

And for 2), you should be able to use Hmisc::mApply (i.e., 2 colons,
not 3), although 3) is preferred.

-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] RODBC and Oracle

2007-09-28 Thread John McHenry
Hi WizaRds,

I'm experiencing a problem connecting to an Oracle 10g database via RODBC
(I'm getting this on Microsoft XP).

The same SQL queries via PL/SQL Developer work just fine, but when I pump the 
query through sqlQuery in RODBC then I get a data frame back with 0 rows. 
I cut the query down alternating between PL/SQL and RODBC until I figured 
that it's some kind of row limit or buffer limit thing going on.

I searched the archives and Brian Ripley suggested playing with believeNRows
parameter (setting it to FALSE) as Oracle is not well behaved. I've tried 
various 
combinations of this and delving into the lower level functions like odbcQuery
and sqlGetResults but I'm still getting the same thing: 0 rows back unless 
I cut the query down to a more return a more reasonable range.

Obviously I can't reproduce the problem here because of the database, but does
anyone have any suggestions/tips/pointers to get me going toward a solution?
Maybe it's a settings problem in the Microsoft ODBC thing under 
Control Panel->Administrative Tools->Data Sources
Any suggestions on this? 

All help gladly received.

Thanks!

Jack.

platform   i386-pc-mingw32 
arch   i386
os mingw32 
system i386, mingw32   
status 
major  2   
minor  5.1 
year   2007
month  06  
day27  
svn rev42083   
language   R   
version.string R version 2.5.1 (2007-06-27)


   
-

[[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] Problem compiling R - "use of NULL environment is defunct"

2007-09-28 Thread Saptarshi Guha
Hello,
I downloaded R-2.5.1 and configured it on a AMD x86-74 running  
Redhat. During compilation i get this error

configure --prefix=$HOME/mine
make

mkdir -p -- ../../../../library/methods/libs
make[5]: Leaving directory `/home/sguha/tmp/R-2.5.1/src/library/ 
methods/src'
make[4]: Leaving directory `/home/sguha/tmp/R-2.5.1/src/library/ 
methods/src'
make[4]: Entering directory `/home/sguha/tmp/R-2.5.1/src/library/ 
methods'
dumping R code in package 'methods'
Error in `parent.env<-`(`*tmp*`, value = NULL) :
 use of NULL environment is defunct
Execution halted
make[4]: *** [../../../library/methods/R/methods.rdb] Error 1
make[4]: Leaving directory `/home/sguha/tmp/R-2.5.1/src/library/methods'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/home/sguha/tmp/R-2.5.1/src/library/methods'
make[2]: *** [R] Error 1
make[2]: Leaving directory `/home/sguha/tmp/R-2.5.1/src/library'
make[1]: *** [R] Error 1
make[1]: Leaving directory `/home/sguha/tmp/R-2.5.1/src'
make: *** [R] Error 1


Could someone point out what I'm supposed to fix?
Thank you for your time
Saptarshi

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

2007-09-28 Thread Jeff Spies
Hadley,

This was something I forgot to change before making the site public.   
Thanks for pointing out the creative commons license--it's definitely  
what I was thinking: share-alike content.

I'd be glad to hear any other suggestions you might have,

Jeff.

On Sep 28, 2007, at 9:15 AM, hadley wickham wrote:

> Hi Jeff,
>
> That looks like a nice initiative.  However, if you are interested in
> getting contributions from the community, it might be good to spell
> out how others might use the content of the site.  Currently you have
> copyright r-cookbook.com, but maybe you could consider a creative
> commons (http://creativecommons.org/) license instead?
>
> Hadley
>
> On 9/27/07, Jeff <[EMAIL PROTECTED]> wrote:
>> R Community,
>>
>> I've put together a website that I thought this mailing list might be
>> interested in: http://www.r-cookbook.com
>>
>> It's a (free) community-driven content management system for R
>> "recipes", or working examples.  Some of the features of the site are
>> code highlighting, recipe ratings, recipe comments, personal "recipe
>> boxes" to save your favorite recipes, community tagging, RSS feeds
>> for each user and for each tag, and similar recipe recommendations.
>>
>> Although I imagine that many users will sort/search/find recipes by
>> tags, I've implemented a linear organization for recipes as well:
>> guides.  These will be compilations of "recipes", organized in a
>> logical fashion as to promote understanding of the topic of that
>> particular guide and introduced with user-contributed pages.  Over
>> time, hopefully with the help of the community, more guides will be
>> created and the ones I have will be filled-in to actually be useful.
>> I have started several guides to give you an idea of the sort of
>> thing I'm thinking: Introduction to R, Longitudinal Modeling in R,
>> Exploratory Data Analysis in R, and more here, http://www.r-
>> cookbook.com/guide
>>
>> A couple of features that will be worked on in the near future are
>> (1) the design of the site and (2) working on a more interactive code
>> display (right now, functions are highlighted and linked to the r-
>> docs, but that's it).
>>
>> I hope some of you might find the site useful and perhaps even
>> consider contributing your own recipes.  If you have any suggestions
>> or feature requests, I'd be glad to hear them!
>>
>> Jeff.
>>
>> __
>> R-help@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting- 
>> guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>>
>
>
> -- 
> http://had.co.nz/
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/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] seq() question

2007-09-28 Thread Derek Ogle
Hello all,

I am attempting to use the seq() function to define breaks for the cut() 
function but am finding performance that I do not understand.  The root of my 
problem appears to be contained in the following simple example.

> brks <- seq(0.8,1.2,0.1)
> brks
[1] 0.8 0.9 1.0 1.1 1.2
> brks==1.2
[1] FALSE FALSE FALSE FALSE FALSE
> brks==1.1
[1] FALSE FALSE FALSE  TRUE FALSE

The last value in the sequence does not appear to be equal to its apparent 
value (i.e., 1.2) whereas the fourth value in the sequence, for example, does 
(e.g., 1.1).

Any help/suggestions with the concept or "trick" that I am missing here?  Thank 
you in advance.

p.s., I am using R 2.5.1 with ...

> Sys.info()
  sysname   release 
"Windows"  "NT 5.1" 
  version  nodename 
"(build 2600) Service Pack 2"  "CSE229-001" 
  machine
"x86"

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

2007-09-28 Thread Marc Schwartz
On Fri, 2007-09-28 at 21:58 -0500, Derek Ogle wrote:
> Hello all,
> 
> I am attempting to use the seq() function to define breaks for the
> cut() function but am finding performance that I do not understand.
> The root of my problem appears to be contained in the following simple
> example.
> 
> > brks <- seq(0.8,1.2,0.1)
> > brks
> [1] 0.8 0.9 1.0 1.1 1.2
> > brks==1.2
> [1] FALSE FALSE FALSE FALSE FALSE
> > brks==1.1
> [1] FALSE FALSE FALSE  TRUE FALSE
> 
> The last value in the sequence does not appear to be equal to its
> apparent value (i.e., 1.2) whereas the fourth value in the sequence,
> for example, does (e.g., 1.1).
> 
> Any help/suggestions with the concept or "trick" that I am missing
> here?  Thank you in advance.

See R FAQ 7.31 Why doesn't R think these numbers are equal?

http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f

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.


  1   2   >