[R] Where to find Discriminate Function Analysis in RExcel

2013-04-01 Thread Greg Liggett
I am using RExcel and the R Commander and so far find it easy to use.
However, I am looking for a DFA and it is not clear which function that
might be in RExcel. Can anyone point me to where I can find it?

Thank you.

[[alternative HTML version deleted]]

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


Re: [R] lmer effects-type plot?

2013-04-01 Thread Nicole Ford
I was only just now able to investigate and give this a try (not sure how I 
missed it previously when I looked at the page).  It worked perfectly!  Thanks 
to you both.  =)


On Mar 31, 2013, at 8:28 PM, Nicole Ford wrote:

 John,
 
 Thanks for your reply!  I will check again I must have missed it!
 
 ~Nicole Ford
 Ph.D. Student
 Graduate Assistant/ Instructor
 Department of Government and International Affairs
 University of South Florida
 office: SOC 012M
 e: nmhi...@mail.usf.edu
 http://gia.usf.edu/student/nford/
 
 Sent from my iPhone
 
 On Mar 31, 2013, at 7:54 PM, John Fox j...@mcmaster.ca wrote:
 
 Dear Nicole,
 
 Thanks to Sandy Weisberg, who is a coauthor of the package, the effects
 package has methods for objects produced by lme() in the nlme package and
 lmer() and glmer() in the lme4 package, to plot the fixed effects. See
 ?effect.
 
 I hope this helps,
 John
 
 -Original Message-
 From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
 project.org] On Behalf Of Nicole Ford
 Sent: Sunday, March 31, 2013 7:27 PM
 To: r-help-r-project.org help
 Subject: [R] lmer effects-type plot?
 
 hello, all.
 
 while i have a mcmc running, i am looking at the frequestist method of
 my model.  i have never done HLM so i am looking for ways to plot them
 that might yeild something useful like dr. fox's effects plot package.
 this is my model, where dem is democracy ranked continuous 1:10, trsut
 is a 3 level categorical variable, cpi is 1:10, etc...
 
 hier.jags2.mod - lmer(dem ~ trust*cpi + age + gender + educ + income
 + (1 + trust | country), data=wvsAB)
 
 i have tried the following:
 
 tmp - as.data.frame(confint(glht(.hier.jags2.mod))$confint)
 tmp$Comparison - rownames(tmp)
 q-(ggplot(tmp, aes(x = Comparison, y = Estimate, ymin = lwr, ymax =
 upr,  srt = 45)) + geom_errorbar() + geom_point())
 q + theme(axis.text.x=theme_text(angle=-45))
 
 as well as some function using xyplot to little avail, as well as a few
 others i happened upon online...
 
 any suggestions of packages/ sample code would be helpful.
 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-
 guide.html
 and provide commented, minimal, self-contained, reproducible code.
 
 
   [[alternative HTML version deleted]]
 
 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.

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


Re: [R] How to represent certain values in a file as we want?

2013-04-01 Thread Jonsson
I got this erro
Error in c(red, blue, green)[r] : invalid subscript type 'S4'



--
View this message in context: 
http://r.789695.n4.nabble.com/How-to-represent-certain-values-in-a-file-as-we-want-tp4662925p4662935.html
Sent from the R help mailing list archive at Nabble.com.

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


[R] DUD (Does not Use Derivatives) for nonlinear regression in R?

2013-04-01 Thread qi A
Hi, All

SAS has DUD (Does not Use Derivatives)/Secant Method for nonlinear
regression, does R offer this option for nonlinear regression?

I have read the helpfile for nls() and could not find such option, any
suggestion?

Thanks,

Derek

[[alternative HTML version deleted]]

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


Re: [R] Error message in dredge function (MuMIn package) with binary GLM

2013-04-01 Thread Cat Cowie
Hi all,

My replies within the forum aren't getting approved, though my emails
always go through, so here is my reply to a question I previously
posted (all questions and answers shown). Thanks, Cat


I'm having trouble with the model generating 'dredge' function in the MuMIn
'Multi-model Inference' package.

Here's the script:

globalmodel- glm(TB~lat+protocol+tested+
streams+goats+hay+cattle+deer,
family=binomial)
chat- deviance(globalmodel)/59 #There we 59 residual degrees of freedom in
this global model.
models- dredge(globalmodel, beta=FALSE, evaluate=TRUE, rank=AICc,
chat=chat, fixed=NULL, trace=FALSE)

And the error message is:

Error in UseMethod(logLik) :
  no applicable method for 'logLik' applied to an object of class logical

I have trawled the literature and it seems to be ok to use a binary GLM as
the global model - could this be the problem? The variables are a mix of
binary and continuous data.

Any thoughts?
Thanks,
Cat

__
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Kamil Barton
Reply | Threaded | More
Mar 30, 2013; 9:48am

Re: Error message in dredge function (MuMIn package) used with binary GLM

2 posts
'rank' should be QAICc.
AICc does not have argument 'chat', hence the error.

kamil



CatCowie
Reply | Threaded | More
Mar 30, 2013; 10:35am

Re: Error message in dredge function (MuMIn package) used with binary GLM


Hi Kamil,

Thanks for your help. I do want to use rank=QAICc, but I when I try
it I get the following error message:

Error in get(as.character(FUN), mode = function, envir = envir) :
  object 'QAICc' of mode 'function' was not found

Do I need to install another package that would recognise this?

When I leave the script with rank=AICc (to see if it will run), and
having removed chat (which I put in after previously recieving an
error message about it being missing from the formula), I still get my
original error message:

Error in UseMethod(logLik) :
  no applicable method for 'logLik' applied to an object of class logical

Any further thoughts?
Thanks, Cat

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


Re: [R] How to represent certain values in a file as we want?

2013-04-01 Thread David Winsemius

On Mar 31, 2013, at 12:37 PM, Jonsson wrote:

 I got this erro
 Error in c(red, blue, green)[r] : invalid subscript type 'S4'
 
I don't have your data so testing is not possible. I assumed a plot call was 
base graphics and that 'r' was a vector. I was wrong. It's an S4 object. I 
would follow the examples in the plot.raster page and try:

   plot(r, col=colorRampPalette(c(red, white, blue))(3) )


You should learn how to use your mail client to send context.


Snipped Nabble stuff

-- 

David Winsemius
Alameda, CA, USA

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Parameter Estimation in R with Sums and Lagged Variables

2013-04-01 Thread Christian Satzky
Hi guys,

I am afraid I am stuck with an estimation problem.

I have two variables, X and Y. Y is explained by the weighted sum of n
lagged values of X. My aim is to estimate the two parameters
c(alpha0,alpha1) in:

Yt = Sum from j=1 to n of ( ( alpha0 + alpha1 * j ) * Xt-j )

Where Xt-j denotes the jth lag of X.

I came up with this approach because I thought it would be a good idea to
estimate the slope of the weights rather than estimating one parameter for
each lag of X added (I intent to set n very large). Is that easily doable
in R?

My first try looks like this:

parameters-function(alpha,y){
logl- for(i in 1:n){
sum((alpha[1]+alpha[2]*i)*lag(xvar,i))
}
return(-logl)
}
optim(c(0.001,0.001),parameters,y=yvar)

It is really hard to find any clear sources when it comes to optimization
including lags.

I would really appreciate if someone could help me out on this one!

Kind regards  Happy Easter,

Christian

[[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] polygon error

2013-04-01 Thread catalin roibu
Hello all!

I have a problem to draw a polygon with R. My data is like this
   Year Nb.series Perc.pos Perc.neg Nature RGV_mean RGV_sd neg poz
1 1901 1 0.00 0.00 0 4.29 NA 0.00 0.00
2 1902 1 100.00 0.00 1 16.47 NA 0.00 100.00
3 1903 1 100.00 0.00 1 31.31 NA 0.00 100.00
4 1904 1 0.00 0.00 0 -9.62 NA 0.00 0.00
5 1905 1 0.00 100.00 -1 -22.55 NA -100.00 0.00
6 1906 1 0.00 100.00 -1 -12.09 NA -100.00 0.00
7 1907 2 50.00 50.00 0 5.40 50.95 -50.00 50.00
8 1908 3 33.33 66.67 -1 -6.46 19.38 -66.67 33.33
9 1909 3 33.33 0.00 0 9.70 12.82 0.00 33.33
10 1910 3 33.33 66.67 -1 -6.91 26.42 -66.67 33.33
11 1911 3 0.00 66.67 -1 -11.63 13.86 -66.67 0.00
12 1912 3 33.33 0.00 0 16.26 29.25 0.00 33.33
-- 

I try this code:
plot(seriep$Year,seriep$poz, type=l,ylim=c(-100,100))
lines(seriep$Year,seriep$neg, type=l,col=red)

polygon(c(seriep$Year,rev(seriep$Year)),c(seriep$neg,rev(seriep$poz),col=grey93,border=NA))
and this is the errorError in xy.coords(x, y) : 'x' and 'y' lengths differ.

Please help me to solve this problem.

Thank you!

Best regards,
---
Catalin-Constantin ROIBU
Lecturer PhD, Forestry engineer
Forestry Faculty of Suceava
Str. Universitatii no. 13, Suceava, 720229, Romania
office phone +4 0230 52 29 78, ext. 531
mobile phone   +4 0745 53 18 01
   +4 0766 71 76 58
FAX:+4 0230 52 16 64
silvic.usv.ro

[[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] polygon error

2013-04-01 Thread peter dalgaard

On Apr 1, 2013, at 10:56 , catalin roibu wrote:

 Hello all!
 
 I have a problem to draw a polygon with R. My data is like this
   Year Nb.series Perc.pos Perc.neg Nature RGV_mean RGV_sd neg poz
 1 1901 1 0.00 0.00 0 4.29 NA 0.00 0.00
 2 1902 1 100.00 0.00 1 16.47 NA 0.00 100.00
 3 1903 1 100.00 0.00 1 31.31 NA 0.00 100.00
 4 1904 1 0.00 0.00 0 -9.62 NA 0.00 0.00
 5 1905 1 0.00 100.00 -1 -22.55 NA -100.00 0.00
 6 1906 1 0.00 100.00 -1 -12.09 NA -100.00 0.00
 7 1907 2 50.00 50.00 0 5.40 50.95 -50.00 50.00
 8 1908 3 33.33 66.67 -1 -6.46 19.38 -66.67 33.33
 9 1909 3 33.33 0.00 0 9.70 12.82 0.00 33.33
 10 1910 3 33.33 66.67 -1 -6.91 26.42 -66.67 33.33
 11 1911 3 0.00 66.67 -1 -11.63 13.86 -66.67 0.00
 12 1912 3 33.33 0.00 0 16.26 29.25 0.00 33.33
 -- 
 
 I try this code:
 plot(seriep$Year,seriep$poz, type=l,ylim=c(-100,100))
 lines(seriep$Year,seriep$neg, type=l,col=red)
 
 polygon(c(seriep$Year,rev(seriep$Year)),c(seriep$neg,rev(seriep$poz),col=grey93,border=NA))
 and this is the errorError in xy.coords(x, y) : 'x' and 'y' lengths differ.
 
 Please help me to solve this problem.
 

Parenthesis misplaced

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd@cbs.dk  Priv: pda...@gmail.com

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


Re: [R] [Rd] R/Sweave/cairo/freetype bug fix.

2013-04-01 Thread Simon Urbanek

On Apr 1, 2013, at 5:18 AM, Hin-Tak Leung wrote:

 --- On Sat, 30/3/13, Hin-Tak Leung ht...@users.sourceforge.net wrote:
 
 ... was committed to freetype in January and will form the
 next release (2.4.12). 
 
 It is perhaps worth repeating the quote:  'The official R binaries for 
 windows ... are compiled against static libraries of cairo 1.10.2 ... are 
 firmly in the do not work correctly category'
 
 The minimum version of cairo to work being 1.11.2. On closer examination, the 
 official bundle (http://www.rforge.net/Cairo/files/cairo-current-win.tar.gz) 
 is built with neither fontconfig nor freetype. So even if it is bumped to 
 current version (1.12.x), it does not work correctly.
 

That is not the official bundle - that is merely a convenience binary for the 
Cairo package (not to be confused with cairo back-end in R) for users that 
don't have cairographics installed on their system. I don't think that CRAN 
uses this for R builds.


 Perhaps also wasn't clear in the bugzilla thread - everybody from 
 fontconfig/cairo/freetype involved knew it being the issue so it has never 
 been explicitly spelled out - the problem was (is) with cairo's pdf/ps 
 generation, aided by freetype.
 

But then why would even the old binary in the Cairo package be an issue? It 
uses Win32 API, not freetype.

Cheers,
Simon



 --
 On Sat, Mar 30, 2013 18:54 GMT Simon Urbanek wrote:
 
 On Mar 30, 2013, at 9:24 AM, Hin-Tak Leung wrote:
 
 Perhaps that's too much details. There is (will be)
 a new freetype because of cairo's unanticipated usage (which
 R uses, among other cairo users). Most people should upgrade
 or request an upgrade eventually, when they are
 comfortable.
 
 
 Which versions are affected? R binary for OS X uses
 freetype 2.4.11 (and cairo 1.12.14) so I just need to know
 if there is an action item.
 
 Thanks,
 SImon
 
 
 
 --- On Sat, 30/3/13, peter dalgaard pda...@gmail.com
 wrote:
 
 Huh?
 
 This is utterly incomprehensible without reading
 the redhat
 bugzilla, and even after reading, I'm not sure what
 the
 issue is. Something with bold Chinese fonts in X11,
 but
 maybe also affecting Latin fonts, ?
 
 Please explain yourself.
 
 -pd
 
 On Mar 30, 2013, at 09:25 , Hin-Tak Leung wrote:
 
 The problem was first seen with R/Sweave (#c0)
 then
 reproduced directly with cairo (#c10) and was
 eventually
 traced to freetype. The 5-part bug fix:
 610ee58e07090ead529849b2a454bb6c503b4995
 da11e5e7647b668dee46fd0418ea5ecbc33ae3b2
 e1a2ac1900f2f16ec48fb4840a6b7965a8373c2b
 869fb8c49ddf292d6daf4826172a308973d3e11f
 d56e544d653b09c657911629557ffc5277a503e3
 was committed to freetype in January and will
 form the
 next release (2.4.12). They were back ported to
 2.4.11
 https://bugzilla.redhat.com/show_bug.cgi?id=891457#c35
 and the redhat people had further back-ported
 it to
 2.4.10 for fedora 18/19 (#c51).
 
 The freetype people had reproduced the problem
 with a
 latin font, so this affects most people, unlike
 what the
 initial report (#c0) suggests.
 
 Since freetype is part of X11, most unix/linux
 users
 would be understandably nervous about breaking X
 (see #c45
 for screenshot of broken gnome terminal!) and
 should wait up
 to a year before the new and not-yet-released
 2.4.12 becomes
 an official upgrade; or contact their favourite
 unix vendors
 and/or Apple for upgrades. AFAIK, current
 up-to-date linux
 distributions ships the rather older 2.4.10, with
 the
 exception of fedora 18/19 (#c51). Mac OS X 10.5
 ships
 freetype 2.3.5 as part of X11; I haven't bother
 looking up
 later Mac OS X's.
 
 The official R binaries for windows and mac OS
 X are
 compiled against static libraries of cairo 1.10.2
 (over 2
 years old), and cairo 1.11.2 and freetype 2.4.4
 respectively, and are firmly in the do not work
 correctly
 category.
 
 The long and short of the story is that
 R/Sweave uses a
 feature of cairo which wasn't implemented before
 cairo
 1.11.2 (#c13, Jan 2011), which in turn depends on a
 feature
 of freetype that has been around since 2005 but did
 not
 anticipate cairo's usage. It is commendable that
 the
 freetype people did not refer to cairo's usage as
 misuse
 but took the patience to address the problem,
 unlike some
 group's style.
 
 It has been an interesting few months returning
 to
 freetype after about 17 years, I think.
 
 Here is how to look up what version of freetype
 -
 libfreetype.so.x.y.z for most unix platforms, and
 /usr/X11/lib/libfreetype.x.y.z.dylib on Mac OS X:
 
 (excerpt from docs/VERSION.DLL)
 
   version   
 x.y.z   date of release
   2.4.11 
 6.10.0  Dec 2012
   2.4.10 
 6.9.0   June 2012
   2.4.9 

 6.8.1   March 2012
 ...
   2.4.4 

 6.6.2   Nov 2010  (official R
 mac
 binaries)
 ...
   2.3.5 

 6.3.16  July 2007 (Mac OS X 10.5)
 
 
 __
 r-de...@r-project.org
 mailing list
 https://stat.ethz.ch/mailman/listinfo/r-devel
 
 -- 
 Peter Dalgaard, 

Re: [R] Error message in dredge function (MuMIn package) used with binary GLM

2013-04-01 Thread Kamil Bartoń

Hi Cat,
are you using some very old version of MuMIn? That would explain the
missing 'QAICc'.
As for the error message about 'logLik', it usually occurs when there
are some misspelled arguments (that go into ... and are passed to the
rank function, 'AICc' in your case). Check if there is some argument (of
type logical) in your call to 'dredge' that is not its formal argument.

kamil

On 2013-03-30 03:13, cat.e.co...@gmail.com wrote:

Hi Kamil,

Thanks for your help. I do want to use rank=QAICc, but I when I try it I get 
the following error message:

Error in get(as.character(FUN), mode = function, envir = envir) :
   object 'QAICc' of mode 'function' was not found

Do I need to install another package that would recognise this?

When I leave the script with rank=AICc (to see if it will run), and having removed 
chat (which I put in after previously recieving an error message about it being missing 
from the formula), I still get my original error message:

Error in UseMethod(logLik) :
   no applicable method for 'logLik' applied to an object of class logical

Any further thoughts?
Thanks, Cat


quote author='Kamil Barton'
'rank' should be QAICc.
AICc does not have argument 'chat', hence the error.

kamil



Hi all,

I'm having trouble with the model generating 'dredge' function in the MuMIn
'Multi-model Inference' package.

Here's the script:

globalmodel- glm(TB~lat+protocol+tested+
streams+goats+hay+cattle+deer,
family=binomial)
chat- deviance(globalmodel)/59 #There we 59 residual degrees of freedom in
this global model.
models- dredge(globalmodel, beta=FALSE, evaluate=TRUE, rank=AICc,
chat=chat, fixed=NULL, trace=FALSE)

And the error message is:

Error in UseMethod(logLik) :
   no applicable method for 'logLik' applied to an object of class logical

I have trawled the literature and it seems to be ok to use a binary GLM as
the global model - could this be the problem? The variables are a mix of
binary and continuous data.

Any thoughts?
Thanks,
Cat


/quote
Quoted from:
http://r.789695.n4.nabble.com/Error-message-in-dredge-function-MuMIn-package-used-with-binary-GLM-tp4662842p4662881.html





The University of Aberdeen is a charity registered in Scotland, No SC013683.

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

2013-04-01 Thread catalin roibu
Sorry for this message it's just a test.

Thank you!

-- 
---
Catalin-Constantin ROIBU
Lecturer PhD, Forestry engineer
Forestry Faculty of Suceava
Str. Universitatii no. 13, Suceava, 720229, Romania
office phone +4 0230 52 29 78, ext. 531
mobile phone   +4 0745 53 18 01
   +4 0766 71 76 58
FAX:+4 0230 52 16 64
silvic.usv.ro

[[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] [Rd] R/Sweave/cairo/freetype bug fix.

2013-04-01 Thread Hin-Tak Leung
--- On Sat, 30/3/13, Hin-Tak Leung ht...@users.sourceforge.net wrote:

 ... was committed to freetype in January and will form the
 next release (2.4.12). 

It is perhaps worth repeating the quote:  'The official R binaries for windows 
... are compiled against static libraries of cairo 1.10.2 ... are firmly in the 
do not work correctly category'

The minimum version of cairo to work being 1.11.2. On closer examination, the 
official bundle (http://www.rforge.net/Cairo/files/cairo-current-win.tar.gz) is 
built with neither fontconfig nor freetype. So even if it is bumped to current 
version (1.12.x), it does not work correctly.

Perhaps also wasn't clear in the bugzilla thread - everybody from 
fontconfig/cairo/freetype involved knew it being the issue so it has never been 
explicitly spelled out - the problem was (is) with cairo's pdf/ps generation, 
aided by freetype.

 --
 On Sat, Mar 30, 2013 18:54 GMT Simon Urbanek wrote:
 
 On Mar 30, 2013, at 9:24 AM, Hin-Tak Leung wrote:
 
  Perhaps that's too much details. There is (will be)
 a new freetype because of cairo's unanticipated usage (which
 R uses, among other cairo users). Most people should upgrade
 or request an upgrade eventually, when they are
 comfortable.
  
 
 Which versions are affected? R binary for OS X uses
 freetype 2.4.11 (and cairo 1.12.14) so I just need to know
 if there is an action item.
 
 Thanks,
 SImon
 
 
 
  --- On Sat, 30/3/13, peter dalgaard pda...@gmail.com
 wrote:
  
  Huh?
  
  This is utterly incomprehensible without reading
 the redhat
  bugzilla, and even after reading, I'm not sure what
 the
  issue is. Something with bold Chinese fonts in X11,
 but
  maybe also affecting Latin fonts, ?
  
  Please explain yourself.
  
  -pd
  
  On Mar 30, 2013, at 09:25 , Hin-Tak Leung wrote:
  
  The problem was first seen with R/Sweave (#c0)
 then
  reproduced directly with cairo (#c10) and was
 eventually
  traced to freetype. The 5-part bug fix:
  610ee58e07090ead529849b2a454bb6c503b4995
  da11e5e7647b668dee46fd0418ea5ecbc33ae3b2
  e1a2ac1900f2f16ec48fb4840a6b7965a8373c2b
  869fb8c49ddf292d6daf4826172a308973d3e11f
  d56e544d653b09c657911629557ffc5277a503e3
  was committed to freetype in January and will
 form the
  next release (2.4.12). They were back ported to
 2.4.11
  https://bugzilla.redhat.com/show_bug.cgi?id=891457#c35
  and the redhat people had further back-ported
 it to
  2.4.10 for fedora 18/19 (#c51).
  
  The freetype people had reproduced the problem
 with a
  latin font, so this affects most people, unlike
 what the
  initial report (#c0) suggests.
  
  Since freetype is part of X11, most unix/linux
 users
  would be understandably nervous about breaking X
 (see #c45
  for screenshot of broken gnome terminal!) and
 should wait up
  to a year before the new and not-yet-released
 2.4.12 becomes
  an official upgrade; or contact their favourite
 unix vendors
  and/or Apple for upgrades. AFAIK, current
 up-to-date linux
  distributions ships the rather older 2.4.10, with
 the
  exception of fedora 18/19 (#c51). Mac OS X 10.5
 ships
  freetype 2.3.5 as part of X11; I haven't bother
 looking up
  later Mac OS X's.
  
  The official R binaries for windows and mac OS
 X are
  compiled against static libraries of cairo 1.10.2
 (over 2
  years old), and cairo 1.11.2 and freetype 2.4.4
  respectively, and are firmly in the do not work
 correctly
  category.
  
  The long and short of the story is that
 R/Sweave uses a
  feature of cairo which wasn't implemented before
 cairo
  1.11.2 (#c13, Jan 2011), which in turn depends on a
 feature
  of freetype that has been around since 2005 but did
 not
  anticipate cairo's usage. It is commendable that
 the
  freetype people did not refer to cairo's usage as
 misuse
  but took the patience to address the problem,
 unlike some
  group's style.
  
  It has been an interesting few months returning
 to
  freetype after about 17 years, I think.
  
  Here is how to look up what version of freetype
 -
  libfreetype.so.x.y.z for most unix platforms, and
  /usr/X11/lib/libfreetype.x.y.z.dylib on Mac OS X:
  
  (excerpt from docs/VERSION.DLL)
  
       version   
  x.y.z   date of release
       2.4.11 
     6.10.0  Dec 2012
       2.4.10 
     6.9.0   June 2012
       2.4.9 
    
  6.8.1   March 2012
  ...
       2.4.4 
    
  6.6.2   Nov 2010  (official R
 mac
  binaries)
  ...
       2.3.5 
    
  6.3.16  July 2007 (Mac OS X 10.5)
  
  
  __
  r-de...@r-project.org
  mailing list
  https://stat.ethz.ch/mailman/listinfo/r-devel
  
  -- 
  Peter Dalgaard, Professor,
  Center for Statistics, Copenhagen Business School
  Solbjerg Plads 3, 2000 Frederiksberg, Denmark
  Phone: (+45)38153501
  Email: pd@cbs.dk 
  Priv: pda...@gmail.com
  
  
  
  
  
  
  
  
  
  
  __
  r-de...@r-project.org
 mailing list
  https://stat.ethz.ch/mailman/listinfo/r-devel
  
  
 
 



[R] overlaping barplot

2013-04-01 Thread catalin roibu
Hello all!
I want to make a barplot with ggplot2.
I want to view in the same chart the semn values (significant values
(pointer over 50)). I try this code, but only for pointer values.
ggplot(data, aes(x = Year, y = pointer))   + geom_bar(stat=identity)

please help me with this problem.


I use this data:
Year variable pointer variable semn
1 1901 neg 0.00 sneg NA
2 1902 neg 0.00 sneg NA
3 1903 neg 0.00 sneg NA
4 1904 neg 0.00 sneg NA
5 1905 neg -100.00 sneg -100.00
6 1906 neg -100.00 sneg -100.00
7 1907 neg -50.00 sneg NA
8 1908 neg -66.67 sneg -66.67
9 1909 neg 0.00 sneg NA
10 1910 neg -66.67 sneg -66.67
112 1901 poz 0.00 spoz NA
113 1902 poz 100.00 spoz 100.00
114 1903 poz 100.00 spoz 100.00
115 1904 poz 0.00 spoz NA
116 1905 poz 0.00 spoz NA
117 1906 poz 0.00 spoz NA
118 1907 poz 50.00 spoz NA
119 1908 poz 33.33 spoz NA
120 1909 poz 33.33 spoz NA
121 1910 poz 33.33 spoz NA



Thank you very much!

-- 
---
Catalin-Constantin ROIBU
Lecturer PhD, Forestry engineer
Forestry Faculty of Suceava
Str. Universitatii no. 13, Suceava, 720229, Romania
office phone +4 0230 52 29 78, ext. 531
mobile phone   +4 0745 53 18 01
   +4 0766 71 76 58
FAX:+4 0230 52 16 64
silvic.usv.ro

[[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] ggplot2 label

2013-04-01 Thread catalin roibu
Hello all!

I have a problem to plot label (Year) only for significant values (in this
case spoz and sneg).
I use this code, but don't work with labels.
library(ggplot2)
ggplot(data1, aes(x = Year, y = value,fill=type,width=1))+
  geom_bar(stat=identity,position=identity)+
  scale_y_continuous(breaks = round(seq(-100, 100, by = 10),10))+
  theme_bw()

the data used is:
Year variable value type
1 1901 neg 0.00 all
2 1902 neg 0.00 all
3 1903 neg 0.00 all
4 1904 neg 0.00 all
5 1905 neg -100.00 all
6 1906 neg -100.00 all
7 1907 neg -50.00 all
8 1908 neg -66.67 all
9 1909 neg 0.00 all
10 1910 neg -66.67 all
11 1911 neg -66.67 all
12 1912 neg 0.00 all
13 1913 neg -50.00 all
112 1901 poz 0.00 all
113 1902 poz 100.00 all
114 1903 poz 100.00 all
115 1904 poz 0.00 all
116 1905 poz 0.00 all
117 1906 poz 0.00 all
118 1907 poz 50.00 all
119 1908 poz 33.33 all
120 1909 poz 33.33 all
121 1910 poz 33.33 all
122 1911 poz 0.00 all
123 1912 poz 33.33 all
124 1913 poz 25.00 all
223 1901 sneg NA sneg
224 1902 sneg NA sneg
225 1903 sneg NA sneg
226 1904 sneg NA sneg
227 1905 sneg -100.00 sneg
228 1906 sneg -100.00 sneg
229 1907 sneg NA sneg
230 1908 sneg -66.67 sneg
231 1909 sneg NA sneg
232 1910 sneg -66.67 sneg
233 1911 sneg -66.67 sneg
234 1912 sneg NA sneg
235 1913 sneg NA sneg
334 1901 spoz NA spoz
335 1902 spoz 100.00 spoz
336 1903 spoz 100.00 spoz
337 1904 spoz NA spoz
338 1905 spoz NA spoz
339 1906 spoz NA spoz
340 1907 spoz NA spoz
341 1908 spoz NA spoz
342 1909 spoz NA spoz
343 1910 spoz NA spoz
344 1911 spoz NA spoz
345 1912 spoz NA spoz
346 1913 spoz NA spoz

Thank you very much!

Best regards!


-- 
---
Catalin-Constantin ROIBU
Lecturer PhD, Forestry engineer
Forestry Faculty of Suceava
Str. Universitatii no. 13, Suceava, 720229, Romania
office phone +4 0230 52 29 78, ext. 531
mobile phone   +4 0745 53 18 01
   +4 0766 71 76 58
FAX:+4 0230 52 16 64
silvic.usv.ro

[[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] Parameter Estimation in R with Sums and Lagged Variables

2013-04-01 Thread Mark Leeds
Hi: Google for koyck distributed lag. Based on what you wrote, I think
that's what you're looking for or something close to it.

There is tons of literature on that model and if you read enough about it,
you'll see that
through a  transformation, reduces to something that much simpler to
estimate. There are so many papers that I wouldn't know which one to send
you. As far as textbooks, Baltagi's has the best explanation that I've seen.









There is tons of literature on that model


On Mon, Apr 1, 2013 at 2:37 AM, Christian Satzky c.sat...@gmail.com wrote:

 Hi guys,

 I am afraid I am stuck with an estimation problem.

 I have two variables, X and Y. Y is explained by the weighted sum of n
 lagged values of X. My aim is to estimate the two parameters
 c(alpha0,alpha1) in:

 Yt = Sum from j=1 to n of ( ( alpha0 + alpha1 * j ) * Xt-j )

 Where Xt-j denotes the jth lag of X.

 I came up with this approach because I thought it would be a good idea to
 estimate the slope of the weights rather than estimating one parameter for
 each lag of X added (I intent to set n very large). Is that easily doable
 in R?

 My first try looks like this:

 parameters-function(alpha,y){
 logl- for(i in 1:n){
 sum((alpha[1]+alpha[2]*i)*lag(xvar,i))
 }
 return(-logl)
 }
 optim(c(0.001,0.001),parameters,y=yvar)

 It is really hard to find any clear sources when it comes to optimization
 including lags.

 I would really appreciate if someone could help me out on this one!

 Kind regards  Happy Easter,

 Christian

 [[alternative HTML version deleted]]

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


[[alternative HTML version deleted]]

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


[R] Image segmentation

2013-04-01 Thread Eder Paulo


Hi,

I work with
remote sensing in Brazil. I would like to know if there is any algorithm or
package that does image segmentation by region growing in R.

Thanks,

Eder.

  
[[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] ggplot label problem

2013-04-01 Thread catalin roibu
Dear R users,
I have a problem to plot label (Year) only for significant values (in this
case spoz and sneg).
I use this code, but don't work with labels.
library(ggplot2)
ggplot(data1, aes(x = Year, y = value,fill=type,width=1))+
  geom_bar(stat=identity,position=identity)+
  scale_y_continuous(breaks = round(seq(-100, 100, by = 10),10))+
  theme_bw()

the data used is:
Year variable value type
1 1901 neg 0.00 all
2 1902 neg 0.00 all
3 1903 neg 0.00 all
4 1904 neg 0.00 all
5 1905 neg -100.00 all
6 1906 neg -100.00 all
7 1907 neg -50.00 all
8 1908 neg -66.67 all
9 1909 neg 0.00 all
10 1910 neg -66.67 all
11 1911 neg -66.67 all
12 1912 neg 0.00 all
13 1913 neg -50.00 all
112 1901 poz 0.00 all
113 1902 poz 100.00 all
114 1903 poz 100.00 all
115 1904 poz 0.00 all
116 1905 poz 0.00 all
117 1906 poz 0.00 all
118 1907 poz 50.00 all
119 1908 poz 33.33 all
120 1909 poz 33.33 all
121 1910 poz 33.33 all
122 1911 poz 0.00 all
123 1912 poz 33.33 all
124 1913 poz 25.00 all
223 1901 sneg NA sneg
224 1902 sneg NA sneg
225 1903 sneg NA sneg
226 1904 sneg NA sneg
227 1905 sneg -100.00 sneg
228 1906 sneg -100.00 sneg
229 1907 sneg NA sneg
230 1908 sneg -66.67 sneg
231 1909 sneg NA sneg
232 1910 sneg -66.67 sneg
233 1911 sneg -66.67 sneg
234 1912 sneg NA sneg
235 1913 sneg NA sneg
334 1901 spoz NA spoz
335 1902 spoz 100.00 spoz
336 1903 spoz 100.00 spoz
337 1904 spoz NA spoz
338 1905 spoz NA spoz
339 1906 spoz NA spoz
340 1907 spoz NA spoz
341 1908 spoz NA spoz
342 1909 spoz NA spoz
343 1910 spoz NA spoz
344 1911 spoz NA spoz
345 1912 spoz NA spoz
346 1913 spoz NA spoz

Thank you very much!

Best regards!

-- 
---
Catalin-Constantin ROIBU
Lecturer PhD, Forestry engineer
Forestry Faculty of Suceava
Str. Universitatii no. 13, Suceava, 720229, Romania
office phone +4 0230 52 29 78, ext. 531
mobile phone   +4 0745 53 18 01
   +4 0766 71 76 58
FAX:+4 0230 52 16 64
silvic.usv.ro

[[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] Data frame question

2013-04-01 Thread ramoss
Hello,

I have 2 data frames:  activity and dates.  Activity contains a l variable
listing all activities:  activityA, activityB etc.
The dates contain all the valid business dates.  I need to combine the 2 so
that I get a single data frame activitydat that contains the activity name
along w/ evevry valid business dates such as

Name  dat
activity A   2013-02-01
activity A  2013-02-04
activity A  2013-02-05
etc


Any thought?  Thanks ahead for your help.



--
View this message in context: 
http://r.789695.n4.nabble.com/Data-frame-question-tp4662967.html
Sent from the R help mailing list archive at Nabble.com.

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


Re: [R] Data frame question

2013-04-01 Thread Sarah Goslee
That sounds like a job for merge().

If you provide an actual reproducible example using dput(), then you
will likely get some actual runnable code.

Sarah

On Mon, Apr 1, 2013 at 11:54 AM, ramoss ramine.mossad...@finra.org wrote:
 Hello,

 I have 2 data frames:  activity and dates.  Activity contains a l variable
 listing all activities:  activityA, activityB etc.
 The dates contain all the valid business dates.  I need to combine the 2 so
 that I get a single data frame activitydat that contains the activity name
 along w/ evevry valid business dates such as

 Name  dat
 activity A   2013-02-01
 activity A  2013-02-04
 activity A  2013-02-05
 etc


 Any thought?  Thanks ahead for your help.




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

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


[R] ggplot2 label problem

2013-04-01 Thread catalin roibu
I have a problem to plot label (Year) only for significant values (in this
case spoz and sneg).
I use this code, but don't work with labels.
library(ggplot2)
ggplot(data1, aes(x = Year, y = value,fill=type,width=1))+
  geom_bar(stat=identity,position=identity)+
  scale_y_continuous(breaks = round(seq(-100, 100, by = 10),10))+
  theme_bw()
Thank you!

the data used is:

Year variable   value type
1   1901  neg0.00  all
2   1902  neg0.00  all
3   1903  neg0.00  all
4   1904  neg0.00  all
5   1905  neg -100.00  all
6   1906  neg -100.00  all
7   1907  neg  -50.00  all
8   1908  neg  -66.67  all
9   1909  neg0.00  all
10  1910  neg  -66.67  all
11  1911  neg  -66.67  all
12  1912  neg0.00  all
13  1913  neg  -50.00  all
14  1914  neg -100.00  all
15  1915  neg  -50.00  all
16  1916  neg  -83.33  all
17  1917  neg  -16.67  all
18  1918  neg  -50.00  all
19  1919  neg  -12.50  all
20  1920  neg  -25.00  all
21  1921  neg  -12.50  all
22  1922  neg  -33.33  all
23  1923  neg  -30.00  all
24  1924  neg  -33.33  all
25  1925  neg   -6.67  all
26  1926  neg  -13.33  all
27  1927  neg  -11.11  all
28  1928  neg  -38.10  all
29  1929  neg  -39.13  all
30  1930  neg  -33.33  all
31  1931  neg  -36.00  all
32  1932  neg  -34.62  all
33  1933  neg  -41.38  all
34  1934  neg  -32.26  all
35  1935  neg  -42.42  all
36  1936  neg  -30.30  all
37  1937  neg  -50.00  all
38  1938  neg  -52.78  all
39  1939  neg  -34.21  all
40  1940  neg  -15.38  all
41  1941  neg  -27.50  all
42  1942  neg  -58.54  all
43  1943  neg  -35.71  all
44  1944  neg  -29.55  all
45  1945  neg  -33.33  all
46  1946  neg  -30.00  all
47  1947  neg  -41.51  all
48  1948  neg  -27.78  all
49  1949  neg  -38.18  all
50  1950  neg  -17.86  all
51  1951  neg  -38.60  all
52  1952  neg  -18.97  all
53  1953  neg  -33.33  all
54  1954  neg  -25.00  all
55  1955  neg  -30.65  all
56  1956  neg  -34.92  all
57  1957  neg  -26.56  all
58  1958  neg  -24.62  all
59  1959  neg  -37.31  all
60  1960  neg  -40.00  all
61  1961  neg  -34.25  all
62  1962  neg  -45.21  all
63  1963  neg  -41.89  all
64  1964  neg  -35.14  all
65  1965  neg  -24.00  all
66  1966  neg  -29.33  all
67  1967  neg  -30.26  all
68  1968  neg  -46.75  all
69  1969  neg  -29.87  all
70  1970  neg  -42.31  all
71  1971  neg  -30.77  all
72  1972  neg  -50.00  all
73  1973  neg  -33.33  all
74  1974  neg  -27.85  all
75  1975  neg  -39.51  all
76  1976  neg  -53.09  all
77  1977  neg  -38.27  all
78  1978  neg  -59.26  all
79  1979  neg  -61.73  all
80  1980  neg  -67.07  all
81  1981  neg  -47.56  all
82  1982  neg  -26.83  all
83  1983  neg  -58.54  all
84  1984  neg  -63.41  all
85  1985  neg  -50.00  all
86  1986  neg  -42.68  all
87  1987  neg  -74.39  all
88  1988  neg  -52.44  all
89  1989  neg  -26.83  all
90  1990  neg  -29.27  all
91  1991  neg  -30.49  all
92  1992  neg  -15.85  all
93  1993  neg  -32.93  all
94  1994  neg  -54.88  all
95  1995  neg  -28.05  all
96  1996  neg  -45.12  all
97  1997  neg   -4.88  all
98  1998  neg   -7.32  all
99  1999  neg  -59.76  all
100 2000  neg  -64.63  all
101 2001  neg   -4.88  all
102 2002  neg  -30.49  all
103 2003  neg  -64.63  all
104 2004  neg0.00  all
105 2005  neg  -63.41  all
106 2006  neg  -13.41  all
107 2007  neg  -70.73  all
108 2008  neg  -21.95  all
109 2009  neg  -51.22  all
110 2010  neg  -34.15  all
111 2011  neg  -28.05  all
112 1901  poz0.00  all
113 1902  poz  100.00  all
114 1903  poz  100.00  all
115 1904  poz0.00  all
116 1905  poz0.00  all
117 1906  poz0.00  all
118 1907  poz   50.00  all
119 1908  poz   33.33  all
120 1909  poz   33.33  all
121 1910  poz   33.33  all
122 1911  poz0.00  all
123 1912  poz   33.33  all
124 1913  poz   25.00  all
125 1914  poz0.00  all
126 1915  poz   16.67  all
127 1916  poz   16.67  all
128 1917  poz   83.33  all
129 1918  poz   50.00  all
130 1919  poz   75.00  all
131 1920  poz   62.50  all
132 1921  poz   50.00  all
133 1922  poz   22.22  all
134 1923  poz   40.00  all
135 1924  poz   26.67  all
136 1925  poz   66.67  all
137 1926  poz   60.00  all
138 1927  poz   50.00  all
139 1928  poz   33.33  all
140 1929  poz   39.13  all
141 1930  poz   25.00  all
142 1931  poz   24.00  all
143 1932  poz   50.00  all
144 1933  poz   34.48  all
145 1934  poz   22.58  all
146 1935  poz   39.39  all
147 1936  poz   36.36  all
148 1937  poz   17.65  all
149 1938

[R] plot

2013-04-01 Thread Trying To learn again
Hi all if I plot a graph on R, I press on the plot Export/Save Plot as
Image

I change name on File name:

I select DirectoryBibliotecas\Documentos

And select Width 800 and Height 800

And finally save in format JPEG

It is posible to type code so that I can run my function and it is not
necessary to make it manually?

Thanks in advance.

[[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] plot

2013-04-01 Thread Sarah Goslee
See
?jpeg

Sarah

On Mon, Apr 1, 2013 at 12:05 PM, Trying To learn again
tryingtolearnag...@gmail.com wrote:
 Hi all if I plot a graph on R, I press on the plot Export/Save Plot as
 Image

 I change name on File name:

 I select DirectoryBibliotecas\Documentos

 And select Width 800 and Height 800

 And finally save in format JPEG

 It is posible to type code so that I can run my function and it is not
 necessary to make it manually?

 Thanks in advance.

 [[alternative HTML version deleted]]


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

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


Re: [R] plot

2013-04-01 Thread R. Michael Weylandt
On Mon, Apr 1, 2013 at 5:05 PM, Trying To learn again
tryingtolearnag...@gmail.com wrote:
 Hi all if I plot a graph on R, I press on the plot Export/Save Plot as
 Image

I assume this means you're using R-Studio?


 I change name on File name:

 I select DirectoryBibliotecas\Documentos

 And select Width 800 and Height 800

 And finally save in format JPEG

 It is posible to type code so that I can run my function and it is not
 necessary to make it manually?

Yes -- in fact that's the way you're supposed to do it and the
RStudio way you mentioned above is a shortcut.

E.g.,

jpeg()
plot(1:5)
dev.off()

Read ?jpeg for more details.

MW



 Thanks in advance.

 [[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] Is DUD available in nls()?

2013-04-01 Thread qi A
SAS has DUD (Does not Use Derivatives)/Secant Method for nonlinear
regression, does R offer this option for nonlinear regression?

I have read the helpfile for nls() and could not find such option, any
suggestion?

Thanks,

Derek

[[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] plot

2013-04-01 Thread David Winsemius

On Apr 1, 2013, at 9:26 AM, R. Michael Weylandt wrote:

 On Mon, Apr 1, 2013 at 5:05 PM, Trying To learn again
 tryingtolearnag...@gmail.com wrote:
 Hi all if I plot a graph on R, I press on the plot Export/Save Plot as
 Image
 
 I assume this means you're using R-Studio?
 
 
 I change name on File name:
 
 I select DirectoryBibliotecas\Documentos
 
 And select Width 800 and Height 800
 
 And finally save in format JPEG
 
 It is posible to type code so that I can run my function and it is not
 necessary to make it manually?
 
 Yes -- in fact that's the way you're supposed to do it and the
 RStudio way you mentioned above is a shortcut.

You might also try this if you have already tested your graphic instructions on 
an interactive device and want to see if you can save it to a different file 
device:

 dev.print(jpeg, file=test.jpeg, height=800,width=800)

 
 E.g.,
 
 jpeg()
 plot(1:5)
 dev.off()
 
 Read ?jpeg for more details.
 
 


David Winsemius
Alameda, CA, USA

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


Re: [R] Data frame question

2013-04-01 Thread arun
Hi,

Not sure if this is what you wanted:
activity- 
data.frame(Name=paste0(activity,LETTERS[1:5]),stringsAsFactors=FALSE)
dates1- 
data.frame(dat=as.Date(c(2013-02-01,2013-02-04,2013-02-05),format=%Y-%m-%d))
merge(dates1,activity)
#  dat  Name
#1  2013-02-01 activityA
#2  2013-02-04 activityA
#3  2013-02-05 activityA
#4  2013-02-01 activityB
#5  2013-02-04 activityB
#6  2013-02-05 activityB
#7  2013-02-01 activityC
#8  2013-02-04 activityC
#9  2013-02-05 activityC
#10 2013-02-01 activityD
#11 2013-02-04 activityD
#12 2013-02-05 activityD
#13 2013-02-01 activityE
#14 2013-02-04 activityE
#15 2013-02-05 activityE


#or
expand.grid(dat=dates1[,1],Name=activity[,1])
  dat  Name
#1  2013-02-01 activityA
#2  2013-02-04 activityA
#3  2013-02-05 activityA
#4  2013-02-01 activityB
#5  2013-02-04 activityB
#6  2013-02-05 activityB
#7  2013-02-01 activityC
#8  2013-02-04 activityC
#9  2013-02-05 activityC
#10 2013-02-01 activityD
#11 2013-02-04 activityD
#12 2013-02-05 activityD
#13 2013-02-01 activityE
#14 2013-02-04 activityE
#15 2013-02-05 activityE
A.K.



- Original Message -
From: ramoss ramine.mossad...@finra.org
To: r-help@r-project.org
Cc: 
Sent: Monday, April 1, 2013 11:54 AM
Subject: [R] Data frame question

Hello,

I have 2 data frames:  activity and dates.  Activity contains a l variable
listing all activities:  activityA, activityB etc.
The dates contain all the valid business dates.  I need to combine the 2 so
that I get a single data frame activitydat that contains the activity name
along w/ evevry valid business dates such as

Name          dat
activity A   2013-02-01
activity A  2013-02-04
activity A  2013-02-05
etc


Any thought?  Thanks ahead for your help.



--
View this message in context: 
http://r.789695.n4.nabble.com/Data-frame-question-tp4662967.html
Sent from the R help mailing list archive at Nabble.com.

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


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


[R] example to demonstrate benefits of poly in regression?

2013-04-01 Thread Paul Johnson
Here's my little discussion example for a quadratic regression:

http://pj.freefaculty.org/R/WorkingExamples/regression-quadratic-1.R

Students press me to know the benefits of poly() over the more obvious
regression formulas.

I think I understand the theory on why poly() should be more numerically
stable, but I'm having trouble writing down an example that proves the
benefit of this.

I am beginning to suspect that because R's lm uses a QR decomposition under
the hood, the instability that we used to see when we inverted (X'X) is no
longer so serious as it used to be. When the columns in X are

x1 x2 x3 x3squared

then the QR decomposition is doing about the same thing as we would do if
we replaced x3 and x3squared by the poly(x3, 2) results.

Or not. I'm not arguing that, I'm thinking out loud, hoping you'll correct
me.

pj


-- 
Paul E. Johnson
Professor, Political Science  Assoc. Director
1541 Lilac Lane, Room 504  Center for Research Methods
University of Kansas University of Kansas
http://pj.freefaculty.org   http://quant.ku.edu

[[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] lognormal sampleing using covariance matrix

2013-04-01 Thread Andras Farkas
Dear All,
 
wondering if someine can access the link to the randsamp code referenced in the 
R-help archive here: 
http://www.mail-archive.com/r-help@stat.math.ethz.ch/msg75645.html ? I have 
tried but for whatever reason I can not get trough. My problem seems to be 
similar to what the author originally described there, so having access to it 
would be great. Else, if you have any thougths on sampling from a distribution 
assumed to be log-normal with expected means + SD of 
 
a=5.04  + 0.56
b=1.89 + 0.19
c=0.43  + 0.08
d=0.44  + 0.07
 
and covariance matrix of:
 
   a    b       c    d
a   0.31
b   0.015  0.04   
c  -0.019   0.07    0.0064   
d  0.0069   -0.0069 -0.67 0.0048  
 
would be greatly appreciated. Can this be done with a function?I been working 
on this for months now but can not crack it. I can not find a package that has 
a function to deal with this. thanks,
 
Andras
[[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] example to demonstrate benefits of poly in regression?

2013-04-01 Thread Gabor Grothendieck
On Mon, Apr 1, 2013 at 1:20 PM, Paul Johnson pauljoh...@gmail.com wrote:
 Here's my little discussion example for a quadratic regression:

 http://pj.freefaculty.org/R/WorkingExamples/regression-quadratic-1.R

 Students press me to know the benefits of poly() over the more obvious
 regression formulas.

 I think I understand the theory on why poly() should be more numerically
 stable, but I'm having trouble writing down an example that proves the
 benefit of this.

 I am beginning to suspect that because R's lm uses a QR decomposition under
 the hood, the instability that we used to see when we inverted (X'X) is no
 longer so serious as it used to be. When the columns in X are

 x1 x2 x3 x3squared

 then the QR decomposition is doing about the same thing as we would do if
 we replaced x3 and x3squared by the poly(x3, 2) results.

 Or not. I'm not arguing that, I'm thinking out loud, hoping you'll correct
 me.


# 1. One benefit is if you fit a higher degree polynomial using
poly(x, n) the lower degree coefficients will agree with the fit using
a lower n.
# For example, compare these two:
set.seed(123)
y - rnorm(10); x - 1:10
lm(y ~ poly(x, 2))
lm(y ~ poly(x, 3))

# however, that is not true if you don't use orthogonal polynomials.
Compare these two:
lm(y ~ poly(x, 2, raw = TRUE))
lm(y ~ poly(x, 3, raw = TRUE))

# 2. A second advantage is that the t statistics are invariant under
shift if you use orthogonal polynomials
# compare these two:
summary(lm(y ~ poly(x, 2)))
summary(lm(y ~ poly(x+1, 2)))

# however, that is not true if you don;t use orthogonal polynomials,
Compare these two:
summary(lm(y ~ poly(x, 2, raw = TRUE)))
summary(lm(y ~ poly(x+1, 2, raw = TRUE)))

--
Statistics  Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com

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


Re: [R] Is DUD available in nls()?

2013-04-01 Thread Jeff Newmiller
a) Read the Posting Guide. It will tell you things like:
1) Don't post in HTML format. Adjust your email client appropriately.
2) Don't repost. Your emails are all there, looking silly next to each other.
3) Use the search facilities yourself, such as RSiteSearch().

b) Regarding your DUD algorithm, it doesn't sound familiar. There are many 
algorithms that don't use derivatives for optimization so it isn't clear that 
this is a referenceable label. The help file for nls mentions two algorithms 
that don't require derivatives. You might want to review the CRAN Task View on 
Optimization and Mathematical Programming if you want to know more about what 
is available in CRAN and base R.
---
Jeff NewmillerThe .   .  Go Live...
DCN:jdnew...@dcn.davis.ca.usBasics: ##.#.   ##.#.  Live Go...
  Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/BatteriesO.O#.   #.O#.  with
/Software/Embedded Controllers)   .OO#.   .OO#.  rocks...1k
--- 
Sent from my phone. Please excuse my brevity.

qi A send2...@gmail.com wrote:

SAS has DUD (Does not Use Derivatives)/Secant Method for nonlinear
regression, does R offer this option for nonlinear regression?

I have read the helpfile for nls() and could not find such option, any
suggestion?

Thanks,

Derek

   [[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] example to demonstrate benefits of poly in regression?

2013-04-01 Thread William Dunlap
Here is an example of the numerical instability that poly() can help with.  
Imagine a 100-minute experiment where you chose to record the times as POSIXt 
objects (stored as seconds since 1970).  Using poly() gives the right predicted 
values, but using I(x^2) does not:

 d - data.frame(Date=as.POSIXct(2013-04-01)+60*(1:100), 
 yQuadratic=(function(x)5*x-4*x^2)( (1:100)/50 ))
 d$NumDate - as.numeric(d$Date)
 newD - d[c(10, 80, 95),]
 cbind(newD, 
 PQuadratic=predict(lm(yQuadratic~NumDate+I(NumDate^2),data=d),newdata=newD))
  Date yQuadraticNumDate PQuadratic
10 2013-04-01 00:10:00   0.84 1364800200 2.1312
80 2013-04-01 01:20:00  -2.24 1364804400-2.1808
95 2013-04-01 01:35:00  -4.94 1364805300-3.1048
Warning message:
In predict.lm(lm(yQuadratic ~ NumDate + I(NumDate^2), data = d),  :
  prediction from a rank-deficient fit may be misleading
 cbind(newD, 
 PQuadratic=predict(lm(yQuadratic~poly(NumDate,2),data=d),newdata=newD))
  Date yQuadraticNumDate PQuadratic
10 2013-04-01 00:10:00   0.84 1364800200   0.84
80 2013-04-01 01:20:00  -2.24 1364804400  -2.24
95 2013-04-01 01:35:00  -4.94 1364805300  -4.94

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com


 -Original Message-
 From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On 
 Behalf
 Of Paul Johnson
 Sent: Monday, April 01, 2013 10:21 AM
 To: R-help
 Subject: [R] example to demonstrate benefits of poly in regression?
 
 Here's my little discussion example for a quadratic regression:
 
 http://pj.freefaculty.org/R/WorkingExamples/regression-quadratic-1.R
 
 Students press me to know the benefits of poly() over the more obvious
 regression formulas.
 
 I think I understand the theory on why poly() should be more numerically
 stable, but I'm having trouble writing down an example that proves the
 benefit of this.
 
 I am beginning to suspect that because R's lm uses a QR decomposition under
 the hood, the instability that we used to see when we inverted (X'X) is no
 longer so serious as it used to be. When the columns in X are
 
 x1 x2 x3 x3squared
 
 then the QR decomposition is doing about the same thing as we would do if
 we replaced x3 and x3squared by the poly(x3, 2) results.
 
 Or not. I'm not arguing that, I'm thinking out loud, hoping you'll correct
 me.
 
 pj
 
 
 --
 Paul E. Johnson
 Professor, Political Science  Assoc. Director
 1541 Lilac Lane, Room 504  Center for Research Methods
 University of Kansas University of Kansas
 http://pj.freefaculty.org   http://quant.ku.edu
 
   [[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] Is DUD available in nls()?

2013-04-01 Thread Bert Gunter
I certainly second all Jeff's comments.

**HOWEVER** :
http://www.tandfonline.com/doi/pdf/10.1080/00401706.1978.10489610

IIRC, DUD's provenance is old, being originally a BMDP feature.

-- Bert

On Mon, Apr 1, 2013 at 10:59 AM, Jeff Newmiller jdnew...@dcn.davis.ca.uswrote:

 a) Read the Posting Guide. It will tell you things like:
 1) Don't post in HTML format. Adjust your email client appropriately.
 2) Don't repost. Your emails are all there, looking silly next to each
 other.
 3) Use the search facilities yourself, such as RSiteSearch().

 b) Regarding your DUD algorithm, it doesn't sound familiar. There are
 many algorithms that don't use derivatives for optimization so it isn't
 clear that this is a referenceable label. The help file for nls mentions
 two algorithms that don't require derivatives. You might want to review the
 CRAN Task View on Optimization and Mathematical Programming if you want to
 know more about what is available in CRAN and base R.
 ---
 Jeff NewmillerThe .   .  Go Live...
 DCN:jdnew...@dcn.davis.ca.usBasics: ##.#.   ##.#.  Live
 Go...
   Live:   OO#.. Dead: OO#..  Playing
 Research Engineer (Solar/BatteriesO.O#.   #.O#.  with
 /Software/Embedded Controllers)   .OO#.   .OO#.  rocks...1k
 ---
 Sent from my phone. Please excuse my brevity.

 qi A send2...@gmail.com wrote:

 SAS has DUD (Does not Use Derivatives)/Secant Method for nonlinear
 regression, does R offer this option for nonlinear regression?
 
 I have read the helpfile for nls() and could not find such option, any
 suggestion?
 
 Thanks,
 
 Derek
 
[[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.




-- 

Bert Gunter
Genentech Nonclinical Biostatistics

Internal Contact Info:
Phone: 467-7374
Website:
http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm

[[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] example to demonstrate benefits of poly in regression?

2013-04-01 Thread Paul Johnson
On Mon, Apr 1, 2013 at 12:42 PM, Gabor Grothendieck ggrothendi...@gmail.com
 wrote:

 On Mon, Apr 1, 2013 at 1:20 PM, Paul Johnson pauljoh...@gmail.com wrote:
  Here's my little discussion example for a quadratic regression:
 
  http://pj.freefaculty.org/R/WorkingExamples/regression-quadratic-1.R
 
  Students press me to know the benefits of poly() over the more obvious
  regression formulas.
 
  I think I understand the theory on why poly() should be more numerically
  stable, but I'm having trouble writing down an example that proves the
  benefit of this.
 
  I am beginning to suspect that because R's lm uses a QR decomposition
 under
  the hood, the instability that we used to see when we inverted (X'X) is
 no
  longer so serious as it used to be. When the columns in X are
 
  x1 x2 x3 x3squared
 
  then the QR decomposition is doing about the same thing as we would do if
  we replaced x3 and x3squared by the poly(x3, 2) results.
 
  Or not. I'm not arguing that, I'm thinking out loud, hoping you'll
 correct
  me.
 

 # 1. One benefit is if you fit a higher degree polynomial using
 poly(x, n) the lower degree coefficients will agree with the fit using
 a lower n.
 # For example, compare these two:
 set.seed(123)
 y - rnorm(10); x - 1:10
 lm(y ~ poly(x, 2))
 lm(y ~ poly(x, 3))

 # however, that is not true if you don't use orthogonal polynomials.
 Compare these two:
 lm(y ~ poly(x, 2, raw = TRUE))
 lm(y ~ poly(x, 3, raw = TRUE))


Thanks, Gabor:

As usual, you are very helpful. I can't thank you enough.

I'm pasting your comments to the end of that R example file I mentioned
before, changing the examples to fit with the variable names I use there.

I think your reason #2 is the prize winner, I can't see anything wrong with
that one.

Reason #1 is not quite as strong, only holds strictly if the poly() is the
only predictor.  Users usually have other variables in the model.

If you--or anybody else--has other ideas about this, I am delighted to hear
your ideas.  I still hold out hope that the numerical stability argument
will find some traction.

pj



 # 2. A second advantage is that the t statistics are invariant under
 shift if you use orthogonal polynomials
 # compare these two:
 summary(lm(y ~ poly(x, 2)))
 summary(lm(y ~ poly(x+1, 2)))

 # however, that is not true if you don;t use orthogonal polynomials,
 Compare these two:
 summary(lm(y ~ poly(x, 2, raw = TRUE)))
 summary(lm(y ~ poly(x+1, 2, raw = TRUE)))

 --
 Statistics  Software Consulting
 GKX Group, GKX Associates Inc.
 tel: 1-877-GKX-GROUP
 email: ggrothendieck at gmail.com




-- 
Paul E. Johnson
Professor, Political Science  Assoc. Director
1541 Lilac Lane, Room 504  Center for Research Methods
University of Kansas University of Kansas
http://pj.freefaculty.org   http://quant.ku.edu

[[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] plm: Hausman Test error

2013-04-01 Thread londonphd
Hi, I am trying to run a panel regression using 88 observations and 9
variables. In-built Hausman Test did not work, then I found a code for
auxiliary regression method for the Hausman test. 

The panel models are:

fe=plm(gd ~ l+g+o+c+g1+h+n+r, model = within, data = new.frame,index =
c(id))
re=plm(gd ~ l+g+o+c+g1+h+n+r, model = random, data = new.frame,index =
c(id),random.method=amemiya)


then I wrote the following function for the Hausman Test using an auxiliary
regression method:

hmtest=function(re=0,fe=0){
y.re=pmodel.response(re) 
X.re=model.matrix(re) 
X.fe=model.matrix(fe)
auxdata-data.frame(cbind(y.re,X.re,X.fe)) 
colnames(auxdata)-c(y, paste(x, 1:17, sep=)) 
   
auxmod-lm(y~x1+x2+x3+x4+x5+x6+x7+x8+x9+x10+x11+x12+x13+x14+x15+x16+x17-1,
auxdata) 
   return(waldtest(auxmod, 10:17)[2,4])
}


using the function above to choose between fe and re
hmtest(re,fe)

Error in solve(vc[ovar, ovar]) : subscript out of bounds


Not sure what's gone wrong this time. I would appreciate your comments!



--
View this message in context: 
http://r.789695.n4.nabble.com/plm-Hausman-Test-error-tp4662980.html
Sent from the R help mailing list archive at Nabble.com.

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


[R] robust function

2013-04-01 Thread Yolanda

I need to use the next robust functions:  t1way, box1way and lincon.
I don't find these funcions in any library.
What libraries do I have to install?

Thanks.

Yolanda

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Factor to numeric conversion - as.numeric(as.character(f))[f] - Language definition seems to say to not use this.

2013-04-01 Thread Matthew Lundberg
These two seem to be at odds.  Is this the case?

From help(factor) - section Warning:

To transform a factor f to approximately its original numeric values,
as.numeric(levels(f))[f] is recommended and slightly more efficient than
as.numeric(as.character(f)).

From the language definition - section 2.3.1:

Factors are currently implemented using an integer array to specify the
actual levels and
a second array of names that are mapped to the integers. Rather
unfortunately users often
make use of the implementation in order to make some calculations easier.
This, however,
is an implementation issue and is not guaranteed to hold in all
implementations of R.

[[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] plot

2013-04-01 Thread Trying To learn again
Hi Many Thanks to all.

 dev.print(jpeg, file=test.jpeg, height=800,width=800)

Works perfectly it saves in the default directory the jpeg file.

I use RStudio.

Many Thanks.


2013/4/1 David Winsemius dwinsem...@comcast.net


 On Apr 1, 2013, at 9:26 AM, R. Michael Weylandt wrote:

  On Mon, Apr 1, 2013 at 5:05 PM, Trying To learn again
  tryingtolearnag...@gmail.com wrote:
  Hi all if I plot a graph on R, I press on the plot Export/Save Plot as
  Image
 
  I assume this means you're using R-Studio?
 
 
  I change name on File name:
 
  I select DirectoryBibliotecas\Documentos
 
  And select Width 800 and Height 800
 
  And finally save in format JPEG
 
  It is posible to type code so that I can run my function and it is not
  necessary to make it manually?
 
  Yes -- in fact that's the way you're supposed to do it and the
  RStudio way you mentioned above is a shortcut.

 You might also try this if you have already tested your graphic
 instructions on an interactive device and want to see if you can save it to
 a different file device:

  dev.print(jpeg, file=test.jpeg, height=800,width=800)

 
  E.g.,
 
  jpeg()
  plot(1:5)
  dev.off()
 
  Read ?jpeg for more details.
 
 


 David Winsemius
 Alameda, CA, USA



[[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] 95% Confidence Interval for a p-p plot

2013-04-01 Thread pablo.castano
Hi,

I want to create upper and lower 95% confidence intervals for a p-p plot of
an empirical distribution with a theoretical gamma distribution.

This is my code: 

x-rgamma(100,shape=2, rate=1) # empirical data
fitdistr(x,gamma) # fit a gamma distribution
dist-pgamma(x,shape=1.9884256 ,rate=0.8765314 ) # fitted distribution,
using the loglikelihood estimated parameters plot(ppoints(n=100),
sort(dist)) # create p-p plot 
abline(0,1) # diagonal line to check fit

Is there an implementation of the delta method in R that I could use for
this in order to estimate the variance of the predicted probability ?


Regards



--
View this message in context: 
http://r.789695.n4.nabble.com/95-Confidence-Interval-for-a-p-p-plot-tp4662982.html
Sent from the R help mailing list archive at Nabble.com.

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


Re: [R] Factor to numeric conversion - as.numeric(as.character(f))[f] - Language definition seems to say to not use this.

2013-04-01 Thread Ista Zahn
Hi Mathew,

In what way are they at odds?

On Mon, Apr 1, 2013 at 1:48 PM, Matthew Lundberg
matthew.k.lundb...@gmail.com wrote:
 These two seem to be at odds.  Is this the case?

 From help(factor) - section Warning:

 To transform a factor f to approximately its original numeric values,
 as.numeric(levels(f))[f] is recommended and slightly more efficient than
 as.numeric(as.character(f)).

 From the language definition - section 2.3.1:

 Factors are currently implemented using an integer array to specify the
 actual levels and
 a second array of names that are mapped to the integers. Rather
 unfortunately users often
 make use of the implementation in order to make some calculations easier.
 This, however,
 is an implementation issue and is not guaranteed to hold in all
 implementations of R.

 [[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] Factor to numeric conversion - as.numeric(as.character(f))[f] - Language definition seems to say to not use this.

2013-04-01 Thread Peter Ehlers

On 2013-04-01 10:48, Matthew Lundberg wrote:

These two seem to be at odds.  Is this the case?


From help(factor) - section Warning:


To transform a factor f to approximately its original numeric values,
as.numeric(levels(f))[f] is recommended and slightly more efficient than
as.numeric(as.character(f)).


From the language definition - section 2.3.1:


Factors are currently implemented using an integer array to specify the
actual levels and
a second array of names that are mapped to the integers. Rather
unfortunately users often
make use of the implementation in order to make some calculations easier.
This, however,
is an implementation issue and is not guaranteed to hold in all
implementations of R.


Hint:

 f - factor(sample(5, 10, TRUE))
 as.numeric(levels(f))[f]

 g - factor(sample(letters[1:5], 10, TRUE))
 as.numeric(levels(g))[g]

Peter Ehlers



[[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] robust function

2013-04-01 Thread David Winsemius

On Apr 1, 2013, at 10:22 AM, Yolanda wrote:

 I need to use the next robust functions:  t1way, box1way and lincon.
 I don't find these funcions in any library.

Try:

pkg:WRS

install.packages(WRS, repos=http://R-Forge.R-project.org;, type=source))


 What libraries do I have to install?

There is some sensitivity about terminology in the R culture. They are 
'packages'. Libraries are where packages are located.

-- 

David Winsemius
Alameda, CA, USA

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


Re: [R] Factor to numeric conversion - as.numeric(as.character(f))[f] - Language definition seems to say to not use this.

2013-04-01 Thread Matthew Lundberg
When used as an index, the factor is implicitly converted to integer.  In
the expression as.numeric(levels(f))[f], the vector as.numeric(levels(f))
is indexed by as.integer(f).

This appears to rely on the current implementation, as mentioned in section
2.3.1 of the language definition.


On Mon, Apr 1, 2013 at 1:49 PM, Peter Ehlers ehl...@ucalgary.ca wrote:

 On 2013-04-01 10:48, Matthew Lundberg wrote:

 These two seem to be at odds.  Is this the case?

  From help(factor) - section Warning:


 To transform a factor f to approximately its original numeric values,
 as.numeric(levels(f))[f] is recommended and slightly more efficient than
 as.numeric(as.character(f)).

  From the language definition - section 2.3.1:


 Factors are currently implemented using an integer array to specify the
 actual levels and
 a second array of names that are mapped to the integers. Rather
 unfortunately users often
 make use of the implementation in order to make some calculations easier.
 This, however,
 is an implementation issue and is not guaranteed to hold in all
 implementations of R.


 Hint:

  f - factor(sample(5, 10, TRUE))
  as.numeric(levels(f))[f]

  g - factor(sample(letters[1:5], 10, TRUE))
  as.numeric(levels(g))[g]

 Peter Ehlers



 [[alternative HTML version deleted]]

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




[[alternative HTML version deleted]]

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


[R] expression

2013-04-01 Thread Jose Narillos de Santos
Hi all,

I´m using


titt- expression(paste(R con ventanas de 200 , italic(datos)))

And it works properly on a plot(...,main=titt,..)

But if I want to add an improvement to avoid typing n on the plot so that

n-200

titt- expression(paste(R con ventanas de ,n,  italic(datos)))

It doesn´t recognize that n is a variable and adds n letter instead of
200 on the plot when run:

plot(...,main=titt,..)

How can I include n in the plot authomatically without loosing the italic
letter?

[[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] Factor to numeric conversion - as.numeric(as.character(f))[f] - Language definition seems to say to not use this.

2013-04-01 Thread Bert Gunter
Yup. Note also:

 as.character.factor
function (x, ...)
levels(x)[x]

But of course this is OK, since this can change if the implementation
does. Which is the whole point, of course.

-- Bert



On Mon, Apr 1, 2013 at 12:16 PM, Matthew Lundberg
matthew.k.lundb...@gmail.com wrote:

 When used as an index, the factor is implicitly converted to integer.  In
 the expression as.numeric(levels(f))[f], the vector as.numeric(levels(f))
 is indexed by as.integer(f).

 This appears to rely on the current implementation, as mentioned in section
 2.3.1 of the language definition.


 On Mon, Apr 1, 2013 at 1:49 PM, Peter Ehlers ehl...@ucalgary.ca wrote:

  On 2013-04-01 10:48, Matthew Lundberg wrote:
 
  These two seem to be at odds.  Is this the case?
 
   From help(factor) - section Warning:
 
 
  To transform a factor f to approximately its original numeric values,
  as.numeric(levels(f))[f] is recommended and slightly more efficient than
  as.numeric(as.character(f)).
 
   From the language definition - section 2.3.1:
 
 
  Factors are currently implemented using an integer array to specify the
  actual levels and
  a second array of names that are mapped to the integers. Rather
  unfortunately users often
  make use of the implementation in order to make some calculations easier.
  This, however,
  is an implementation issue and is not guaranteed to hold in all
  implementations of R.
 
 
  Hint:
 
   f - factor(sample(5, 10, TRUE))
   as.numeric(levels(f))[f]
 
   g - factor(sample(letters[1:5], 10, TRUE))
   as.numeric(levels(g))[g]
 
  Peter Ehlers
 
 
 
  [[alternative HTML version deleted]]
 
  __**
  R-help@r-project.org mailing list
  https://stat.ethz.ch/mailman/**listinfo/r-helphttps://stat.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide http://www.R-project.org/**
  posting-guide.html 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.




--

Bert Gunter
Genentech Nonclinical Biostatistics

Internal Contact Info:
Phone: 467-7374
Website:
http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm

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


Re: [R] expression

2013-04-01 Thread Bert Gunter
?plotmath

tells you how.

-- Bert

On Mon, Apr 1, 2013 at 12:46 PM, Jose Narillos de Santos
narillosdesan...@gmail.com wrote:
 Hi all,

 I惴 using


 titt- expression(paste(R con ventanas de 200 , italic(datos)))

 And it works properly on a plot(...,main=titt,..)

 But if I want to add an improvement to avoid typing n on the plot so that

 n-200

 titt- expression(paste(R con ventanas de ,n,  italic(datos)))

 It doesn愒 recognize that n is a variable and adds n letter instead of
 200 on the plot when run:

 plot(...,main=titt,..)

 How can I include n in the plot authomatically without loosing the italic
 letter?

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




-- 

Bert Gunter
Genentech Nonclinical Biostatistics

Internal Contact Info:
Phone: 467-7374
Website:
http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm

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


Re: [R] Factor to numeric conversion - as.numeric(levels(f))[f] - Language definition seems to say to not use this.

2013-04-01 Thread Matthew Lundberg
Note the edited subject line!  I don't know why I typed it as it was before.

This says that as.numeric(as.character(f)) will work regardless of the
implementation, and I agree.

It's the recommendation to use as.numeric(levels(f))[f] that has me
wondering about section 2.3.1 of the language definition.  I expect that
this idiom is in widespread use, and perhaps the language definition should
be changed.


On Mon, Apr 1, 2013 at 2:58 PM, Bert Gunter gunter.ber...@gene.com wrote:

 Yup. Note also:

  as.character.factor
 function (x, ...)
 levels(x)[x]

 But of course this is OK, since this can change if the implementation
 does. Which is the whole point, of course.

 -- Bert



 On Mon, Apr 1, 2013 at 12:16 PM, Matthew Lundberg
 matthew.k.lundb...@gmail.com wrote:
 
  When used as an index, the factor is implicitly converted to integer.  In
  the expression as.numeric(levels(f))[f], the vector as.numeric(levels(f))
  is indexed by as.integer(f).
 
  This appears to rely on the current implementation, as mentioned in
 section
  2.3.1 of the language definition.
 
 
  On Mon, Apr 1, 2013 at 1:49 PM, Peter Ehlers ehl...@ucalgary.ca wrote:
 
   On 2013-04-01 10:48, Matthew Lundberg wrote:
  
   These two seem to be at odds.  Is this the case?
  
From help(factor) - section Warning:
  
  
   To transform a factor f to approximately its original numeric values,
   as.numeric(levels(f))[f] is recommended and slightly more efficient
 than
   as.numeric(as.character(f)).
  
From the language definition - section 2.3.1:
  
  
   Factors are currently implemented using an integer array to specify
 the
   actual levels and
   a second array of names that are mapped to the integers. Rather
   unfortunately users often
   make use of the implementation in order to make some calculations
 easier.
   This, however,
   is an implementation issue and is not guaranteed to hold in all
   implementations of R.
  
  
   Hint:
  
f - factor(sample(5, 10, TRUE))
as.numeric(levels(f))[f]
  
g - factor(sample(letters[1:5], 10, TRUE))
as.numeric(levels(g))[g]
  
   Peter Ehlers
  
  
  
   [[alternative HTML version deleted]]
  
   __**
   R-help@r-project.org mailing list
   https://stat.ethz.ch/mailman/**listinfo/r-help
 https://stat.ethz.ch/mailman/listinfo/r-help
   PLEASE do read the posting guide http://www.R-project.org/**
   posting-guide.html 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.




 --

 Bert Gunter
 Genentech Nonclinical Biostatistics

 Internal Contact Info:
 Phone: 467-7374
 Website:

 http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm


[[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] This day in history: R-help, R-devel and R-announce (1997-04-01)

2013-04-01 Thread Henrik Bengtsson
Today it's 16 years ago and 367,496 messages later since MartinMächler
started the R-help (321,119 msgs), R-devel (45,830 msgs) and
R-announce (547 msgs) mailing lists [1] - a great benefit to all of
us.  Special thanks to Martin and also thanks to everyone else
contributing to these forums.

[1] https://stat.ethz.ch/pipermail/r-help/1997-April/001490.html
attachment: r-help,r-devel.png__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Console display buffer size

2013-04-01 Thread Ted Harding
Greetings All.
This is a somewhat generic query (I'm really asking on behalf
of a friend who uses R on Windows, whereas I'm on Linux, but
the same phenomenon appears on both).

Say one has a largish dataframe -- call it G -- which in the
case under discussion has 592 rows and 41 columns. The intention
is to display the data by simply entering its name (G) as command.

Say the display console has been set wide enough to display 15
columns (determined by lengths of column names). Then R will output
succesively to the console, in continuous flow:
  Chunk 1: rows 1:592 of columns 1:15
  Chunk 2: rows 1:592 of columns 16:30
  Chunk 3: rows 1:592 of columns 31:41
If the number of rows that can be displayed on the screen is, say, 60,
then only rows 533:592 of Chunk 3 will be visible in the first instance.

However, on my Linux system at any rate, I can use Shift+PgUp to
scroll back up through what has been output to the console. It seems
that my friend proceeds similarly.

But now, after a certain number of (Shift+PgUps), one runs out
of road before getting to Row 1 of Chunk 1 (in my friend's case,
only Rows 468-592 of Chunk 1 can be seen).

The explanation which occurs to me is that the console has a buffer
in which such an output is stored, and if the dataframe is too big
then lines 1:N (for some N) of the output are dropped from the start
of the buffer, and it is impossible to go further back than line (N+1)
of Chunk 1 where in this case N=467 (of course one may not even be
able to go further back than Chunk K, for some K  1, for a bigger
dataframe).

The query I have is: In the light of the above, is there a way to
change the size of the buffer so that one can scroll all the way
back to the very first row of Chunk 1? (The size-change may perhaps
have to be determined empirically).

With thanks,
Ted.

-
E-Mail: (Ted Harding) ted.hard...@wlandres.net
Date: 01-Apr-2013  Time: 21:37:17
This message was sent by XFMail

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


[R] Help Please, ggplot2

2013-04-01 Thread David Lyon
library(ggplot2)
a- read.table(data, header=T)
b = na.omit(a)
ggplot(data=b) + geom_line(aes(x=timepoint, y=value,group=sample, colour= 
factor(sample))) +  geom_point(aes(x=timepoint, y=value, group=s
ample)) + facet_wrap(~bio, scales = free,ncol = 5) +theme_bw() + 
opts(legend.direction = horizontal,    legend.position = top, 
legend.background = theme_blank()) +  labs(fill=)
dev.off()


This generates one nice plot with many many plots in 1 file.
How do I modify the code to split up the plots into single file instead of 
merging them in 1 file I want each plot to be in a separate file ?

Thanks in advance


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


Re: [R] expression

2013-04-01 Thread William Dunlap
Use bquote(), as in
  n - 200
  titt - bquote(paste(R con ventanas de , .(n),  , italic(datos)))
or, using ~ instead of paste(),
  titt - bquote(R con ventanas de  ~ .(n) ~ italic(datos))
  plot(1, 1, main=titt) 

The notation .(xxx) means to replace xxx by the value of the variable called 
xxx.

You can also use bquote() instead of expression in the simple (no variables) 
case.

Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com


 -Original Message-
 From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On 
 Behalf
 Of Jose Narillos de Santos
 Sent: Monday, April 01, 2013 12:46 PM
 To: r-help
 Subject: [R] expression
 
 Hi all,
 
 I´m using
 
 
 titt- expression(paste(R con ventanas de 200 , italic(datos)))
 
 And it works properly on a plot(...,main=titt,..)
 
 But if I want to add an improvement to avoid typing n on the plot so that
 
 n-200
 
 titt- expression(paste(R con ventanas de ,n,  italic(datos)))
 
 It doesn´t recognize that n is a variable and adds n letter instead of
 200 on the plot when run:
 
 plot(...,main=titt,..)
 
 How can I include n in the plot authomatically without loosing the italic
 letter?
 
   [[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] Console display buffer size

2013-04-01 Thread Peter Ehlers

On 2013-04-01 13:37, Ted Harding wrote:

Greetings All.
This is a somewhat generic query (I'm really asking on behalf
of a friend who uses R on Windows, whereas I'm on Linux, but
the same phenomenon appears on both).

Say one has a largish dataframe -- call it G -- which in the
case under discussion has 592 rows and 41 columns. The intention
is to display the data by simply entering its name (G) as command.

Say the display console has been set wide enough to display 15
columns (determined by lengths of column names). Then R will output
succesively to the console, in continuous flow:
   Chunk 1: rows 1:592 of columns 1:15
   Chunk 2: rows 1:592 of columns 16:30
   Chunk 3: rows 1:592 of columns 31:41
If the number of rows that can be displayed on the screen is, say, 60,
then only rows 533:592 of Chunk 3 will be visible in the first instance.

However, on my Linux system at any rate, I can use Shift+PgUp to
scroll back up through what has been output to the console. It seems
that my friend proceeds similarly.

But now, after a certain number of (Shift+PgUps), one runs out
of road before getting to Row 1 of Chunk 1 (in my friend's case,
only Rows 468-592 of Chunk 1 can be seen).

The explanation which occurs to me is that the console has a buffer
in which such an output is stored, and if the dataframe is too big
then lines 1:N (for some N) of the output are dropped from the start
of the buffer, and it is impossible to go further back than line (N+1)
of Chunk 1 where in this case N=467 (of course one may not even be
able to go further back than Chunk K, for some K  1, for a bigger
dataframe).

The query I have is: In the light of the above, is there a way to
change the size of the buffer so that one can scroll all the way
back to the very first row of Chunk 1? (The size-change may perhaps
have to be determined empirically).


Isn't this set by the 'bufbytes' and 'buflines' specifications in the
Rconsole file?
Anyway, it's probably best to use 'View' to inspect data.

Peter Ehlers



With thanks,
Ted.

-
E-Mail: (Ted Harding) ted.hard...@wlandres.net
Date: 01-Apr-2013  Time: 21:37:17
This message was sent by XFMail

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



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


Re: [R] expression

2013-04-01 Thread Peter Ehlers

On 2013-04-01 12:46, Jose Narillos de Santos wrote:

Hi all,

I´m using


titt- expression(paste(R con ventanas de 200 , italic(datos)))

And it works properly on a plot(...,main=titt,..)

But if I want to add an improvement to avoid typing n on the plot so that

n-200

titt- expression(paste(R con ventanas de ,n,  italic(datos)))

It doesn´t recognize that n is a variable and adds n letter instead of
200 on the plot when run:

plot(...,main=titt,..)

How can I include n in the plot authomatically without loosing the italic
letter?


titt - bquote(R con ventanas de  ~ .(n) ~ italic(datos))

and I usually find it much more flexible to add the title with a
separate title(titt) call.

Peter Ehlers

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

2013-04-01 Thread Jeff Newmiller
Your example is not reproducible [1]. We don't know what device you are writing 
to, and we don't have your data or even a subset of it.

However, facet_wrap is not used for generating separate graphs. You will need 
to make some kind of loop construct (for or lapply) that opens the device, 
prints the plot of a subset of the data (without faceting), and closes the 
device, for each group in your data. 

[1] 
http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example
---
Jeff NewmillerThe .   .  Go Live...
DCN:jdnew...@dcn.davis.ca.usBasics: ##.#.   ##.#.  Live Go...
  Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/BatteriesO.O#.   #.O#.  with
/Software/Embedded Controllers)   .OO#.   .OO#.  rocks...1k
--- 
Sent from my phone. Please excuse my brevity.

David Lyon david_ly...@yahoo.com wrote:

library(ggplot2)
a- read.table(data, header=T)
b = na.omit(a)
ggplot(data=b) + geom_line(aes(x=timepoint, y=value,group=sample,
colour= factor(sample))) +  geom_point(aes(x=timepoint, y=value,
group=s
ample)) + facet_wrap(~bio, scales = free,ncol = 5) +theme_bw() +
opts(legend.direction = horizontal,    legend.position = top,
legend.background = theme_blank()) +  labs(fill=)
dev.off()


This generates one nice plot with many many plots in 1 file.
How do I modify the code to split up the plots into single file instead
of merging them in 1 file I want each plot to be in a separate file ?

Thanks in advance


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

2013-04-01 Thread Robert Baer

On 4/1/2013 4:08 PM, Peter Ehlers wrote:

On 2013-04-01 13:37, Ted Harding wrote:

Greetings All.
This is a somewhat generic query (I'm really asking on behalf
of a friend who uses R on Windows, whereas I'm on Linux, but
the same phenomenon appears on both).

Say one has a largish dataframe -- call it G -- which in the
case under discussion has 592 rows and 41 columns. The intention
is to display the data by simply entering its name (G) as command.

Say the display console has been set wide enough to display 15
columns (determined by lengths of column names). Then R will output
succesively to the console, in continuous flow:
   Chunk 1: rows 1:592 of columns 1:15
   Chunk 2: rows 1:592 of columns 16:30
   Chunk 3: rows 1:592 of columns 31:41
If the number of rows that can be displayed on the screen is, say, 60,
then only rows 533:592 of Chunk 3 will be visible in the first instance.

However, on my Linux system at any rate, I can use Shift+PgUp to
scroll back up through what has been output to the console. It seems
that my friend proceeds similarly.

But now, after a certain number of (Shift+PgUps), one runs out
of road before getting to Row 1 of Chunk 1 (in my friend's case,
only Rows 468-592 of Chunk 1 can be seen).

The explanation which occurs to me is that the console has a buffer
in which such an output is stored, and if the dataframe is too big
then lines 1:N (for some N) of the output are dropped from the start
of the buffer, and it is impossible to go further back than line (N+1)
of Chunk 1 where in this case N=467 (of course one may not even be
able to go further back than Chunk K, for some K  1, for a bigger
dataframe).

The query I have is: In the light of the above, is there a way to
change the size of the buffer so that one can scroll all the way
back to the very first row of Chunk 1? (The size-change may perhaps
have to be determined empirically).


Isn't this set by the 'bufbytes' and 'buflines' specifications in the
Rconsole file?
Anyway, it's probably best to use 'View' to inspect data.

Although I have not tried them, Windows RGUI  [ -- Edit | GUI 
Preferences --] has settings for both buffer and lines which on my 
64-bit machine default to 25 and 8000 respectively.


Rob Baer


Peter Ehlers



With thanks,
Ted.

-
E-Mail: (Ted Harding) ted.hard...@wlandres.net
Date: 01-Apr-2013  Time: 21:37:17
This message was sent by XFMail

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

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



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

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



--

Robert W. Baer, Ph.D.
Professor of Physiology
Kirksille College of Osteopathic Medicine
A. T. Still University of Health Sciences
Kirksville, MO 63501 USA

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


Re: [R] Factor to numeric conversion - as.numeric(levels(f))[f] - Language definition seems to say to not use this.

2013-04-01 Thread Peter Ehlers

On 2013-04-01 13:08, Matthew Lundberg wrote:

Note the edited subject line!  I don't know why I typed it as it was before.

This says that as.numeric(as.character(f)) will work regardless of the
implementation, and I agree.

It's the recommendation to use as.numeric(levels(f))[f] that has me
wondering about section 2.3.1 of the language definition.  I expect that
this idiom is in widespread use, and perhaps the language definition
should be changed.


I think that I may be getting an inkling of what your complaint is:
section 2.3.1 talks about
 an integer array to specify the _actual_ levels [emphasis added]
and
 a second array of _names_ that are mapped to the integers. [ditto]

When you object to the use of as.numeric(levels(f))[f], are you
assuming that levels(f) is the set of _integers_ or the set of
_names_?

Anyway, it's indeed the set of names, as returned by the levels()
function.

Peter Ehlers




On Mon, Apr 1, 2013 at 2:58 PM, Bert Gunter gunter.ber...@gene.com
mailto:gunter.ber...@gene.com wrote:

Yup. Note also:

  as.character.factor
function (x, ...)
levels(x)[x]

But of course this is OK, since this can change if the implementation
does. Which is the whole point, of course.

-- Bert



On Mon, Apr 1, 2013 at 12:16 PM, Matthew Lundberg
matthew.k.lundb...@gmail.com mailto:matthew.k.lundb...@gmail.com
wrote:
 
  When used as an index, the factor is implicitly converted to
integer.  In
  the expression as.numeric(levels(f))[f], the vector
as.numeric(levels(f))
  is indexed by as.integer(f).
 
  This appears to rely on the current implementation, as mentioned
in section
  2.3.1 of the language definition.
 
 
  On Mon, Apr 1, 2013 at 1:49 PM, Peter Ehlers ehl...@ucalgary.ca
mailto:ehl...@ucalgary.ca wrote:
 
   On 2013-04-01 10:48, Matthew Lundberg wrote:
  
   These two seem to be at odds.  Is this the case?
  
From help(factor) - section Warning:
  
  
   To transform a factor f to approximately its original numeric
values,
   as.numeric(levels(f))[f] is recommended and slightly more
efficient than
   as.numeric(as.character(f)).
  
From the language definition - section 2.3.1:
  
  
   Factors are currently implemented using an integer array to
specify the
   actual levels and
   a second array of names that are mapped to the integers. Rather
   unfortunately users often
   make use of the implementation in order to make some
calculations easier.
   This, however,
   is an implementation issue and is not guaranteed to hold in all
   implementations of R.
  
  
   Hint:
  
f - factor(sample(5, 10, TRUE))
as.numeric(levels(f))[f]
  
g - factor(sample(letters[1:5], 10, TRUE))
as.numeric(levels(g))[g]
  
   Peter Ehlers
  
  
  
   [[alternative HTML version deleted]]
  
   __**
   R-help@r-project.org mailto:R-help@r-project.org mailing list
  

https://stat.ethz.ch/mailman/**listinfo/r-helphttps://stat.ethz.ch/mailman/listinfo/r-help
   PLEASE do read the posting guide http://www.R-project.org/**
   posting-guide.html 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 mailto:R-help@r-project.org mailing list
  https://stat.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
  and provide commented, minimal, self-contained, reproducible code.




--

Bert Gunter
Genentech Nonclinical Biostatistics

Internal Contact Info:
Phone: 467-7374
Website:

http://pharmadevelopment.roche.com/index/pdb/pdb-functional-groups/pdb-biostatistics/pdb-ncb-home.htm




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


[R] Left join in R

2013-04-01 Thread ramoss
I have never used the data.table package.  I am trying to do the following
SQL left join  in R

create table all as select a.*
from dates b left outerjoin activitycount a on
a.tdate=b.tdate 
 and a.activity=b.activity

I found the following example but cannot figure out  the syntax:

le - Y[X]
mallx - merge(X,Y, all.x = T)
# the column order is different so change to be the same as `merge`
setcolorder(le, names(mallx))
identical(le,mallx)
# [1] TRUE

Can anyone help?  Thanks.
  



--
View this message in context: 
http://r.789695.n4.nabble.com/Left-join-in-R-tp4663018.html
Sent from the R help mailing list archive at Nabble.com.

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


Re: [R] Console display buffer size

2013-04-01 Thread Ted Harding
On 01-Apr-2013 21:26:07 Robert Baer wrote:
 On 4/1/2013 4:08 PM, Peter Ehlers wrote:
 On 2013-04-01 13:37, Ted Harding wrote:
 Greetings All.
 This is a somewhat generic query (I'm really asking on behalf
 of a friend who uses R on Windows, whereas I'm on Linux, but
 the same phenomenon appears on both).

 Say one has a largish dataframe -- call it G -- which in the
 case under discussion has 592 rows and 41 columns. The intention
 is to display the data by simply entering its name (G) as command.

 Say the display console has been set wide enough to display 15
 columns (determined by lengths of column names). Then R will output
 succesively to the console, in continuous flow:
Chunk 1: rows 1:592 of columns 1:15
Chunk 2: rows 1:592 of columns 16:30
Chunk 3: rows 1:592 of columns 31:41
 If the number of rows that can be displayed on the screen is, say, 60,
 then only rows 533:592 of Chunk 3 will be visible in the first instance.

 However, on my Linux system at any rate, I can use Shift+PgUp to
 scroll back up through what has been output to the console. It seems
 that my friend proceeds similarly.

 But now, after a certain number of (Shift+PgUps), one runs out
 of road before getting to Row 1 of Chunk 1 (in my friend's case,
 only Rows 468-592 of Chunk 1 can be seen).

 The explanation which occurs to me is that the console has a buffer
 in which such an output is stored, and if the dataframe is too big
 then lines 1:N (for some N) of the output are dropped from the start
 of the buffer, and it is impossible to go further back than line (N+1)
 of Chunk 1 where in this case N=467 (of course one may not even be
 able to go further back than Chunk K, for some K  1, for a bigger
 dataframe).

 The query I have is: In the light of the above, is there a way to
 change the size of the buffer so that one can scroll all the way
 back to the very first row of Chunk 1? (The size-change may perhaps
 have to be determined empirically).

 Isn't this set by the 'bufbytes' and 'buflines' specifications in the
 Rconsole file?
 Anyway, it's probably best to use 'View' to inspect data.

 Although I have not tried them, Windows RGUI  [ -- Edit | GUI 
 Preferences --] has settings for both buffer and lines which on my 
 64-bit machine default to 25 and 8000 respectively.
 
 Rob Baer
 
 Peter Ehlers

Thanks for the replies, Rob and Peter. Rob's reply in particular
corresponds to what my friend has himself just found out in his
Windows installation of R. It seems, however, that this setting
is once-and-for-all in an R session (I can't check that myself).

Re Peter's comment: I don;t seem to have an Rconsole file
anywhere in my Linux installation. Is it unique to Windows?

Once again, thanks. Very helpful.
Ted.

-
E-Mail: (Ted Harding) ted.hard...@wlandres.net
Date: 01-Apr-2013  Time: 23:06:21
This message was sent by XFMail

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


Re: [R] Console display buffer size

2013-04-01 Thread Peter Ehlers

On 2013-04-01 15:06, Ted Harding wrote:

On 01-Apr-2013 21:26:07 Robert Baer wrote:

On 4/1/2013 4:08 PM, Peter Ehlers wrote:

On 2013-04-01 13:37, Ted Harding wrote:

Greetings All.
This is a somewhat generic query (I'm really asking on behalf
of a friend who uses R on Windows, whereas I'm on Linux, but
the same phenomenon appears on both).

Say one has a largish dataframe -- call it G -- which in the
case under discussion has 592 rows and 41 columns. The intention
is to display the data by simply entering its name (G) as command.

Say the display console has been set wide enough to display 15
columns (determined by lengths of column names). Then R will output
succesively to the console, in continuous flow:
Chunk 1: rows 1:592 of columns 1:15
Chunk 2: rows 1:592 of columns 16:30
Chunk 3: rows 1:592 of columns 31:41
If the number of rows that can be displayed on the screen is, say, 60,
then only rows 533:592 of Chunk 3 will be visible in the first instance.

However, on my Linux system at any rate, I can use Shift+PgUp to
scroll back up through what has been output to the console. It seems
that my friend proceeds similarly.

But now, after a certain number of (Shift+PgUps), one runs out
of road before getting to Row 1 of Chunk 1 (in my friend's case,
only Rows 468-592 of Chunk 1 can be seen).

The explanation which occurs to me is that the console has a buffer
in which such an output is stored, and if the dataframe is too big
then lines 1:N (for some N) of the output are dropped from the start
of the buffer, and it is impossible to go further back than line (N+1)
of Chunk 1 where in this case N=467 (of course one may not even be
able to go further back than Chunk K, for some K  1, for a bigger
dataframe).

The query I have is: In the light of the above, is there a way to
change the size of the buffer so that one can scroll all the way
back to the very first row of Chunk 1? (The size-change may perhaps
have to be determined empirically).


Isn't this set by the 'bufbytes' and 'buflines' specifications in the
Rconsole file?
Anyway, it's probably best to use 'View' to inspect data.


Although I have not tried them, Windows RGUI  [ -- Edit | GUI
Preferences --] has settings for both buffer and lines which on my
64-bit machine default to 25 and 8000 respectively.

Rob Baer


Peter Ehlers


Thanks for the replies, Rob and Peter. Rob's reply in particular
corresponds to what my friend has himself just found out in his
Windows installation of R. It seems, however, that this setting
is once-and-for-all in an R session (I can't check that myself).

Re Peter's comment: I don;t seem to have an Rconsole file
anywhere in my Linux installation. Is it unique to Windows?


Yes, I believe Rconsole is Windows only. But let me re-iterate my
advice: use View() to inspect a data.frame. When I need to do a
fair bit of this and find that typing View is too much effort,
I save a couple of keystrokes by redefining .V - View. The nice
thing is that you can scroll both horizontally and vertically
and you can even do it sans mouse (arrow/page keys).

Peter Ehlers



Once again, thanks. Very helpful.
Ted.

-
E-Mail: (Ted Harding) ted.hard...@wlandres.net
Date: 01-Apr-2013  Time: 23:06:21
This message was sent by XFMail
-



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


Re: [R] Image segmentation

2013-04-01 Thread David Winsemius

On Apr 1, 2013, at 7:50 AM, Eder Paulo wrote:

 Hi,
 
 I work with
 remote sensing in Brazil. I would like to know if there is any algorithm or
 package that does image segmentation by region growing in R.
 

It's possible that there is a domain of investigation where the phrase  image 
segmentation by region growing would be specific enough to offer advice, but 
it's certainly outside my experience. I would advise being somewhat more 
expansive when describing your requirements in future postings to this 
generalist audience. You might want to look at the CRAN Task Views: (first hit 
with Google if you search on that phrase). The Task Views used to be countable 
on one hand but now threaten to extend beyond a full page. I believe you will 
find the MedicalImaging or Spatial Views have pointers to tools with image 
analysis functions. The MedicalImaging View also has a link to: 
http://www.bioconductor.org/packages/release/bioc/html/EBImage.html


-- 
David Winsemius
Alameda, CA, USA

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


[R] How to remove all characters after comma in R

2013-04-01 Thread Gundala Viswanath
I have the following list of strings:

x - c(foo, foo2, foo3, bar, qux, qux1)

what I want to do is to obtain

foo, bar qux

Namely for each element in the vector obtain only string
before the first comma.

What's the way to do it?

- G.V.

[[alternative HTML version deleted]]

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


Re: [R] How to remove all characters after comma in R

2013-04-01 Thread arun
gsub(\\,.*,,x)
#[1] foo bar qux
A.K.



- Original Message -
From: Gundala Viswanath gunda...@gmail.com
To: r-h...@stat.math.ethz.ch r-h...@stat.math.ethz.ch
Cc: 
Sent: Monday, April 1, 2013 10:13 PM
Subject: [R] How to remove all characters after comma in R

I have the following list of strings:

x - c(foo, foo2, foo3, bar, qux, qux1)

what I want to do is to obtain

foo, bar qux

Namely for each element in the vector obtain only string
before the first comma.

What's the way to do it?

- G.V.

    [[alternative HTML version deleted]]

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


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


Re: [R] How to remove all characters after comma in R

2013-04-01 Thread Rolf Turner

On 04/02/2013 03:13 PM, Gundala Viswanath wrote:

I have the following list of strings:

x - c(foo, foo2, foo3, bar, qux, qux1)

what I want to do is to obtain

foo, bar qux

Namely for each element in the vector obtain only string
before the first comma.

What's the way to do it?


This seems to work:

  x - c(foo, foo2, foo3, bar, qux, qux1)
  sub(,.*$,,x)
 [1] foo bar qux

cheers,

Rolf Turner

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


Re: [R] How to remove all characters after comma in R

2013-04-01 Thread Peter Ehlers

On 2013-04-01 19:23, arun wrote:

gsub(\\,.*,,x)
#[1] foo bar qux
A.K.


No big deal, but does , have to be escaped?

sub(,.*, , x)

Peter Ehlers



- Original Message -
From: Gundala Viswanath gunda...@gmail.com
To: r-h...@stat.math.ethz.ch r-h...@stat.math.ethz.ch
Cc:
Sent: Monday, April 1, 2013 10:13 PM
Subject: [R] How to remove all characters after comma in R

I have the following list of strings:

x - c(foo, foo2, foo3, bar, qux, qux1)

what I want to do is to obtain

foo, bar qux

Namely for each element in the vector obtain only string
before the first comma.

What's the way to do it?

- G.V.

 [[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-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] ctree (party) - select a specific variable in the first split

2013-04-01 Thread Salvatore Loguercio

Hello,

My question is related to ctree() function from the library 'party'.
Is there a way to force ctree() to use a specific variable in the first 
split? I am asking because the first split contains two variables with 
very similar scores, and choosing the alternative variable would induce 
a tree somewhat easier to interpret.


Thanks,
Sal

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


Re: [R] Error message in dredge function (MuMIn package) used with binary GLM

2013-04-01 Thread CatCowie
Hi Kamil,

(I have replied to the forum but my posts as replies never seem to get
accepted, so here is the text in an email also. Apologies if it comes
through twice.)

Thanks so much for the prompt reply. You've solved it! Actually I had the
latest version of the package, but an older version of R that wasn't
supporting the package evidently... when I updated it everything ran with
the AICc rank. However, when I run it with QAICc (which i think Iwant
to use), R returns the error Error in chat  1 : 'chat' is missing and
does not conduct the dredge. My chat (variance inflation factor) is 0.597.
As this is 1, should I just rank by AICc? I still have a small sample size
necessitating AICc.

For interest, I can make the dredge run with rank=QAICc, but I need to
include the chat, and a error message then tells me In rank(x, chat =
0.597604265592854) : 'chat' given is  1, increased to 1. The script for
this is below:

##Information Theoretic Approach
globalmodel- glm(TB~lat+protocol+tested+streams+goats+hay+cattle+deer,
family=binomial)
chat- deviance(globalmodel)/59 #There we 59 residual degrees of freedom in
this model.
models- dredge(globalmodel, beta=FALSE, evaluate=TRUE, rank=QAICc,
chat=chat, fixed=NULL, trace=FALSE)
models
warnings()

I think I will use just AICc, but do let me know if you think this is
wrong! Many thanks again for your help,
Cat


On 1 April 2013 22:19, Kamil Barton [via R] 
ml-node+s789695n4662958...@n4.nabble.com wrote:

 Hi Cat,
 are you using some very old version of MuMIn? That would explain the
 missing 'QAICc'.
 As for the error message about 'logLik', it usually occurs when there
 are some misspelled arguments (that go into ... and are passed to the
 rank function, 'AICc' in your case). Check if there is some argument (of
 type logical) in your call to 'dredge' that is not its formal argument.

 kamil

 On 2013-03-30 03:13, [hidden 
 email]http://user/SendEmail.jtp?type=nodenode=4662958i=0wrote:

  Hi Kamil,
 
  Thanks for your help. I do want to use rank=QAICc, but I when I try it
 I get the following error message:
 
  Error in get(as.character(FUN), mode = function, envir = envir) :
 object 'QAICc' of mode 'function' was not found
 
  Do I need to install another package that would recognise this?
 
  When I leave the script with rank=AICc (to see if it will run), and
 having removed chat (which I put in after previously recieving an error
 message about it being missing from the formula), I still get my original
 error message:
 
  Error in UseMethod(logLik) :
 no applicable method for 'logLik' applied to an object of class
 logical
 
  Any further thoughts?
  Thanks, Cat
 
 
  quote author='Kamil Barton'
  'rank' should be QAICc.
  AICc does not have argument 'chat', hence the error.
 
  kamil
 
 
 
  Hi all,
 
  I'm having trouble with the model generating 'dredge' function in the
 MuMIn
  'Multi-model Inference' package.
 
  Here's the script:
 
  globalmodel- glm(TB~lat+protocol+tested+
  streams+goats+hay+cattle+deer,
  family=binomial)
  chat- deviance(globalmodel)/59 #There we 59 residual degrees of freedom
 in
  this global model.
  models- dredge(globalmodel, beta=FALSE, evaluate=TRUE, rank=AICc,
  chat=chat, fixed=NULL, trace=FALSE)
 
  And the error message is:
 
  Error in UseMethod(logLik) :
 no applicable method for 'logLik' applied to an object of class
 logical
 
  I have trawled the literature and it seems to be ok to use a binary GLM
 as
  the global model - could this be the problem? The variables are a mix of
  binary and continuous data.
 
  Any thoughts?
  Thanks,
  Cat
 
 
  /quote
  Quoted from:
 
 http://r.789695.n4.nabble.com/Error-message-in-dredge-function-MuMIn-package-used-with-binary-GLM-tp4662842p4662881.html
 



 The University of Aberdeen is a charity registered in Scotland, No
 SC013683.

 __
 [hidden email] http://user/SendEmail.jtp?type=nodenode=4662958i=1mailing 
 list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


 --
  If you reply to this email, your message will be added to the discussion
 below:

 http://r.789695.n4.nabble.com/Error-message-in-dredge-function-MuMIn-package-used-with-binary-GLM-tp4662842p4662958.html
  To unsubscribe from Error message in dredge function (MuMIn package) used
 with binary GLM, click 
 herehttp://r.789695.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=4662842code=Y2F0LmUuY293aWVAZ21haWwuY29tfDQ2NjI4NDJ8MTMyMDc2OTMxNw==
 .
 

[R] please help, iteration through a list of files and plot each one

2013-04-01 Thread David Lyon


I have many files in 1 directory, file names end in .txt.

Each file has 2 columns

col1 col2

2 3

3 4

4 5

5 6


I want to make a list of the file names and iterate through each plotting them 
in a separate file $filename\.png with the png swapped for txt.

So far I have this, can someone help fill in the blanks?

Thank You!




file_list - list.files()
 
for (file in file_list){
   
 
  if (!exists(dataset)){
    dataset - read.table(file, header=TRUE, sep=\t)
  }
   
 
  if (exists(dataset)){
    temp_dataset -read.table(file, header=TRUE, sep=\t)


 ##how  to plot(temp_dataset) each file and save png(file\.png)
 
  }
 
}

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