Re: [R] Installation of R in Redhat Linux (64 bit)

2009-06-06 Thread Prof Brian Ripley

On Sat, 6 Jun 2009, Zeljko Vrba wrote:


On Fri, Jun 05, 2009 at 08:27:45PM -0700, Santosh wrote:


When I run the following:
nm /usr/lib64/R/library/stats/libs/stats.so | grep _gfortran_copy_string


You probably need to install libraries related to gfortran.


Yes, specifically libgfortran.  Look at rpm -qa | grep libgfortran to 
see what versions are installed (if any).


But how was R installed?  If this was installed from an RPM it should 
have satisfied such dependencies (and R-sig-fedora would be a more 
appropriate list).


I think the issue relates to the version of libgfortran, and I've seen 
it using binaries compiled on an older version of Fedora. Maybe that 
symbol is used by gfortran 4.1.x and not by 4.3.x, so is in 
libgfortran.so.1 but not in libgfortran.so.3.  If this were Fedora, I 
would be sugggesting installing the compat-libgfortran-41 RPM.


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

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


Re: [R] alternative to built-in data editor

2009-06-06 Thread Liviu Andronic
On Thu, May 28, 2009 at 8:52 AM, Dieter
Mennedieter.me...@menne-biomed.de wrote:
 I have never seen the data editor.

It's fix(), very similar to View(), but not crashing. Although
showData() in relimp (the same used by Rcmdr) is often enough for
viewing data, fix() is somewhat rudimentary. Isn't there any other
(cross-platform) alternative to fixing data in a spreadsheet-style
environment in R (those on Windows can try RExcel)? Perhaps built on
other toolkits?

Liviu

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


Re: [R] S4: When is validObject issued? (or why S4 is killing me:( ..

2009-06-06 Thread Vitalie S.




 setMethod(initialize,test2,
   function(.Object,...){
   .Object-callNextMethod(.Object,...)


validity is checked in the preceeding line


   .obj...@b-.obj...@a   ## here b is initialized ##

   .Object
   })


new(test2)

Error in if (obj...@a != obj...@b) print(values must be equal!!)
else TRUE : argument is of length zero

This could mean only one thing, validity of test2 is checked before
it gets to point when b is initialized (i.e. in callNextMethod). But
this is absurd (at leas from my point): callNextMethod constructs
object of type test and should have nothing to do with validity of
test2. Shouldn't validity be checked only after the object is
created?


The class of .Object is test2, and initialize should return a (valid)
instance of test2, right? So the validity check on test2 has to have
been performed before returning from callNextMethod.



Oh yes, that is indeed meaningful. So it's default coercion method from test1 to test2 which is called.  




Second my slot a is initialized in test1's constructor and b
must be assigned only after the callNextMethod as in above
code. Seemingly unsolvable paradox? How to be?


My own solution would avoid using initialize (because as you're
discovering the contract is hard to satisfy in general) and instead
use constructors


I am sure this contract and all this 
initialization/coercion/creation-sequence  stuff must be documented somewhere. Though all 
what I can find is a collection of your responses in R-help archive. Could you please 
suggest something to read (except R-core code)?


For now I am pretty much clarified. Thanks a lot!


  test2 - function(a=runif(1), b=a, ...) new(test2, a=a, b=b, ...)

or similar, which I think helps to provide a bit of an interface
between the class and it's implementation.

One could think of additional solutions (creating a new 'test' inside
'test2', and not using callNextMethod(), for instance) but this is
unlikely to be robust (e.g., when derived classes are relying on
initialize,ANY-method to fill in slots with supplied arguments).

Martin



Many thanks.

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

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




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


Re: [R] alternative to built-in data editor

2009-06-06 Thread Liviu Andronic
On 6/6/09, Liviu Andronic landronim...@gmail.com wrote:
  (cross-platform) alternative to fixing data in a spreadsheet-style
  environment in R (those on Windows can try RExcel)? Perhaps built on
  other toolkits?

Oh, there is one, in JGR. Issue object.browser() to browse all
workspace objects, and double-click data frames to access a much less
rudimentary spreadsheet-like environment that allows to view the data,
edit individual cells, insert/remove rows, insert/remove/rename
columns, sort by columns and export all modifications to an R object.
Individual variables in data frames, and other objects such as
matrices can be edited in a similar fashion.
Liviu

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


Re: [R] time series, longitudinal data or trajectories

2009-06-06 Thread Christophe Genolini

Thanks for yours answers. So if I understand:
- Trajectories are continuous, the other are discrete.
- The difference between time series and longitudinal is that time 
series are made at regular time whereas longitudinal are not ?

- Repeated measures are over a short period of time.


So if I measure the  weight of my patient daily during one week, it will 
be repeated measure ; if I measure it once a week during one year,
it will time series ; if I measure it once a week during one year but 
with some missing week, it will longitudinal data ? 


Well I guess it is not as simple at that, but is it the idea ?

Christophe



At 04:02 PM 6/5/2009, Christophe Genolini wrote:

Hi the list

Strictly speaking, this is not a R question, but I need the 
information for the
creation of a package. My question is about vocabulary: What is the 
difference between

time series, longitudinal data and trajectories?

Sincerely

Christophe


Longitudinal data are measurements over long periods of time, often 
at irregular periods, but consistent across subjects.


Repeated measures data are replicates at the same point in time, or 
over a short period of time (e.g., laboratory experiments).


Time series typically have constant increments of time and typically 
a stochastic character, although this term might be considered 
all-encompassing for all measurements at different times.


Trajectory implies a continuous curve in time, as opposed to 
discrete times. Trajectory also implies an underlying causal model, 
as it is a term from kinematics.


I hope this helps.


Robert A. LaBudde, PhD, PAS, Dpl. ACAFS  e-mail: r...@lcfltd.com
Least Cost Formulations, Ltd.URL: http://lcfltd.com/
824 Timberlake Drive Tel: 757-467-0954
Virginia Beach, VA 23464-3239Fax: 757-467-2947

Vere scire est per causas scire





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


[R] Need suggestion to present migration flow data

2009-06-06 Thread Kel Lam
Hi group,

I am looking at migration data of very sick children to see if they
move because of easier access to tertiary care.  In particular, I am
investigating the change of their socioeconomic status before the move
(5 levels, highest implies best status) and after.  Can anyone suggest
some kind of graphical display that best represents this kind of flow?

In terms of modelling, I can only think of a count data problem like a
5X5 matrix.  Has anyone tried another approach?

Thanks in advance.

Kelvin

-- 
Knowledge is meant to draw people closer to God

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

2009-06-06 Thread Subha P. T.














Hi,
 I tried fitting loglinear model using the glm(catspec). The data used is 
FHtab. . An independence model was fitted. Here summary() and fitmacro( ) give 
different values for AIC. 
 
I understand that fitmacro( ) takes the likelilhood ratio L2(deviance) to 
calculate AIC and uses the formula AIC= L2- d.f(deviance)*2 and this AIC is 
used for comparison of nested models. (Am I right?)
 
The value given by loglik( ) is used by summary()  to calculate AIC in the 
formula 
AIC= -2 logL + K* e.d.f. Can anybody tell me how this  log L is calculated? 
It is not logL=Sum(ni* log (pi)), where pi= fitted frequency / total no. of 
observations. The help available at extract AIC( ) also is not giving the 
answer.  



Please help



Thanks 

Subha



 
 
 
 







 

 


   
gLaunchProfile.stop('RT_RP', 
false);gLaunchProfile.start('RT_BP');gLaunchProfile.start('LD_JS_BP');

YAHOO.mc.intl = us;YAHOO.mc.IM_TOGGLE_STRINGS = {im_settings_helpurl : 
http://help.yahoo.com/l/us/yahoo/mail/classic/chat/,im_settings_help_toggle; 
: 1,im_enable_mobile_l10n: 1,im_sign_in: true,im_time_format_am : 
AM,im_time_format_pm : PM,im_date_time_format : {d}/{M}/{yy} {h}:{mm} 
{A}};if (YAHOO.mc.page.generic) 
{YAHOO.mc.page.generic.initComposeMenu();}YAHOO.mc.page.TriggerULT=true;YAHOO.util.Event.onDOMReady(function
 () {sessionMgr.initSession();sessionMgr.loadFromBookmarks();});var adPrefetch 
= true;if (document.getElementById(JSMailOptionsLink)) 
{document.getElementById(JSMailOptionsLink).href = 
optionObj[JSMailOptionsLink];}YAHOO.util.Event.on([searchTheWebtop, 
searchTheWebbottom], submit, webSearchHandle);if 
(document.getElementById(chk_pop_options) || 
document.getElementById(chk_pop_error) || 
document.getElementById(option_bad_folder) || 
document.getElementById(folders_options_spam) ||
 document.getElementById(folders_options_sent) || 
document.getElementById(spam_edit_options)) 
{YAHOO.util.Event.addListener(YAHOO.mc.optionsID, click, displayOptions, 
optionObj);}YAHOO.namespace(fcue);


YAHOO.mc.FCUE_METADATA = 
{imInit:,imSent:,fcElap:,fcEcap:,fcNag:,inEcap:,inElap:};YAHOO.mc.noCues
 = false;YAHOO.mc.msgrLoaded = false;YAHOO.mc.loadMsgr = function () 
{clearTimeout(YAHOO.mc.msgrLoadID);if (hasIM  !YAHOO.mc.msgrLoaded) 
{YAHOO.mc.msgrLoaded = 
true;YAHOO.util.Get.script(http://mail.yimg.com/d/combo?/mg/5_3_7/js/im_blue_all.js/mg/5_3_7/js/us_strings.js/mg/5_3_7/js/msgr.jsult/ylc_1.9.js;);}};YAHOO.util.Event.on(window,
 load, YAHOO.mc.loadMsgr);YAHOO.mc.msgrLoadID = setTimeout(YAHOO.mc.loadMsgr, 
5000);

gLaunchProfile.stop('LD_JS_BP', false);


  
[[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] (no subject)

2009-06-06 Thread Peter Flom
Christophe Genolini cgeno...@u-paris10.fr wrote

Thanks for yours answers. So if I understand:
 - Trajectories are continuous, the other are discrete.
 - The difference between time series and longitudinal is that time 
series are made at regular time whereas longitudinal are not ?
 - Repeated measures are over a short period of time.


So if I measure the  weight of my patient daily during one week, it will 
be repeated measure ; if I measure it once a week during one year,
it will time series ; if I measure it once a week during one year but 
with some missing week, it will longitudinal data ? 


This is not my understanding of the terms.  To me, both time series
and longitudinal data can be regular or irregular, but time series data
typically have a lot more measurement points (20 at a minimum) and often
has only one or a few subjects - e.g. trends in the stock market.  Logitudinal
data are often collected at fewer time points, but with many subject
(e.g. measuring people repeatedly to see if something about them changes 
over time, and changes differently in different people).

Peter


Peter L. Flom, PhD
Statistical Consultant
www DOT peterflomconsulting DOT com

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


[R] how to make the dynamically creted string work inside if as a condition

2009-06-06 Thread Moumita Das
Hi,
How to make an if condition work,  if the condition inside if() is created
dynamically  ,and that is a string .If i type teh dynamically created string
the if works fine but when dynamically created,it is a string and going
inside the if() ,an error is thrown saying : rgument is not logical ..I even
tried changing teh mode of the string to logical,but it doesn't work

Say my dynamically created string is :--

str- name=='tom' || name=='harry' || name=='tina'
where the names are diffrent for diffrent DBs.

if(name=='tom' || name=='harry' || name=='tina' )
{
 some code
}

If i do this
if(str)
{

 some code
}

It doesn't work:(
-- 


Thanks
Moumita

[[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 make the dynamically creted string work inside if as a condition

2009-06-06 Thread Duncan Murdoch

Moumita Das wrote:

Hi,
How to make an if condition work,  if the condition inside if() is created
dynamically  ,and that is a string .If i type teh dynamically created string
the if works fine but when dynamically created,it is a string and going
inside the if() ,an error is thrown saying : rgument is not logical ..I even
tried changing teh mode of the string to logical,but it doesn't work

Say my dynamically created string is :--

str- name=='tom' || name=='harry' || name=='tina'
where the names are diffrent for diffrent DBs.
  


That's not a string, it will be evaluated to a logical TRUE or FALSE value.

if(name=='tom' || name=='harry' || name=='tina' )
{
 some code
}

If i do this
if(str)
{

 some code
}

It doesn't work:(
  
Those should be equivalent.  I think you need to simplify your example 
and post real code for us to see the problem.


Duncan Murdoch

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


[R] SMACOF joint configuration plot with bread data?

2009-06-06 Thread Michael Kubovy
Dear R-helpers,

I have dist class objects for 10 individuals rating the  
dissimilarities (on a 100-point scale) of the same 10 faces (analogous  
to the bread data). I would like to get an individual differences  
scaling jointly for the individual judges and the faces, and plot them  
on the same axes.

This is the example:
library(smacof)
data(breakfast)
res.rect-smacofRect(breakfast, itmax = 1000)
plot(res.rect, joint = TRUE, xlim = c(-10, 10))

However, smacofIndDiff() doesn't produce the desired form of output.  
This is the bread example, which has data in roughly the same form as  
mine:
data(bread)
res.uc - smacofIndDiff(bread, itmax = 1000)

Thanks,


_
Professor Michael Kubovy
University of Virginia
Department of Psychology
USPS: P.O.Box 400400Charlottesville, VA 22904-4400
Parcels:Room 102Gilmer Hall
   McCormick RoadCharlottesville, VA 22903
Office:B011+1-434-982-4729
Lab:B019+1-434-982-4751
Fax:+1-434-982-4766
WWW:http://www.people.virginia.edu/~mk9y/



[[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] No --no-latex?

2009-06-06 Thread Jim Lemon

Hi,
Having finally gotten around to installing R-2.9.0, I find that while 
the docs still say I can invoke the --no-latex option, R CMD INSTALL has 
decided that I can't. Nor is there any notice of this that I can find in 
the 2.9 series news. Is this just a trifling oversight that will be 
repaired?


Jim

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


Re: [R] No --no-latex?

2009-06-06 Thread Duncan Murdoch

Jim Lemon wrote:

Hi,
Having finally gotten around to installing R-2.9.0, I find that while 
the docs still say I can invoke the --no-latex option, R CMD INSTALL has 
decided that I can't. Nor is there any notice of this that I can find in 
the 2.9 series news. Is this just a trifling oversight that will be 
repaired?


Jim


Looks like it was an oversight.  I'll fix it.

Thanks for the report...

Duncan Murdoch

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


Re: [R] Rpad - avoid removal of manually created html-tags in R chunk

2009-06-06 Thread Martin Gartner

Martin Gartner wrote:

Dear Rpad-users,

currently I am setting up a web page using Rpad (www.rpad.org). But I 
have a problem with generating dynamic html-output in the Rpad chunk. 
Here an example of my problem:


I have the following index.html file:

html
 head
   titleexample/title
   meta http-equiv=Content-Type content=text/html; charset=utf-8
   script type=text/javascript src=gui/Rpad.js/script
 /head
 body
   pre dojoType=Rpad rpadRun=init rpadOutput=html 
rpadHideSource=true
 x - 
tabletrthA/ththB/th/trtda/tdtdb/td/table

   /pre
 /body
/html

If I run Rpad(index.html) in the local server mode and when I turn 
to my Rgui, then the object x looks like ABab, i.e. all my 
html-tags are removed within the R-chunk.


I know that I can avoid this with nested HtmlTrees, e.g.

H(table, H(tr, H(th, A), H(th, B)), H(tr, H(td, a), 
H(td, b)))


but as I have to produce html-output of a large dataframe (100 rows 
and 6 colums), the nesting takes too much time (because every cell 
element might have conditional formatting and I have to check each 
element) and I think it would be faster with pasting all html-code 
manually into a character-object and printing this object as html. But 
trying this I have the above mentioned problem.


Can anybody help me? If anybody knows a solution, how I can avoid, 
that the html-tags are removed from my x (see example above), I 
think, I can produce my output very fast.


Thanks and best regards,
Martin

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

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



Hi everybody,

I already got the solution. I have to use the encoded characters for the tags ... 


html
 head
   titleGUI Examples/title
   script type=text/javascript
   rpadConfig = {
   gui: alternate,
   rpadHideSource: true
   };
   /script
   script type=text/javascript src=gui/Rpad.js/script
 /head
 body
#60 #62
   pre dojoType=Rpad rpadRun=init rpadOutput=html rpadHideSource=true
 x - #60table 
border='1'#62#60tr#62#60th#62A#60#47th#62#60th#62B#60#47th#62#60#47tr#62#60td#62A#60#47td#62#60td#62B#60#47td#62#60#47table#62
cat(x)
 /body
/html

Best regards,
Martin

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


Re: [R] No --no-latex?

2009-06-06 Thread Peter Dalgaard

Jim Lemon wrote:

Hi,
Having finally gotten around to installing R-2.9.0, I find that while 
the docs still say I can invoke the --no-latex option, R CMD INSTALL has 
decided that I can't. Nor is there any notice of this that I can find in 
the 2.9 series news. Is this just a trifling oversight that will be 
repaired?


Jim


Looks like the corresponding  else if  clause got omitted in

tools:::.install_packages()

and before that in share/R/RINSTALL.


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

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


Re: [R] Install RCurl in Linux

2009-06-06 Thread Duncan Temple Lang


Hi

If you are getting exactly the same errors, then it is probable
that your installation of curl-7.19.2 is not taking
effect and the configuration script is still finding the older
version.  So you may want to check the output
of
  curl-config --version
in the same  shell as you issue R CMD INSTALL.


If the new libcurl header files are being used, I doubt
you will get the same errors.  So we need to see those also
to be able to assist.

 D.


heyi xiao wrote:



Thanks Prof. Ripley,

I installed the current version curl-7.19.2, still got the same problem.

I am installing RCurl_0.97-3 and my system is x86_64/CentOS 5.

Looking forward to more suggestions/ideas.



--- On *Fri, 6/5/09, Prof Brian Ripley /rip...@stats.ox.ac.uk/* wrote:


From: Prof Brian Ripley rip...@stats.ox.ac.uk
Subject: Re: [R] Install RCurl in Linux
To: heyi xiao xiaohey...@yahoo.com
Cc: r-help@r-project.org, dun...@wald.ucdavis.edu
Date: Friday, June 5, 2009, 1:50 AM

It seems you need a later curl -- 7.15 is rather old (and I think
incomplete as a version number) and 7.19.5 is current.

It is helpful to tell us what version of packages (here RCurl) you are
trying to use, as well as your precise OS.

On Thu, 4 Jun 2009, heyi xiao wrote:

 
 
 
 
 
 
 
 
  Hello all,
 
  I had both curl and curl-devel
  (both 7.15) installed on my x86_64/CentOS machine. However, I
still got problem
  when I do
 
  R CMD INSTALL RCurl
 
  ??
 
  Error message below,
  since library and/or include path is missing. I tried
 
  R CMD INSTALL RCurl
  --configure-args='--libdir=/usr/lib64/??
  --includedir=/usr/include/'

That should be part of the default paths.

  Same result. Any
  hint/suggestion would be appreciated.
 
  ...
 
  No CURLOPT_NOPROXY
  enumeration value.
 
  No
  CURLINFO_CONDITION_UNMET enumeration value.
 
  No
  CURLINFO_REDIRECT_URL enumeration value.
 
  No CURLINFO_CERTINFO
  enumeration value.
 
  No
  CURLINFO_PRIMARY_IP enumeration value.
 
  No
  CURLINFO_APPCONNECT_TIME enumeration value.
 
  No CURLOPT_KEYPASSWD
  enumeration value.
 
  No
  CURLOPT_DIRLISTONLY enumeration value.
 
  No CURLOPT_APPEND
  enumeration value.
 
  No CURLOPT_KRBLEVEL
  enumeration value.
 
  ...
 
  Version has
  CURLOPT_PROTOCOLS
 
  Version has
  CURLOPT_REDIR_PROTOCOLS
 
  configure: creating
  ./config.status
 
  config.status:
  creating src/Makevars
 
  ** libs
 
  gcc -std=gnu99
  -I/usr/local/lib64/R/include??
  -DHAVE_LIBIDN_FIELD=1 -DHAVE_CURLOPT_URL=1 -DHAVE_CURLOPT_PROTOCOLS=1
  -DHAVE_CURLOPT_REDIR_PROTOCOLS=1 -I/usr/local/include?? -fpic??
  -g -O2 -c enums.c -o enums.o
 
  In file included
  from CurlOptEnums.h:10,
 
   from enums.c:79:
 
  CURLOptTable.h:145:
  error: ??CURLOPT_SOCKOPTFUNCTION?? undeclared here (not in a
function)
 
  CURLOptTable.h:146:
  error: ??CURLOPT_SOCKOPTDATA?? undeclared here (not in a function)
 
  CURLOptTable.h:147:
  error: ??CURLOPT_SSL_SESSIONID_CACHE?? undeclared here (not in a
function)
 
  CURLOptTable.h:148:
  error: ??CURLOPT_SSH_AUTH_TYPES?? undeclared here (not in a function)
 
  CURLOptTable.h:149:
  error: ??CURLOPT_SSH_PUBLIC_KEYFILE?? undeclared here (not in a
function)
 
  CURLOptTable.h:150:
  error: ??CURLOPT_SSH_PRIVATE_KEYFILE?? undeclared here (not in a
function)
 
  CURLOptTable.h:151:
  error: ??CURLOPT_FTP_SSL_CCC?? undeclared here (not in a function)
 
  make: *** [enums.o]
  Error 1
 
  ERROR: compilation
  failed for package ??RCurl??
 
  * Removing
  ??/usr/local/lib64/R/library/RCurl??
 
 
 
 
 
  [[alternative HTML version deleted]]
 
 

-- 
Brian D. Ripley,  rip...@stats.ox.ac.uk

/mc/compose?to=rip...@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
http://www.stats.ox.ac.uk/%7Eripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595




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


Re: [R] time series, longitudinal data or trajectories

2009-06-06 Thread Robert A LaBudde

At 04:54 AM 6/6/2009, Christophe Genolini wrote:

Thanks for yours answers. So if I understand:
- Trajectories are continuous, the other are discrete.
- The difference between time series and longitudinal is that time 
series are made at regular time whereas longitudinal are not ?

- Repeated measures are over a short period of time.


So if I measure the  weight of my patient daily during one week, it 
will be repeated measure ; if I measure it once a week during one year,
it will time series ; if I measure it once a week during one year 
but with some missing week, it will longitudinal data ?

Well I guess it is not as simple at that, but is it the idea ?
snip


Not exactly.

If you measure weight daily for a week, that is a time series 
(equally spaced time measurements over an arbitrary period) and 
repeated measurements (multiple measurements on the same subject, 
whether on time or at random or in some other way).


If you measure weight weekly for each week in a year this is a time 
series (equally spaced time measurements) and would generally be 
called a longitudinal study (measurements over a lengthy enough 
time period that time-related changes are expected).


Missing data are common in repeated measures or longitudinal 
studies. In longitudinal studies, an additional problem of 
dropouts is present, which may be correlated with the unobserved 
measurement (i.e., missing, not at random or non-ignorable, 
non-random). Also, the long time period of a longitudinal study 
may create issues of measurement bias (due to drift in technique or 
clinicians over time) and change in the subject baseline state.


Time series is typically used in my experience for measurements 
that have a great degree of regularity (equally-spaced times, few or 
no missing data).


Trajectory is a term for continuous time curve.

Examples:

Study to measure blood pressure measurement fluctuations: N subjects 
measured by M operators every 8 hr during a week. Note there is a 
general expectation of a constant mean value for each subject during 
the period, with probably short-time fluctuations. This would be 
called a repeated measure study, Although it could also be called a 
time series study, the expectation of no total time period effect 
and the possibility of missing measurements would argue against that 
term. On the other hand, if a posteriori there were little or no 
missing data, and regular time-dependent patterns were observed, its 
name might be shifted to a time series study.


Cohort study to measure blood pressure changes over a ten year time 
frame for treated and untreated subjects: There will be significant 
amounts of missing data, dropouts from the study and a long time 
period of observation. This would almost universally be known as a 
longitudinal study.


Controlled experiment to measure rates of gelation of batches of 
different gelatins: N lots of gelatin, each measured in solution at 
the same M time periods for viscosity. A continuous underlying 
viscosity vs. time curve is expected (the trajectory) for each lot. 
Time periods are equal, and there are few missing data. The goal is 
to compare gelation trajectories. This is a repeated measure study, 
and might more particularly be characterized as a time series study.


When the subjects are living entities, usually the terms repeated 
measures or longitudinal are used. If measurements are taken at a 
single point in time, the term cross-sectional study is used. If 
there is a single response across time, the term time series is 
used. If there are multiple responses all measured at the same times 
for the subjects, the term panel data is used.


For controlled experiments, the terms repeated measures and time 
series are common. Longitudinal could be used, but generally is not.





Robert A. LaBudde, PhD, PAS, Dpl. ACAFS  e-mail: r...@lcfltd.com
Least Cost Formulations, Ltd.URL: http://lcfltd.com/
824 Timberlake Drive Tel: 757-467-0954
Virginia Beach, VA 23464-3239Fax: 757-467-2947

Vere scire est per causas scire

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


[R] Finding a folder at the root level of an unknown drive

2009-06-06 Thread Dennis Fisher

Colleagues,

R 2.9.0
Windows XP

Task is as follows:
A folder FOLDERNAME exists at the root level of some drive, e.g., E: 
\FOLDERNAME
I want to search all possible drives to find the location of this  
folder but I don't know what drives exist or are mounted.


The command:
dir(path=C:/, pattern=FOLDERNAME)
happens to be successful.

However, the command:
dir(path=C:/, pattern=FOLDERNAME)
results is a pop-up message:
There is no disk in the drive.  Please insert a disk into drive D:

Can I avoid the pop-up message?  i.e., can I execute a command that  
silently reports only successes?


Thanks in advance.

Dennis

Dennis Fisher MD
P  (The P Less Than Company)
Phone: 1-866-PLessThan (1-866-753-7784)
Fax: 1-415-564-2220
www.PLessThan.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] correct line types in lattice legends

2009-06-06 Thread Gerrit Draisma

Hallo R-users,
I do not understand how to specify the correct
line and symbol types in the legends of a lattice xyplot.
This is what I tried, but the line types and symbol  in the
graph are not seen in the legend.
Any help is appreciated.

Thanks,
Gerrit.

library(lattice)
s-rep(1:3,len=10)
x- 1:10
y- x+s+rnorm(10)
d-data.frame(s,x,y)
xyplot(y~x, groups=s,data=d, type=b, pch=1:3,lty=1:3, 
auto.key=list(text=c(A,B,C),points=FALSE,lines=TRUE,

 type=b,lty=1:3,divide=1,pch=1:3,columns=3))

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


Re: [R] Finding a folder at the root level of an unknown drive

2009-06-06 Thread Duncan Murdoch

On 06/06/2009 9:19 AM, Dennis Fisher wrote:

Colleagues,

R 2.9.0
Windows XP

Task is as follows:
A folder FOLDERNAME exists at the root level of some drive, e.g., E: 
\FOLDERNAME
I want to search all possible drives to find the location of this  
folder but I don't know what drives exist or are mounted.


The command:
dir(path=C:/, pattern=FOLDERNAME)
happens to be successful.

However, the command:
dir(path=C:/, pattern=FOLDERNAME)
results is a pop-up message:
There is no disk in the drive.  Please insert a disk into drive D:

Can I avoid the pop-up message?  i.e., can I execute a command that  
silently reports only successes?


I think that's quite hard, because the action on failure depends on the 
drive type.  It's coming from the device driver, not from R.  I'd guess 
your drive D: is a CD drive, for example.  If you do the same with Z:/ 
(assuming you don't have a drive Z: defined), you won't get the popup, 
but you'll get a warning from R because Z:/ is not readable.


So to do this, you'd need code to recognize what kind of drive you had, 
what sort of problems there could be, and avoid triggering them.


Duncan Murdoch

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


Re: [R] S4: When is validObject issued? (or why S4 is killing me:( ..

2009-06-06 Thread Martin Morgan
Vitalie S. wrote:
 

  setMethod(initialize,test2,
function(.Object,...){
.Object-callNextMethod(.Object,...)

 validity is checked in the preceeding line

.obj...@b-.obj...@a   ## here b is initialized ##

.Object
})

 new(test2)
 Error in if (obj...@a != obj...@b) print(values must be equal!!)
 else TRUE : argument is of length zero

 This could mean only one thing, validity of test2 is checked before
 it gets to point when b is initialized (i.e. in callNextMethod). But
 this is absurd (at leas from my point): callNextMethod constructs
 object of type test and should have nothing to do with validity of
 test2. Shouldn't validity be checked only after the object is
 created?

 The class of .Object is test2, and initialize should return a (valid)
 instance of test2, right? So the validity check on test2 has to have
 been performed before returning from callNextMethod.

 
 Oh yes, that is indeed meaningful. So it's default coercion method from
 test1 to test2 which is called.
 
 Second my slot a is initialized in test1's constructor and b
 must be assigned only after the callNextMethod as in above
 code. Seemingly unsolvable paradox? How to be?

 My own solution would avoid using initialize (because as you're
 discovering the contract is hard to satisfy in general) and instead
 use constructors
 
 I am sure this contract and all this
 initialization/coercion/creation-sequence  stuff must be documented
 somewhere. Though all what I can find is a collection of your responses
 in R-help archive. Could you please suggest something to read (except
 R-core code)?

?Methods and its 'References' and 'See also' section. Also, please take
my explanations with a grain of salt -- it represents my understanding,
not the way things are intended to be. Martin

 
 
 For now I am pretty much clarified. Thanks a lot!
 
   test2 - function(a=runif(1), b=a, ...) new(test2, a=a, b=b, ...)

 or similar, which I think helps to provide a bit of an interface
 between the class and it's implementation.

 One could think of additional solutions (creating a new 'test' inside
 'test2', and not using callNextMethod(), for instance) but this is
 unlikely to be robust (e.g., when derived classes are relying on
 initialize,ANY-method to fill in slots with supplied arguments).

 Martin


 Many thanks.

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


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


Re: [R] Installation of R in Redhat Linux (64 bit)

2009-06-06 Thread Santosh
Thanks for your responses!
I guess R was installed using the enterprise version (not fedora) rpm
package. The version of libgfortran is libgfortran43-4.3.2-7.el5 and I
have libgfortran.so.3.

From your email, I understand that libgfortran.so.1 is different from
libgfortran.so.3, and that _gfortran_copy_string is not used in the
libgfortran.so.3. Is that correct?

I see the libgfortran.so.1 is available for Fedora. would it work on RHEL5?
If not, where can I download libgfortran.so.1 for RHEL5?

Thanks much in advance.
Santosh


On Fri, Jun 5, 2009 at 11:49 PM, Prof Brian Ripley rip...@stats.ox.ac.ukwrote:

 On Sat, 6 Jun 2009, Zeljko Vrba wrote:

  On Fri, Jun 05, 2009 at 08:27:45PM -0700, Santosh wrote:


 When I run the following:
 nm /usr/lib64/R/library/stats/libs/stats.so | grep _gfortran_copy_string

  You probably need to install libraries related to gfortran.


 Yes, specifically libgfortran.  Look at rpm -qa | grep libgfortran to see
 what versions are installed (if any).

 But how was R installed?  If this was installed from an RPM it should have
 satisfied such dependencies (and R-sig-fedora would be a more appropriate
 list).

 I think the issue relates to the version of libgfortran, and I've seen it
 using binaries compiled on an older version of Fedora. Maybe that symbol is
 used by gfortran 4.1.x and not by 4.3.x, so is in libgfortran.so.1 but not
 in libgfortran.so.3.  If this were Fedora, I would be sugggesting installing
 the compat-libgfortran-41 RPM.

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


[[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] Fitting with Beta-prime

2009-06-06 Thread aledanda

Hi,

I need to fit my data with beta-prim distribution. I found the function in
the package VGAM: betaprime and betaff. I don't know how can I make it work.
I know that i need to calculate the parameters that describe this function
on my distribution. But for exemple I don't understand the link function.
And then How can I plot my data fitted?

Can you help me out with this?

Thanks a lot!

Alessandra
-- 
View this message in context: 
http://www.nabble.com/Fitting-with-Beta-prime-tp23903506p23903506.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] Truncated R output in Sweave

2009-06-06 Thread Frank E Harrell Jr

Dear Colleagues:

In producing a book or a handout I sometimes cut out a large part of the 
printed output of an R function, substituting ... for that chunk. 
Deleting non-essential output saves paper.  It would be nice to have a 
capability in Sweave to allow the user to specify a starting and an 
ending regular expression that would identify consecutive lines of 
output to replace with ..., without showing the extra code required to 
do this to the user.  I would want the LaTeX output, other than the 
omission, to appear the same as if the section were not omitted.  Does 
anyone have an idea of how to do this elegantly?


By the way I just discovered the SweaveListingUtils package by Peter 
Ruckdeschel (on CRAN), which produces beautifully printed R code in 
Sweave code chunks.  I put some info about it at 
http://biostat.mc.vanderbilt.edu/SweaveTemplate which has our Sweave 
template for statistical reports.


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

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


[R] large numbers of observations using ME() of spdep

2009-06-06 Thread lucero mariani
Dear All,
We aim to remove the spatial structure of our data using Moran Eigen
Vectors and spdep package . Our data has 3694 samples and 13
variables.
The computer stop working after almost 4 days of processing (we found
it emitting a sharp sound and with all colors on the screen. No
wories, it was restared without problem!). And we are left with
nothing: no result file was produced since the calculations were
interrumpted!
Consequently, I am looking for a way to accelerate calculations with
ME() of spdep and to save the results step by step (for each eigen
value).
I came accross several promissing ideas: 1)make a compiled program in
C and call it in R with the command system(); 2)use muliR. However, I
do not know how to use these tools. I do not understand exactely why
the calculations are so slow and I do know know how to write a program
in C...
I am using Ubuntu 9.04 and R version 2.8.1 .

The code in R is a fallows:
taimin.xy = taimin[c(dy, dx)];
coordinates(taimin.xy) - ~dy+dx; #dy, dx, name of the respective
coordinate columns
coords-coordinates(taimin.xy);
library(spdep);
TaiminGabrielGraph-gabrielneigh(coords, nnmult = 12);
tai.gab.nb-graph2nb(TaiminGabrielGraph,sym=TRUE);
nbtaim_distsg - nbdists(tai.gab.nb, coords);
nbtaim_simsg - lapply(nbtaim_distsg, function(x) (1-((x/(4*50))^2)) );
MEtaig.listw - nb2listw(tai.gab.nb, glist=nbtaim_simsg, style=B);
sevmtaig - ME(Presabs
~Age+Curv+Zon2005+ZoneMeiji+Wi+Sol+Slope+Seadist+Elev+Basin,data=taimin,
family=binomial,listw=MEtaig.listw)

Any help is welcome!

Thanks

Lucero Mariani, Yokohama National University, Japan.

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


[R] Fwd: correct line types in lattice legends

2009-06-06 Thread Deepayan Sarkar
[Forgot to CC r-help]

-- Forwarded message --
From: Deepayan Sarkar deepayan.sar...@gmail.com
To: Gerrit Draisma g.drai...@erasmusmc.nl


On 6/6/09, Gerrit Draisma g.drai...@erasmusmc.nl wrote:
  Hallo R-users,
   I do not understand how to specify the correct
   line and symbol types in the legends of a lattice xyplot.
   This is what I tried, but the line types and symbol  in the
   graph are not seen in the legend.
   Any help is appreciated.
 
   Thanks,
   Gerrit.
 
   library(lattice)
   s-rep(1:3,len=10)
   x- 1:10
   y- x+s+rnorm(10)
   d-data.frame(s,x,y)
   xyplot(y~x, groups=s,data=d, type=b,


Instead of


   pch=1:3,lty=1:3,


try

   par.settings = simpleTheme(pch=1:3,lty=1:3),


  auto.key=list(text=c(A,B,C),points=FALSE,lines=TRUE,
type=b,lty=1:3,divide=1,pch=1:3,columns=3))


The lty and pch in auto.key are not used.

 Alternatively, you could use the classic approach using key, where you
 need specify all parameters again in the key. You are already pretty
 close to that:


 xyplot(y~x, groups=s,data=d, type=b, pch=1:3,lty=1:3,

   key=list(text=list(c(A,B,C)),
lines=list(lty=1:3, pch=1:3, type=b),
divide=1, columns=3))

 You'll need to add matching colors as well.


 -Deepayan

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


[R] Journal Articles that Have Used R

2009-06-06 Thread Jason Rupert

Is there a way to get a reference list of journal articles that have used R?  

I am just looking for some examples of R graphs and presentation of results 
where R was used to generate the results. 

Thanks for any feedback and insights.

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


Re: [R] Journal Articles that Have Used R

2009-06-06 Thread Jakson Alves de Aquino
Jason Rupert wrote:
 Is there a way to get a reference list of journal articles that have used R?  
 
 I am just looking for some examples of R graphs and presentation of results 
 where R was used to generate the results. 

Did you try Google Scholar:

http://scholar.google.com.br/scholar?q=R%3A+A+Language+and+Environment+for+Statistical+Computing

It has cited by links.

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


Re: [R] Journal Articles that Have Used R

2009-06-06 Thread Gabor Grothendieck
Most of the papers in the Journal of Statistical Software use R
so that would give you many examples of such papers.
http://www.jstatsoft.org

On Sat, Jun 6, 2009 at 2:03 PM, Jason Rupertjasonkrup...@yahoo.com wrote:

 Is there a way to get a reference list of journal articles that have used R?

 I am just looking for some examples of R graphs and presentation of results 
 where R was used to generate the results.

 Thanks for any feedback and insights.

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

2009-06-06 Thread Ted Harding
On 06-Jun-09 18:34:21, Jakson Alves de Aquino wrote:
 Jason Rupert wrote:
 Is there a way to get a reference list of journal articles that have
 used R?  
 
 I am just looking for some examples of R graphs and presentation of
 results where R was used to generate the results. 
 
 Did you try Google Scholar:
 
 http://scholar.google.com.br/scholar?q=R%3A+A+Language+and+Environment+f
 or+Statistical+Computing
 
 It has cited by links.

A very good suggestion! An even better oone [:)] is to take out the .br:

http://scholar.google.com/scholar?q=R%3A+A+Language+and+Environment+
for+Statistical+Computing

(158,000 hits of which, on briefly scanning through the first 40,
about half seem to be hournal articles; draw you own conclusions).

Ted.


E-Mail: (Ted Harding) ted.hard...@manchester.ac.uk
Fax-to-email: +44 (0)870 094 0861
Date: 06-Jun-09   Time: 19:50:57
-- 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] Truncated R output in Sweave

2009-06-06 Thread Romain Francois



Frank E Harrell Jr wrote:


Dear Colleagues:

In producing a book or a handout I sometimes cut out a large part of 
the printed output of an R function, substituting ... for that chunk. 
Deleting non-essential output saves paper.  It would be nice to have a 
capability in Sweave to allow the user to specify a starting and an 
ending regular expression that would identify consecutive lines of 
output to replace with ..., without showing the extra code required to 
do this to the user.  I would want the LaTeX output, other than the 
omission, to appear the same as if the section were not omitted.  Does 
anyone have an idea of how to do this elegantly?


Hello,

You could use the same trick that is sometimes used to embed lattice 
calls into print calls (see the grid vignette for example)


\documentclass[a4paper]{article}
\begin{document}
aa,eval=FALSE,echo=T=
rnorm( 200 )
echo=F=
txt - capture.output( {
aa
   } )
if( length(txt)  10 ){
   txt - c( txt[1:10], ... )
}
cat( txt, sep = \n )
@
\end{document}



By the way I just discovered the SweaveListingUtils package by Peter 
Ruckdeschel (on CRAN), which produces beautifully printed R code in 
Sweave code chunks.  I put some info about it at 
http://biostat.mc.vanderbilt.edu/SweaveTemplate which has our Sweave 
template for statistical reports.
You might also be interested by the driver that comes with the highlight 
package (not yet on cran though, but the r-forge version is stable enough).


 install.packages(highlight, repos=http://R-Forge.R-project.org;)
 require( highlight )
 Sweave( file, driver = HighlightWeaveLatex() )
*||*


Thanks
Frank



--
Romain Francois
Independent R Consultant
+33(0) 6 28 91 30 30
http://romainfrancois.blog.free.fr

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


Re: [R] Truncated R output in Sweave

2009-06-06 Thread Frank E Harrell Jr

Romain Francois wrote:



Frank E Harrell Jr wrote:


Dear Colleagues:

In producing a book or a handout I sometimes cut out a large part of 
the printed output of an R function, substituting ... for that chunk. 
Deleting non-essential output saves paper.  It would be nice to have a 
capability in Sweave to allow the user to specify a starting and an 
ending regular expression that would identify consecutive lines of 
output to replace with ..., without showing the extra code required to 
do this to the user.  I would want the LaTeX output, other than the 
omission, to appear the same as if the section were not omitted.  Does 
anyone have an idea of how to do this elegantly?


Hello,

You could use the same trick that is sometimes used to embed lattice 
calls into print calls (see the grid vignette for example)


\documentclass[a4paper]{article}
\begin{document}
aa,eval=FALSE,echo=T=
rnorm( 200 )
echo=F=
txt - capture.output( {
aa
   } )
if( length(txt)  10 ){
   txt - c( txt[1:10], ... )
}
cat( txt, sep = \n )
@
\end{document}


Thank you Romain - I did not know of that construct.





By the way I just discovered the SweaveListingUtils package by Peter 
Ruckdeschel (on CRAN), which produces beautifully printed R code in 
Sweave code chunks.  I put some info about it at 
http://biostat.mc.vanderbilt.edu/SweaveTemplate which has our Sweave 
template for statistical reports.
You might also be interested by the driver that comes with the highlight 
package (not yet on cran though, but the r-forge version is stable enough).


  install.packages(highlight, repos=http://R-Forge.R-project.org;)
  require( highlight )
  Sweave( file, driver = HighlightWeaveLatex() )


Interesting.  What would be the corresponding batch file command to 
achieve this?  I like to run R CMD Sweave my.Rnw.  And would you mind 
giving a very brief comparison of the two highlighting approaches 
regarding the LaTeX output?


Thanks!
Frank


*||*


Thanks
Frank






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

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


Re: [R] Excel Export in a beauty way

2009-06-06 Thread Erich Studerus, Psychiatrische Uni-Klinik

Hi,

Here's a function to export dataframes to an excel-file with the RDCOMClient 
package. It makes bold headers and fits the column widths automatically. If 
more than one dataframe is provided to the function, the dataframes are 
saved to seperate spreadheets within file.


export.xls - function (..., colnames = TRUE, rownames = FALSE) {

require(RDCOMClient, quietly = TRUE)
y - COMCreate(Excel.Application)
wbs - y$Workbooks()
wb -wbs$add()
shs - wb$Worksheets()

export - function(df, sheetname, sheetnr, colnames = colnames,
rownames = rownames) {
if (!is.data.frame(df)) {
df - as.data.frame(df)
if (ncol(df) == 1) names(df) - sheetname}

cl - sapply(df, function(x) class(x)[1])
dates - which(cl == 'Date')
for (i in dates) df[, i] - format(df[,i], '%Y.%m.%d')
datetimes - which(cl %in% c('POSIXt', 'POSIXct', 'POSIXlt'))
for (i in datetimes) df[, i] - format(df[,i], '%Y.%m.%d %H:%M')
numerics - cl == 'numeric'
for (i in which(!numerics)) df[, i] - as.character(df[, i])
nas - sapply(df, function(x) any(is.na(x)))
missings - which(!numerics  nas)
for (i in missings) df[is.na(df[, i]), i] - ''
  
sh - shs$Item(sheetnr)

sh[['Name']] - sheetname
nr - nrow(df) + colnames
nc - ncol(df) + rownames
cn - dimnames(df)[[2]]
rn - dimnames(df)[[1]]

startstop - function(x) {
l - length(x)
stops - starts - rep(NA, l)
if (x[1] == TRUE) starts[1] - 1
for (i in seq_along(x)[-1]) {
 if (x[i] == TRUE  x[i-1] == FALSE) starts[i] - i
 if (x[i] == FALSE  x[i-1] == TRUE) stops[i] - i-1
 }
if (x[l] == TRUE) stops[l] - l
rbind(starts = starts[!is.na(starts)], stops = stops[!is.na(stops)])
}

startrow - 1+colnames
startcol - 1+rownames
num - startstop(numerics)
num2 - num + rownames
for (i in seq_len(ncol(num))) {
x - sh$Range(sh$Cells(startrow,num2[1,i]), sh$Cells(nr, num2[2,i]))
x[['Value']] - asCOMArray(df[, num[1,i]:num[2,i]])
}

notnum - startstop(!numerics)
notnum2 - notnum + rownames
for (i in seq_len(ncol(notnum))) {
  x - sh$Range(sh$Cells(startrow, notnum2[1, i]), sh$Cells(nr,
  notnum2[2, i]))
  x[['Value']] - asCOMArray(df[,notnum[1,i]:notnum[2,i]])
  }

missings - which(numerics  nas) + rownames
for (i in missings)   {
na - startstop(is.na(df[,i-rownames])) + colnames
for (k in seq_len(ncol(na)))  {
  x - sh$Range(sh$Cells(na[1, k] , i), sh$Cells(na[2, k], i))
  x[['Value']] - ''
  }
}

for (i in (1+rownames):nc) {
  x - sh$Cells(1,i)
  if (colnames)  {
 x[['Value']]-cn[i-rownames]
 Font - x$Font()
 Font[['Bold']] - TRUE
 }
  EntCol -x$EntireColumn()
  if (i %in% dates)  EntCol[['NumberFormat']] - '.MM.TT'
  if (i %in% datetimes)  EntCol[['NumberFormat']] - '.MM.TT hh:mm'
  EntCol$AutoFit()
  }
if (rownames)  {
  x - sh$Range(sh$Cells(startrow,1),sh$Cells(nr,1))
  x[['Value']] - asCOMArray(rn)
  EntCol -x$EntireColumn()
  Font - x$Font()
  Font[['Bold']] - TRUE
  }
}

dfn - deparse(substitute(list(...)))
df - list(...)
dfn - gsub('^list\\(', '', dfn)
dfn - gsub('\\)$', '', dfn)
dfn - gsub('[ ]', '', dfn)
dfn - strsplit(dfn, split = ',')[[1]]
dfn - make.names(dfn, unique = TRUE)
if (length(df)  2) for (i in seq_len(length(df) - 2)) shs$Add()
for (i in seq_len(length(df))) export(df[[i]], sheetname = dfn[i],
 sheetnr = i, colnames = colnames, rownames = rownames)
y[[Visible]] - TRUE
}

#example:
export.xls(iris, mtcars, trees)



If you are willing to do the work RDCOMClient or rcom packages
give you complete control.  See example here:
https://stat.ethz.ch/pipermail/r-help/2005-July/075877.html
This assumes your platform is Windows and that you have R and Excel
on the same machine so that R can control Excel.

On Wed, Jun 3, 2009 at 8:29 AM, koj jens.koch at gmx.li wrote:


Hallo all,

I`ve read a lot of things in this forum about an Excel export via R. It is
no problem to export my data frames via write.table or write.xls (xls or
csv), but some things are not very convenient for me: I always have to
adjust the column with to see all the numbers or the text and there is no
frame between the cells. And I missing the possibility to make some headers
bold or coloured. I`ve see the output from a Perl-Export and this is a very
nice thing, so my question: Is there really no possibility to produce a xls
or a xlsx - File with this nice features.

Thank you very much in advance,

Jens.


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


Re: [R] large numbers of observations using ME() of spdep

2009-06-06 Thread Emmanuel Charpentier
Le dimanche 07 juin 2009 à 02:50 +0900, lucero mariani a écrit :
 Dear All,
 We aim to remove the spatial structure of our data using Moran Eigen
 Vectors and spdep package . Our data has 3694 samples and 13
 variables.
 The computer stop working after almost 4 days of processing (we found
 it emitting a sharp sound and with all colors on the screen. No
 wories, it was restared without problem!).

Cool ! Farm it out to a night club (and get a real computer with the
proceedings).

Sorry. Couldn't resist !

And twice sorry to be unable to help with your *real* problem...

Emmanuel Charpentier

 And we are left with
 nothing: no result file was produced since the calculations were
 interrumpted!
 Consequently, I am looking for a way to accelerate calculations with
 ME() of spdep and to save the results step by step (for each eigen
 value).
 I came accross several promissing ideas: 1)make a compiled program in
 C and call it in R with the command system(); 2)use muliR. However, I
 do not know how to use these tools. I do not understand exactely why
 the calculations are so slow and I do know know how to write a program
 in C...
 I am using Ubuntu 9.04 and R version 2.8.1 .
 
 The code in R is a fallows:
 taimin.xy = taimin[c(dy, dx)];
 coordinates(taimin.xy) - ~dy+dx; #dy, dx, name of the respective
 coordinate columns
 coords-coordinates(taimin.xy);
 library(spdep);
 TaiminGabrielGraph-gabrielneigh(coords, nnmult = 12);
 tai.gab.nb-graph2nb(TaiminGabrielGraph,sym=TRUE);
 nbtaim_distsg - nbdists(tai.gab.nb, coords);
 nbtaim_simsg - lapply(nbtaim_distsg, function(x) (1-((x/(4*50))^2)) );
 MEtaig.listw - nb2listw(tai.gab.nb, glist=nbtaim_simsg, style=B);
 sevmtaig - ME(Presabs
 ~Age+Curv+Zon2005+ZoneMeiji+Wi+Sol+Slope+Seadist+Elev+Basin,data=taimin,
 family=binomial,listw=MEtaig.listw)
 
 Any help is welcome!
 
 Thanks
 
 Lucero Mariani, Yokohama National University, Japan.
 

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


Re: [R] A very frustrating read.table error message

2009-06-06 Thread hadley wickham
On Sat, Jun 6, 2009 at 5:02 PM, Adam D. I. Kramera...@ilovebacon.org wrote:
 Dear Colleagues,

        Occasionally I deal with computer-generated (i.e., websurvey) data
 files that haven't quite worked correctly. When I try to read the data into
 R, I get something like this:

 Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings,
 :
  line 26 did not have 648 elements

 ...is there any way to get R to tell me how many elements line 26 *did*
 have? That information would take this error message from frustrating to
 useful.  :)

?count.fields

Hadley

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

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


Re: [R] A very frustrating read.table error message

2009-06-06 Thread Jonathan Baron
On 06/06/09 15:02, Adam D. I. Kramer wrote:
 Dear Colleagues,
 
   Occasionally I deal with computer-generated (i.e., websurvey) data
 files that haven't quite worked correctly. When I try to read the data into
 R, I get something like this:
 
 Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings,
 :
line 26 did not have 648 elements
 
 ...is there any way to get R to tell me how many elements line 26 *did*
 have? That information would take this error message from frustrating to
 useful.  :)

count.fields()

More generally, you might be interested in our approach to integrating
data collection on the Web, using JavaScript, with R.  See

http://promberger.info/
(which says private but Google finds it pretty fast)
http://finzi.psych.upenn.edu/~baron/ex/template.htm
http://finzi.psych.upenn.edu/~baron/ex/template.html
http://finzi.psych.upenn.edu/~baron/R/template.R
http://finzi.psych.upenn.edu/~baron/R/TRIM.R

The last makes a nice data file out of the JavaScript output (which is
designed more to be readable at the moment than to be useful).  It
uses count.fields as a check.

None of this stuff is ready for prime time.  In my case, there is a
14-year history, with various baggage left over from earlier travels.

Jon
-- 
Jonathan Baron, Professor of Psychology, University of Pennsylvania
Home page: http://www.sas.upenn.edu/~baron

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


Re: [R] Journal Articles that Have Used R

2009-06-06 Thread Peter Dalgaard

Jason Rupert wrote:

Is there a way to get a reference list of journal articles that have used R?


Ooodles ... as others have pointed out. Another source is the ISI web of 
science citation index, which reportedly shows up over 5000 citations of 
R LANG ENV STAT COMP  or LANG ENV STAT COMP (I can't easily check 
from outside the Uni).




I am just looking for some examples of R graphs and presentation of

results where R was used to generate the results.


Thanks for any feedback and insights.


A recent and relatively high-profile paper is this one

http://www3.interscience.wiley.com/cgi-bin/fulltext/122313738/HTMLSTART

(This paper hit the mainstream press because of the connection to H1N1 
Swine flu)



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

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


[R] EBImage not loading

2009-06-06 Thread Quin Wills
Hello all

I've just spent a few joyless hours trying to get EBImage to install in R.
I'm running Ubuntu (Hardy Heron), fully updated (including R and
Imagemagick). EBImage installation seems to work, but when I
'library(EBImage)' I get the following:

- - - -
Error in dyn.load(file, DLLpath = DLLpath, ...) :
  unable to load shared library '/home/qilin/R/i486-pc-linux-
gnu-library/2.6/EBImage/libs/EBImage.so':
  /usr/lib/libgomp.so.1: cannot allocate memory in static TLS block
Error: package/namespace load failed for 'EBImage'
- - - -

Which is meaningless to me. Any help would be enormously appreciated,
thanks.

Quin

* Quin Wills *
* DPhil candidate *

* *

* Department of Statistics
University of Oxford
1 South Parks road
Oxford
OX1 3TG
+44 (0)1865 285 394
*

[[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] p-values from VGAM function vglm

2009-06-06 Thread David Winsemius


On Jun 6, 2009, at 4:13 AM, Emmanuel Charpentier wrote:


Dear David,

Le vendredi 05 juin 2009 à 16:18 -0400, David Winsemius a écrit :

On Jun 5, 2009, at 3:15 PM, Steven Matthew Anderson wrote:


Anyone know how to get p-values for the t-values from the
coefficients produced in vglm?
Attached is the code and output — see comment added to output to
show where I need p-values


+ print(paste(**   Using VGAM function gamma2
**))
+ modl2-
vglm(MidPoint~Count,gamma2,data=modl.subset,trace=TRUE,crit=c)
+ print(coef(modl2,matrix=TRUE))
+ print(summary(modl2))


[1] **   Using VGAM function gamma2 **
VGLMlinear loop  1 :  coefficients =
0.408464609241,  3.255887520104, -0.000220585671
VGLMlinear loop  2 :  coefficients =
2.34723239e-01,  1.28969691e+00, -4.52393778e-05
VGLMlinear loop  3 :  coefficients =
2.19500481e-01,  1.92534895e+00, -3.02160949e-05
VGLMlinear loop  4 :  coefficients =
2.19383151e-01,  2.26845910e+00, -3.00838664e-05
VGLMlinear loop  5 :  coefficients =
2.19383045e-01,  2.34645688e+00, -3.00836087e-05
VGLMlinear loop  6 :  coefficients =
2.19383045e-01,  2.34977070e+00, -3.00836082e-05
VGLMlinear loop  7 :  coefficients =
2.19383045e-01,  2.34977637e+00, -3.00836082e-05
VGLMlinear loop  8 :  coefficients =
2.19383045e-01,  2.34977637e+00, -3.00836082e-05
log(mu) log(shape)
(Intercept)  2.193830e-01   2.349776
Count   -3.008361e-05   0.00

Call:
vglm(formula = MidPoint ~ Count, family = gamma2, data =  
modl.subset,

  trace = TRUE, crit = c)

Pearson Residuals:
 Min   1Q   Median  3Q Max
log(mu)-1.7037 -0.82997 0.072275 0.78520 1.72834
log(shape) -2.5152 -0.32448 0.254698 0.58772 0.70678


# NEED P-VALUES HERE #


Perhaps:

dt(summary( modl2 )@coef3[ , 3], 1)


???

1) dt() is the density. didn't you mean pt() ?


Quite right.



2) I'd rather quote 2*min(pt(), 1-pt()) (bilateral tests, y'know...)
3) The real hitch here is : what are the right DoF ? I do not think
there is an easy answer to *this* one...


Which may be the reason that the summary method was not designed that  
way?





Emmanuel Charpentier



Coefficients:
  Value Std. Error  t value
(Intercept):1  2.1938e-01 5.2679e-02  4.16455
(Intercept):2  2.3498e+00 1.7541e-01 13.39574
Count -3.0084e-05 8.9484e-05 -0.33619

Number of linear predictors:  2

Names of linear predictors: log(mu), log(shape)

Dispersion Parameter for gamma2 family:   1

Log-likelihood: -26.39268 on 123 degrees of freedom

Number of Iterations: 8


Steven Matthew Anderson

Anderson Research, LLC
Statistical Programming and Analysis
SAS (R) Certified Professional
adastr...@mac.com




David Winsemius, MD
Heritage Laboratories
West Hartford, CT

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


Re: [R] No --no-latex?

2009-06-06 Thread Jim Lemon

10:08
 Looks like it was an oversight.  I'll fix it.

10:35
 Looks like the corresponding  else if  clause got omitted in

 tools:::.install_packages()

 and before that in share/R/RINSTALL.

12:34
 Brian Ripley got there first, so it's fixed now in R-devel and 
R-patched.


I thank you all, and am amazed at the speed of response.

Jim

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Survreg function for loglogistic hazard estimation

2009-06-06 Thread chenjiakai

I am trying to use R to do loglogistic hazard estimation.  My plan is to
generate a loglogistic hazard sample data and then use survreg to estimate
it.  If everything is correct, survreg should return the parameters I have
used to generate the sample data.  

I have written the following code to do a time invariant hazard estimation. 
The output of summary(modloglog) shows the factor loading of dfico is -0.002
instead of 0.005.  Also I can not find the survreg's output of alpha and
beta of loglogistic regression.  Any comments?  Thanks a lot, 

Jiakai Chen

Code: 

BEGIN==
# A time invariant loglogistic estimation
library(survival)

# Clear the workspace
rm(list = ls(all = TRUE))

# Totally 100K samples which may die during 100 periods 
timeline = 100 
samplesize = 10


dfico - rnorm(samplesize, mean = 0, sd = 25)
dficoeff - 0.005

# Baseline loglogistic hazard function stored in bhaz
a- 20
b - 4
time - 1:timeline
bhaz - ((b/a) * (time /a) ^ (b-1))/(1+(time/a)^b)

# Event time stored in endtime.  Baseline hazard function is controlled by 
# dfico value with factor loading dficoeff

endtime - numeric(samplesize)
for ( i in 1:samplesize) {
rnos - runif(timeline)
endtime[i] - which(rnos = bhaz * exp(dfico[i]*dficoeff))[1]
}

# Construct data frame
raw - data.frame(end = endtime, status = 1, fico_demean = dfico)

# Adding censorship
for( i in 1:samplesize) {
if(is.na(raw$end[i])) {raw$status[i] - 0} 
}
for( i in 1:samplesize) {
if(is.na(raw$end[i])) {raw$end[i] - timeline }
}

# Output the factory
factory - factor(raw$end)
plot(factory)

# Use survreg to estimate the coefficents of loglogistic distribution
modloglog - survreg(Surv(end, status) ~ fico_demean, data = raw, model =
TRUE, dist = 'loglogistic')

summary(modloglog)
END==
-- 
View this message in context: 
http://www.nabble.com/Survreg-function-for-loglogistic-hazard-estimation-tp23907598p23907598.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] RPostgreSQL segfault with LEFT JOIN

2009-06-06 Thread Joe Conway

Dylan Beaudette wrote:


After some further investigation, I see that the query works fine if I *do not 
use column aliases* :


Looks like *any* query using a column alias will segfault unless the 
alias exactly matches the column name (in which case why bother). The 
code starting at line 423 in RS-PostgreSQL.c looks like:


8---
if(PQftablecol(my_result,j) !=0) {

/* Code to find whether a row can be nullable or not */
sprintf(buff,
select attnotnull from pg_attribute
 where attrelid=%d and attname='%s',
PQftable(my_result,j),(char*)PQfname(my_result,j));
res = PQexec (conn, buff );

if(strcmp(PQgetvalue(res,0,0),f)==0) {
8---
The crash occurs at line 430 (the strcmp()) because PQgetvalue(res,0,0) 
returns NULL.


PQfname() will return the column alias, not the actual column name, 
therefore the PQexec() here returns no results. At the very least, 
PQresultStatus(res) or perhaps PQntuples(res) should be used immediately 
after PQexec() to ensure you have a good result before trying to use it 
in strcmp().


In any case, I think the simple fix (untested) is something like:

8---
if(PQftablecol(my_result,j) !=0) {

/* Code to find whether a row can be nullable or not */
sprintf(buff,
select attnotnull from pg_attribute
 where attrelid=%d and attnum=%d,
PQftable(my_result,j),PQftablecol(my_result,j));
8---
i.e. use the table column number and pg_attribute.attnum field.

This is beyond what is appropriate for r-help, so I suggest any further 
discussion go off-list (or is there somewhere more appropriate, e.g. 
r-devel?)


HTH,

Joe

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