[ESS] New Emacs? New ESS? New Emacs Modified distributions!

2024-05-12 Thread Vincent Goulet via ESS-help
Hi folks,

With the recent releases of GNU Emacs 29.3 and ESS 24.01.1 (yay!), I was due 
for updates of my Emacs Modified for (macOS|Windows) distributions. With the 
Winter semester ending, I finally had some time to devote to the project. I'm 
pleased to announce that versions 29.3-modified-1 are now available:

https://emacs-modified.gitlab.io

Excerpts from the release notes:

## New feature

- The distribution now includes polymode (version 0.2.2) and the
  polymodes poly-R, poly-noweb, poly-markdown. Polymodes are
  associated with .Rnw and .Rmd files (only).

## Updates

- Emacs 29.3 released 24 March 2024.
- ESS 24.01.1.
- AUCTeX 13.3.
- Libre Office English dictionary 2024.05.01.
- Libre Office Spanish dictionary 2.8.

## Changes

- With the new official release of ESS, the "Legacy Emacs and ESS"
  editions are no longer developed.

Best,

v.

Vincent Goulet
Professeur titulaire
École d'actuariat, Université Laval
__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] How to get working Rnw file name inside script

2024-05-08 Thread Vincent Goulet via ESS-help
I'm not sure this is what you're looking for, but here goes. I have been using 
the following function for a number of years to extract the name of the file 
from which Sweave is called.

###
### getSourceName()
###
##  Extract the name of the file used in the command 'Sweave' calling
##  this function.
##
##  Value
##
##  Filename as a character string
##
getSourceName <- function()
{
   args <- commandArgs(FALSE)

   ## If Sweave is launched with
   ##
   ##   R -e "Sweave('foo.Rnw', ...)"
   ##
   ## the expression is one of the arguments and we can extract the
   ## filename.
   if (length(cmd <- grep("Sweave\\(", args, value = TRUE)))
   return(regmatches(cmd,
 regexpr("(?<=Sweave\\(['\"]).*(?=['\"])",
 cmd, perl = TRUE)))

   ## If Sweave is launched with
   ##
   ##   R CMD Sweave --encoding="utf-8" foo.Rnw
   ##
   ## the argument containing the relevant information is a character
   ## string of the form
   ##
   ##   nextArg--encoding=utf-8nextArgfoo.Rnw
   ##
   ## The arguments are in the order they were entered at the command line.
   if (length(cmd <- grep("^nextArg", args, value = TRUE)))
   return(grep("^--|^$", strsplit(cmd, 'nextArg', fixed = TRUE)[[1L]],
   invert = TRUE, value = TRUE))
}

Hope this helps!

v.

Vincent Goulet
Professeur titulaire
École d'actuariat, Université Laval

> Le 28 avr. 2024 à 01:57, Susumu Tanimura via ESS-help 
>  a écrit :
> 
> Dear all,
> 
> When using the Stangle() function within an Rnw file to insert an
> entire R code into an appendix of a document, it is necessary to
> provide the working Rnw file name. While manually entering the name is
> a viable option, it would be beneficial for me to implement it within a
> template for Rnw files. 
> 
> My question is how to get working Rnw file name inside script.
> 
> This issue is not directly related to ESS, but the solution must be
> compatible with ESS and Emacs.
> 
> Thank you
> 
> -- 
> Susumu Tanimura
> 
> __
> ESS-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


[ESS] Strange problem with .Rnw files (emacs-modified-27.2-modified-3)

2023-08-29 Thread Vincent Goulet via ESS-help
Hi all,

I'm stumbling on a puzzling issue working with .Rnw files using my own Emacs 
distribution based on ESS 18.10.2. (Annoying since I stay on 27.2 precisely to 
work with Sweave files the classical ESS way.)

Version 27.2-modified-1 (March 2021) includes AUCTeX 12.3 and works just fine.

The latest (July 2023) version 27.2-modified-3 includes AUCTeX 13.2 and upon 
visiting a .Rnw file, the LaTeX mode is not activated. The mode line indicates: 
Fundamental Noweb NWFL. At first I thought this must be an AUCTeX issue or 
change, but then the only error message I get in the *Messages* buffer is:

File mode specification error: (wrong-type-argument listp ess-inside-string-p)

Any idea what may cause this? To the best of my knowledge, ESS and the 
initialization files are identical in both versions.

Thanks in advance!

v.

Vincent Goulet
Professeur titulaire
École d'actuariat, Université Laval

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


[ESS] New Emacs Modified distributions - now double the pleasure!

2023-08-15 Thread Vincent Goulet via ESS-help
Hi folks,

Back in April 2022 [*], I asked here if there was still interest in my 
distributions of Emacs that ship with ESS and AUCTeX ready to go. Since the 
response was generally positive, and since, more importantly, there is still 
interest from the first user of these distributions (that's me, at least on 
macOS), well I'm pleased to announce new releases of my Emacs Modified 
distributions for macOS and Windows:

https://emacs-modified.gitlab.io <https://emacs-modified.gitlab.io/>

Double the pleasure? The distributions now come in two editions: "Latest Emacs 
and ESS" based on GNU Emacs 29.1 and the tip of the development branch of ESS; 
"Legacy Emacs and ESS" based on Emacs 27.2 and ESS 18.10.2 (the latest official 
release). Everything else is the same. In other words, the "legacy" 
distributions now get the updates to the other packages, in particular AUCTeX. 
As someone who still prefers (or is too much used to) ESS 18.10, I felt left 
behind on the other fronts by my own distributions.

This update required much more time than I originally thought, but everything 
is in place now. You will notice that I merged the two projects "Emacs Modified 
for macOS" and "Emacs Modified for Windows" under the umbrella project "Emacs 
Modified for (macOS|Windows)". A little touch of geekiness in the name is Good. 
(I flirted with the idea to use the true Emacs-lisp regex '\(macOS\|Windows\)', 
but it was too much.) :-D

I hope an editor of the ESS web page will read this; could you please update 
the links on the Download page?

Best,

v.

Vincent Goulet
Professeur titulaire
École d'actuariat, Université Laval

* https://stat.ethz.ch/pipermail/ess-help/2022-April/013050.html
__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


Re: [ESS] build problem

2023-02-07 Thread Vincent Goulet via ESS-help

> Le 5 févr. 2023 à 10:44, Dirk Eddelbuettel via ESS-help 
>  a écrit :
> 
> 
> On 5 February 2023 at 15:01, Sparapani, Rodney via ESS-help wrote:
> | I don�t have 28 on this machine. I am using 26 since there is not much
> | benefit upgrading.
> 
> I am really sorry but I cannot let this stand. It is too close to FUD.
> 
> As a general rule, newer *is* better. Features get added, bugs get fixed.
> 
> Now, whether to upgrade or not is a personal choice, people may have
> different circumstances or constraints. But some systems _do_ make it both
> simple and convenient, and I have worked on (and contributed to) such systems
> for longer than a quarter century.  And I for one am enjoying Emacs 28, now
> with an easily-installed .deb from Debian (thanks to Sébastien; I am running
> the Debian .deb without any hiccups on Ubuntu) also with current(ish) ESS,
> and it fabulous. In good part thanks to improved backend support (lsp server
> comes to mind, but also rendering).
> 
> Yay for progress. Yay for volunteers taking care of these upgrades.
> 
> Dirk

I wouldn't go so far as Rodney, nor for the same reason, but I'm still mainly 
on 27.2 to be able to use the good ol', stable, ESS 18.10. 

v.

Vincent Goulet
Professeur titulaire
École d'actuariat, Université Laval


__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


[R] [R-pkgs] Announcing RweaveExtra

2021-06-02 Thread Vincent Goulet via R-packages
Hi all,

A new package is now available on CRAN: RweaveExtra 1.0-0, which provides 
"Sweave Drivers with Extra Tricks Up their Sleeve".

Call me an old timer, but I always stuck to Sweave ever since it introduced me 
to literate programming. I just prefer the simplicity of the system. 

Now, I developed a workflow over the last few of years where one option was 
missing in the weave and tangle steps: the ability to completely ignore a 
code chunk. Sure, one can use 'eval = FALSE', but this is not equivalent. 
First, the code in the chunk is parsed. Second, the code is commented out in 
the tangled file. 

What if I want to write unparsable code (say for didactic purposes) or code in 
a foreign language altogether, and that I want this code to appear as is in the 
tangled script? This is where RweaveExtra comes in. Use the 'RweaveExtraLatex' 
driver with the chunk option 'ignore.on.weave=TRUE' and the code in the chunk 
will be completely ignored (not even parsed) on the weave step, but it will 
still be written out verbatim (uncommented) in the tangle step. (For symmetry 
reasons, an 'ignore.on.tangle' option also exists for the 'RtangleExtra' 
driver, but I never had use for it.)

See ?RweaveExtraLatex for a complete example.

I have been using the package "privately" for the past year without any issue.

I hope that the new drivers may prove useful to the community.

Vincent Goulet
École d'actuariat
Université Laval
___
R-packages mailing list
r-packa...@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-packages

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


Re: [ESS] emacs 27.1 crashes regularly on Mac M1

2021-03-02 Thread Vincent Goulet via ESS-help
Hi Richard,

I can't test as I don't have an M1 Mac available. 

Did you try David Caldwell's "bare" binaries: https://emacsformacosx.com. Those 
are the binaries my distribution is based on.

HTH

v.

> Le 1 mars 2021 à 23:32, Richard M. Heiberger  a écrit :
> 
> I don't know if this is emacs issue or an emacs plus ESS issue.
> I am using Vincent Goulet's
> "Emacs Modified for macOS is a distribution of GNU Emacs 27.1 (released 
> August 10, 2020) bundled with a few select packages for R developers and 
> LaTeX users."
> 
> Process:   Emacs-x86_64-10_14 [1112]
> Path:  
> /Applications/Emacs.app/Contents/MacOS/Emacs-x86_64-10_14
> Identifier:org.gnu.Emacs
> Version:   Version 27.1 (9.0)
> Code Type: X86-64 (Translated)
> Parent Process:??? [1]
> Responsible:   Emacs-x86_64-10_14 [1112]
> User ID:   501
> 
> Date/Time: 2021-03-01 23:25:38.949 -0500
> OS Version:macOS 11.2.1 (20D74)
> Report Version:12
> Anonymous UUID:CD05A40D-F8F8-8D66-467F-B3BD97895B44
> 
> Sleep/Wake UUID:   DB08A8C9-1154-4E41-AC03-5301812DB8E1
> 
> Time Awake Since Boot: 28000 seconds
> Time Since Wake:   9400 seconds
> 
> 
> 
> System Integrity Protection: enabled
> 
> Crashed Thread:0  Dispatch queue: com.apple.main-thread
> 
> Exception Type:EXC_CRASH (SIGABRT)
> Exception Codes:   0x, 0x
> Exception Note:EXC_CORPSE_NOTIFY
> 
> Application Specific Information:
> Assertion failed: (mach_vm_map(mach_task_self(), , size, 0, 
> VM_FLAGS_ANYWHERE | VM_MAKE_TAG(VM_MEMORY_COREGRAPHICS_BACKINGSTORES), port, 
> 0, false, prot, prot, VM_INHERIT_SHARE) == KERN_SUCCESS), function 
> backing_map, file 
> /AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/SkyLight/SkyLight-570.7/SkyLight/Services/Windows/CGSBackingStore.c,
>  line 192.

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


[ESS] Latest Emacs distributions out!

2020-09-17 Thread Vincent Goulet via ESS-help
Hi all,

With some delay, I'm glad to announce that my "modified" Emacs distributions 
for Windows and macOS based off GNU Emacs 27.1 are out:

Windows: https://vigou3.gitlab.io/emacs-modified-windows/
macOS: https://vigou3.gitlab.io/emacs-modified-macOS/

For those of you unfamiliar with these distributions: they are almost stock 
distributions of GNU Emacs with ESS, AUCTeX, org and a few other goodies 
preinstalled. I use the macOS version myself on a daily basis.

In the Windows version, I added a simple, temporary fix for ESS 18.10.2 to find 
the versions of R 4.x.y on one's system. The site-start.el includes this line:

(setq ess-r-versions '("R-1" "R-2" "R-3" "R-4" "R-devel" "R-patched"))

Here 'M-x R' does not work as expected, by 'M-x R-[TAB]' correctly lists all 
the versions of R on my system, including 4.0.2.

Best,

v.

Vincent Goulet
Professeur titulaire
École d'actuariat, Université Laval

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


[R] [R-pkgs] 3.0-0 milestone for actuar

2020-06-08 Thread Vincent Goulet
Dear useRs and developeRs,

We are proud to announce that version 3.0-0 of actuar is now available on CRAN.

This newest release further extends support of the package for heavy tail and 
extreme value size distributions. It also introduces a package API, so that 
developers may easily integrate our C code into their own package.

From the NEWS file:

• Support functions ‘[dpqrm,lev]fpareto’ for the Feller-Pareto
  distribution and related Pareto distributions with a
  location parameter. The Feller-Pareto defines a large family
  of distributions encompassing the transformed beta family
  and many variants of the Pareto distribution. Using the
  nomenclature of Arnold (2015), the following distributions
  are now supported by ‘actuar’: Feller-Pareto, Pareto IV,
  Pareto III, and Pareto II. The Pareto I was already
  supported under the name Single Parameter Pareto.

• The package now exposes through an API its 200+ C routines
  for probability functions and the beta integral. This is
  documented in a new section of the “distributions” package
  vignette. See file ‘include/actuarAPI.h’ in the package
  installation directory for the complete list of exported
  routines.

The complete NEWS is available on CRAN as usual:

https://cran.r-project.org/web/packages/actuar/news.html

Cheers,

Vincent Goulet
Professor
École d'actuariat, Université Laval

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


Re: [ESS] A few issues and questions from a newbie in R/ESS

2020-01-12 Thread Vincent Goulet via ESS-help
Hi Joakim,

If you're new to R, ESS and Emacs, then perhaps the few recommandations below 
from an old timer (I guess I'm entitled to this now) shoud be useful.

> Le 11 janv. 2020 à 22:08, Joakim Frögren via ESS-help 
>  a écrit :
> 
> Hi, 
> 
> I am new to ESS and R, and in fact relatively new to statistics and
> Emacs as well, so please be gentle. I am om macOS Catalina 10.15.2 and
> Emacs 26.1 (9.0). Here [1] is my init file. I am facing a few problems
> at the startup of R and ESS within Emacs that I have struggled with the
> last few days since I downloaded R and the ESS package. I installed R
> through homebrew

Do you use CRAN R. I think the general consensus in the R community (at least 
the "core" community) is that there is no advantage in using homebrew R. 
Furthermore, you will find it more difficult to get help in the official 
mailing lists if you don't use CRAN R.

> and ESS through Melpa.

If you allow the shameless plug, climb on my back and use my distribution of 
Emacs for macOS bundled with ESS, AUCTeX and some other goodies. You'll have 
something that works out of the box (and that I use daily myself) and that 
fixes some of the problems you have (see below).

https://vigou3.gitlab.io/emacs-modified-macos/

> The problems do not occur when I
> launch R from the command line, only when I launch R and ESS from within
> Emacs. There are two issues related to startup of ESS/R. 
> 
> First issue: 
> 
> Whenever I start ESS in Emacs, by M-x R, I am asked to answer the
> following question:_ R starting project directory? _I do not understand
> the necessity of this

It's not a bug, it's a feature, and most likely one you'll come to appreciate 
in the long run. Actually, I'm pretty confident most ESS folks will agree that 
this is something RStudio got completely wrong: always launching R with the 
same working directory.

Just imagine you need to work on two different projects simultaneously, each 
with its own R session. Emacs and ESS allow this and you set separate working 
directories right from the outset. Good luck doing this with RStudio.


> and especially why ESS doesn't remember and
> assumes that whenever I start it I would like to have the same project
> directory as the last session.

Perhaps is this possible, I never bothered. But then, I also don't bother 
shutting down my R sessions very often, so it becomes a non issue.

> This is something that i am not being
> asked when I launch R through the command line. What should I do to not
> have to fill in this information for each new session? 
> 
> Second issue: 
> 
> When I run R from the command line , it uses the correct locale. When I
> run an R process in Emacs though, I get the following warning: 
> 
> During startup - Warning messages:
> 1: Setting LC_CTYPE failed, using "C" 
> 2: Setting LC_COLLATE failed, using "C" 
> 3: Setting LC_TIME failed, using "C" 
> 4: Setting LC_MESSAGES failed, using "C" 
> 5: Setting LC_MONETARY failed, using "C" 

Yes, Emacs does not import the shell environment on macOS. I take care of this 
in my distribution. 

[...]

> Third issue: 
> 
> At 16:25 in the video he speaks about Pacman, as a way to manage add-on
> R packages. He speaks that the add-ons are necessary to 'load' in order
> to function. In what way is this done in ESS? Do I have to 'load'
> packages before I used them or are they already available and ready to
> use? How does this work? I should say here that I download packages
> through Melpa. 

Take 5 minutes to setup a personal library for R packages.

1. Create a directory to host the library. In the sequel I'll use 
~/Library/R/library.

2. Create a ~/.Renviron file with the following contents:

R_LIBS_USER="~/Library/R/library/"
R_INTERACTIVE_DEVICE=quartz

3. Restart R and check with '.libPaths()' that your personal library is now in 
first position.

4. Install R packages from R with 'install.packages()'.

5. Don't look behind.

> Forth issue: 
> 
> At 20:39 in the video, he speaks about ?plot and help functions in R. In
> RStudio this help information opens up in a separate window, but in
> Emacs this information is shown in the same buffer as used for the
> regular tasks. What settings should I put in order to get this help
> information presented in a new buffer. I would prefer to have the
> following setup.  .R file in an upper buffer, the *R* in the lower
> buffer. When opening ?plot, I woul like the lower buffer to split and
> the ?plot information being presented on the right hand. 

It is possible; others may answer for this one or you may search the list' 
archives. It's been discussed before.

> Fifth issue: 
> 
> At 30:40 in the video he speaks about creating a table and in RStudio he
> is able to run the following entry (cylinders <- table(mtcars$cyl)) and
> then get to see information about name, type, length, size and value of
> the table in the top right corner of RStudio. Is this possible to do in
> ESS as well in a similar wy? Which command 

Re: [ESS] ESS 17.11 released

2017-11-16 Thread Vincent Goulet
Please note that I just released updated versions of my distributions:

https://vigou3.github.io/emacs-modified-macos/
https://vigou3.github.io/emacs-modified-windows/

I realized while building that I really fell behind in my update schedule. The 
distributions feature the following updates:

- Emacs 25.3
- ESS 17.11
- AUCTeX 11.91
- Org 9.1.3
- markdownmode.el v2.3

Best,

v.

> Le 13 nov. 2017 à 04:11, Martin Maechler  a écrit 
> :
> 
> Dear  ESS  users
> 
> I'm happy to announce the release of  ESS 17.11  (2017 - November)
> in the name of the ESS core team.
> 
> The change since the last release 16.10 are not spectacular
> maybe, but there have been many small improvements and bug
> fixes and the improvements for package developer etc may be
> particularly important.
> 
> 
> For the complete list of (documented) new features and bug
> fixes, read the following (beginning of file 'ANNOUNCE') to the end.
> 
> In the name of the ESS core team, with thanks to all helpers,
> notably by github pull requests, 
> Martin
> 
> --
> Martin Maechler, ETH Zurich
> 
> 
> 
> 1 ANNOUNCING ESS
> 
> 
> The ESS Developers proudly announce the release of ESS 17.11
> 
>   Emacs Speaks Statistics (ESS) provides an intelligent, consistent
> interface between the user and the software.  ESS interfaces with
> R/S-PLUS, SAS, BUGS/JAGS, Stata and other statistical analysis packages
> under the UNIX, GNU Linux, Microsoft Windows, macOS and other operating
> systems.  ESS is a package for the GNU Emacs and XEmacs text editors
> whose features ESS uses to streamline the creation and use of
> statistical software.  ESS knows the syntax and grammar of statistical
> analysis packages and provides consistent display and editing features
> based on that knowledge.  ESS assists in interactive and batch execution
> of statements written in these statistical analysis languages.
> 
>   ESS is freely available under the GNU General Public License (GPL).
> Please read the file COPYING which comes with the distribution, for more
> information about the license.  For more detailed information, please
> read the README files that come with ESS.
> 
> 1.1 Getting the Latest Version
> ==
> 
> The latest released version of ESS is always available on the web at:
> ESS web page (http://ess.r-project.org) or StatLib
> (http://lib.stat.cmu.edu/general/ESS/)
> 
> 1.1.1 Git for ESS development
> -
> 
> For development and experimentation on new ESS features, there is now a
> GitHub branch for ESS, available at .
> 
> 1.2 Current Features
> 
> 
>   * Languages Supported:
>* S family (R and S+ AKA S-PLUS)
>* SAS
>* OpenBUGS/JAGS
>* Stata
>* Julia
>   * Editing source code (S family, SAS, OpenBUGS/JAGS, Stata, Julia)
>* Syntactic indentation and highlighting of source code
>* Partial evaluation of code
>* Loading and error-checking of code
>* Source code revision maintenance
>* Batch execution (SAS, OpenBUGS/JAGS)
>* Use of imenu to provide links to appropriate functions
>   * Interacting with the process (S family, SAS, Stata, Julia)
>* Command-line editing
>* Searchable Command history
>* Command-line completion of S family object names and file
>  names
>* Quick access to object lists and search lists
>* Transcript recording
>* Interface to the help system
>   * Transcript manipulation (S family, Stata)
>* Recording and saving transcript files
>* Manipulating and editing saved transcripts
>* Re-evaluating commands from transcript files
>   * Interaction with Help Pages and other Documentation (R)
>* Fast Navigation
>* Sending Examples to running ESS process.
>* Fast Transfer to Further Help Pages
>   * Help File Editing (R)
>* Syntactic indentation and highlighting of source code.
>* Sending Examples to running ESS process.
>* Previewing
> 
> 1.3 Requirements
> 
> 
> ESS is most likely to work with current/recent versions of the following
> statistical packages: R/S-PLUS, SAS, Stata, OpenBUGS and JAGS.
> 
>   ESS supports current, and recent, stable versions of GNU Emacs
> (currently, 24.4 or higher; alpha/beta/pre-release versions are NOT
> SUPPORTED).
> 
>   Due to XEmacs lacking some features that ESS requires, ESS support of
> XEmacs ended with ESS 12.04-4.
> 
>   To build the PDF documentation, you will need a version of TeX Live
> or texinfo that includes texi2dvi (BEWARE: recent TeX Live, and some
> texinfo RPMs, do NOT include texi2dvi).
> 
> 1.4 Stability
> =
> 
> All recent released versions are meant to be release-quality versions.
> While some new features are being introduced, we are cleaning up and
> improving the interface.  We 

[R] [R-pkgs] Announcing new package expint

2017-01-12 Thread Vincent Goulet
I am pleased to announce the immediate availability on CRAN of the new
package expint: https://cran.r-project.org/package=expint.

The exponential integral

  E_1(x) = int_x^\Inf exp(-t)/t dt,  x real

and the incomplete gamma function

  G(a, x) = \int_x^\Inf t^{a-1} exp(-t) dt, x > 0, a real

are two closely related functions that arise in various fields of
mathematics.

expint is a small package that intends to fill a gap in R's
support for mathematical functions by providing facilities to compute
the exponential integral and the incomplete gamma function.

Furthermore, and perhaps most conveniently for R package developers,
the package also gives easy access to the underlying C workhorses
through an API; see the exhaustive package vignette for details.

The C routines are derived from the GNU Scientific Library.

Best,

v.

___
R-packages mailing list
r-packa...@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-packages

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


[R] [R-pkgs] Major update of package actuar

2016-11-14 Thread Vincent Goulet
rance data with ‘actuar’” as it also covers the new
  functions ‘rmixture’ and ‘rcompound’.

• Vignette ‘"lossdist"’ is renamed to ‘"modeling"’ and it is
  revised to cover the new functionalities of ‘grouped.data’
  and ‘ogive’.

BUG FIX

•  An old and nasty out-of-bounds bug could crash R when using
  the "recursive" method of 'aggregateDist' with a frequency
  distribution from the (a, b, 1) family.


I hope this update will prove useful.

Vincent Goulet, Ph.D.
Professeur titulaire
École d'actuariat, Université Laval

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

Re: [ESS] wget/curl and DOWNLOAD make variable customization WAS: ESS 16.10 released

2016-10-25 Thread Vincent Goulet
I would add that the current (16.10) setup further requires Internet access to 
build ESS. It might be a trivial concern, but shouldn't the archive be complete 
once it's been downloaded?

v.


> Le 25 oct. 2016 à 09:28, Sparapani, Rodney <rspar...@mcw.edu> a écrit :
> 
> 
> To Martin: are you serious about “everyone” having R?  I don’t think you can 
> assume that.
> I often install ESS on systems that don’t have R.  We have many sites (ok 2 
> ;o) that could not
> care less about R.  I do not want to have to install R just to install ESS.  
> And frankly, this
> whole mess is created by julia support which I really do NOT care about at 
> all.
> 
> To Martin and Vincent:  The answer is to customize the DOWNLOAD variable 
> appropriately,
> i.e. on Mac OS X I use DOWNLOAD = curl which you merely have to uncomment in 
> Makeconf.
> 
> Rodney
> 
> 
> Martin 
> Maechler<https://www.mail-archive.com/search?l=ess-help@r-project.org=from:%22Martin+Maechler%22>
>  Mon, 24 Oct 2016 09:38:33 
> -0700<https://www.mail-archive.com/search?l=ess-help@r-project.org=date:20161024>
> X-Body-of-Message
>>>>>> Vincent Goulet <vincent.gou...@me.com>
>>>>>>on Mon, 24 Oct 2016 10:35:15 -0400 writes:
>> To all: my Emacs distributions are updated:
> 
>> macOS: http://vgoulet.act.ulaval.ca/en/emacs/mac/
>> Windows: http://vgoulet.act.ulaval.ca/en/emacs/windows/
> 
> Excellent.
> Thank you very much, Vincent, for providing them so nicely pre-packaged!
> 
>> To Martin and ESS core:
> 
>> I realize I should have tested this in beta phase, but here goes: when
> building ESS from a fresh archive, I get this error on OS X:
> 
>> In end of data:
>> ess-julia.el:431:1:Warning: the following functions are not known to be
>> defined: ess-julia--get-objects, ess-julia--retrive-topics,
>> ess-julia--get-components, ess-julia-objects, company-begin-backend,
>> company-in-string-or-comment, company-doc-buffer,
>> ess-julia-get-object-help-string, julia-mode
>> wget -O -
> https://raw.githubusercontent.com/JuliaLang/julia-emacs/master/julia-mode.el >
> julia-mode.el
>> /bin/sh: wget: command not found
>> make[2]: *** [julia-mode.el] Error 127
> 
>> Indeed, fetching files on OS X (aka macOS now) requires curl instead of
> wget.
> 
> This comes from /Makeconf
> 
> DOWNLOAD = wget -O -
> 
> Since we rely on GNU makefile style anyway, we could replace the
> above by smart if(.) constructions... But MacOS and Windows may
> change again in the future ... (and Linux too, but there we find
> that an replace 'wget ..' appropriately).
> 
> On the other hand, R has  download.file()  and "everybody" has
> R, so we could think of replacing that by
> 
>   Rscript -e 'download.file(..)'
> 
> and rely that R will be updated to keep download.file() always
> working  ??
> 
> 
>> On Windows, wget is ok, but I get an "The certificate of
> 'raw.githubusercontent.com' is not trusted" error.
> 
> Hmm... I think this should be workable-around by a  wget switch?
> 
>> Surprisingly, relaunching the build process worked on both platforms.
> 
> (Well, 'make' is not perfect and even more our Makeconf/Makefile setup is not)
> 
>> Both problems seem related to build system-specific instructions in the
> ESS Makefiles.
> 
> *'Both'* ?  Which problem apart from 'wget -O -' not working
> correctly on Mac and Windows?
> 
>> Hope this helps.
>> v.
> 
> Yes, very much, thank you, Vincent!
> 
> Martin
> 
> __
> ESS-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help
> 
> 
> 
> __
> ESS-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/ess-help

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help

Re: [ESS] ESS 16.10 released

2016-10-24 Thread Vincent Goulet

> Le 24 oct. 2016 à 12:36, Martin Maechler <maech...@stat.math.ethz.ch> a écrit 
> :
> 
>>>>>> Vincent Goulet <vincent.gou...@me.com>
>>>>>>on Mon, 24 Oct 2016 10:35:15 -0400 writes:
> 

[snipped announcement]

>> To Martin and ESS core:
> 
>> I realize I should have tested this in beta phase, but here goes: when 
>> building ESS from a fresh archive, I get this error on OS X:
> 
>> In end of data:
>> ess-julia.el:431:1:Warning: the following functions are not known to be
>> defined: ess-julia--get-objects, ess-julia--retrive-topics,
>> ess-julia--get-components, ess-julia-objects, company-begin-backend,
>> company-in-string-or-comment, company-doc-buffer,
>> ess-julia-get-object-help-string, julia-mode
>> wget -O - 
>> https://raw.githubusercontent.com/JuliaLang/julia-emacs/master/julia-mode.el 
>> > julia-mode.el
>> /bin/sh: wget: command not found
>> make[2]: *** [julia-mode.el] Error 127
> 
>> Indeed, fetching files on OS X (aka macOS now) requires curl instead of 
>> wget. 
> 
> This comes from /Makeconf
> 
> DOWNLOAD = wget -O -
> 
> Since we rely on GNU makefile style anyway, we could replace the
> above by smart if(.) constructions... But MacOS and Windows may
> change again in the future ... (and Linux too, but there we find
> that an replace 'wget ..' appropriately).
> 
> On the other hand, R has  download.file()  and "everybody" has
> R, so we could think of replacing that by
> 
>   Rscript -e 'download.file(..)'
> 
> and rely that R will be updated to keep download.file() always
> working  ??

I could override the DOWNLOAD variable in my Makefile as I do for a few others, 
but I guess a more portable solution on your end would be better. Overriding 
DESTDIR or SITELISP for the specific needs of my distribution is fine, but ESS 
should build normally on common platforms.

>> On Windows, wget is ok, but I get an "The certificate of 
>> 'raw.githubusercontent.com' is not trusted" error.
> 
> Hmm... I think this should be workable-around by a  wget switch?
> 
>> Surprisingly, relaunching the build process worked on both platforms.
> 
> (Well, 'make' is not perfect and even more our Makeconf/Makefile setup is not)
> 
>> Both problems seem related to build system-specific instructions in the ESS 
>> Makefiles.
> 
> *'Both'* ?  Which problem apart from 'wget -O -' not working
> correctly on Mac and Windows?

Sorry for the wording. Yes, one issue, two platforms.

v.

> 
> 
>> Hope this helps.
>> v.
> 
> Yes, very much, thank you, Vincent!
> 
> Martin

__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help

[R] New version of document on R programming - with videos [French]

2014-01-22 Thread Vincent Goulet
I hereby announce the availability of the Fourth edition of my document 
«Introduction à la programmation en R» (in French) in the contributed 
documentation section of CRAN. The document is now accompanied by a set of 
short videos on more challenging topics like creation and indexing of arrays, 
the order() function, etc. In my highly biased opinion, the illustration are 
pretty good. I might consider making English versions if there is sufficient 
interest. The videos are in the YouTube channel

http://www.youtube.com/user/VincentGouletIntroR

Please note that I don't currently monitor r-help regularly, so do not hesitate 
to write to me directly.

***

[The rest of this message is in French for the target audience]

La quatrième édition de mon document «Introduction à la programmation en R» est 
maintenant disponible dans la section de la documentation par les tiers 
(Contributed Documentation) de CRAN:

http://cran.r-project.org/other-docs.html

L’ouvrage est basé sur des notes de cours et des exercices utilisés à l’École 
d’actuariat de l’Université Laval. L’enseignement du langage R est axé sur 
l’exposition à un maximum de code — que nous avons la prétention de croire bien 
écrit — et sur la pratique de la programmation. C’est pourquoi les chapitres 
sont rédigés de manière synthétique et qu’ils comportent peu d’exemples au fil 
du texte. En revanche, le lecteur est appelé à lire et à exécuter le code 
informatique se trouvant dans les sections d’exemples à la fin de chacun des 
chapitres. Ce code et les commentaires qui l’accompagnent reviennent sur 
l’essentiel des concepts du chapitre et les complémentent souvent. Nous 
considérons l’exercice d’«étude active» consistant à exécuter du code et à voir 
ses effet comme essentielle à l’apprentissage du langage R.

Le code des sections d’exemples est disponible en format électronique au même 
endroit que le document.

Cette quatrième édition de l’ouvrage se distingue principalement de la 
précédente par l’ajout de liens vers des vidéos réalisées par l’auteur qui 
reviennent sur certains sujets plus délicats. Ces vidéos sont disponibles dans 
la chaîne YouTube

http://www.youtube.com/user/VincentGouletIntroR

Le document est publié sous licence Creative Commons.

Vincent Goulet, Ph.D.
Professor of Actuarial Science
Directeur général de la formation continue
Université Laval

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


Re: [R] [ESS] Emacs + ESS + R installer

2009-10-07 Thread Vincent Goulet

Le mer. 7 oct. à 09:41, Stephen Eglen a écrit :


Frank Liu frankcs...@gmail.com wrote:



I and some students built an Emacs + ESS + R installer, which  
allows

users to download and install the newest version of Emacs, ESS, and R
with little pain.The size of the installer is about 8Mb.

http://sourceforge.net/projects/emacs-for-r/

Please feel free to give me comments and suggestions. Thank you.


sounds like a great idea - anything to reduce the barrier!  How does  
it

overlap/complement with what Vincent kindly provides:

http://vgoulet.act.ulaval.ca/en/ressources/emacs/

Installing that + R should get to the same position.  Vincent is
providing a great resource for win (and mac) users, and if there is
anyway of building on what he has done, it wuold be great.

Stephen


Ah, but I also have AUCTeX! ;-)

Will definitely have a look at Frank et al.'s offer.


Vincent Goulet, Full Professor
École d'actuariat
Université Laval, Québec
vincent.gou...@act.ulaval.ca   http://vgoulet.act.ulaval.ca

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


[R] [R-pkgs] New version of actuar

2009-05-19 Thread Vincent Goulet

Dear useRs,

A new version of actuar is available since last Friday. This is mainly  
a bugfix release. From the NEWS file:


Version 1.0-2
=

USER-VISIBLE CHANGES

o mfoo() and levfoo() now return Inf instead of NaN for infinite
moments. (Thanks to David Humke for the idea.)

BUG FIXES

o Non-ascii characters in one R source file prevented compilation of
the package in a C locale (at least on OS X).

o For probability laws that have a strictly positive mode or a mode
at zero depending on the value of one or more shape parameters,
dfoo(0, ...) did not handle correctly the case exactly at the
boundary condition.

actuar is a package offering additional actuarial science  
functionality to R, mostly in the fields of loss distributions, risk  
theory (including ruin theory), simulation of compound hierarchical  
models and credibility theory


See also: http://www.actuar-project.org.

--
Vincent Goulet, Associate Professor
École d'actuariat
Université Laval, Québec
vincent.gou...@act.ulaval.ca   http://vgoulet.act.ulaval.ca

___
R-packages mailing list
r-packa...@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-packages

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

2009-03-13 Thread Vincent Goulet

I did similar things with polygon().

Le mar. 10 mars à 13:30, g...@ucalgary.ca a écrit :


For a given random variable rv, for instance, rv = rnorm(1000),
I plot its density curve and calculate some quantiles:
plot(density(rv))
P10P50P90 = = quantile(rv,probs = c(10,50,90)/100)
I would like to color the area between P10 and P90 and under the curve
and mark the P50 on the curve.


rv = rnorm(1000)
plot(density(rv))
P10P50P90 = = quantile(rv,probs = c(10,50,90)/100)


Could you please teach me how to do these using R?
Thanks,
-james

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


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


[R] New R mailing list: R-SIG-insurance

2009-03-03 Thread Vincent Goulet

Dear useRs,

Over the last few years R has gained a significant momentum in the  
insurance industry. Dedicated packages have been written, numerous  
presentations given, courses held, businesses set up, and IT  
departments convinced. ;-)


Therefore, together with Markus Gesmann of Lloyd's of London, we  
created a Special Interest Group mailing list to discuss R usage in  
actuarial science, insurance (life and non-life) and risk analysis and  
assessment in general. (With thanks to Diego Mazzeo for the idea and  
to Martin Maechler for the technical help and list creation.)


To subscribe to the list please visit:

https://stat.ethz.ch/mailman/listinfo/r-sig-insurance

For the posting guide see:

http://www.r-project.org/posting-guide.html

We hope that this new list will foster discussions and the transfer of  
knowledge. Please pass the word and participate, your contributions  
are most welcome!


--
Vincent Goulet, Associate Professor
École d'actuariat
Université Laval, Québec
vincent.gou...@act.ulaval.ca   http://vgoulet.act.ulaval.ca

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


Re: [R] installing R on Ubuntu

2009-02-11 Thread Vincent Goulet

Thanks, Paul, for the instructions.

However, as it has been pointed out by Dirk a couple of times, most of  
these instructions (those related to R installation and the location  
of package files at least) can already be found in the Ubuntu README:


http://cran.us.r-project.org/bin/linux/ubuntu/

Best regards,

Vincent


Le sam. 7 févr. à 20:13, Paul Heinrich Dietrich a écrit :



I've read some of R's literature on Linux, including the R Admin  
manual, and
didn't find it very useful, which is probably my own limitation.   
But I did
finally manage to get it working well.  I'm posting this to help  
others.
The following worked when installing R 2.8.1 on Ubuntu 8.04 Hardy  
Heron.
Here are truly step-by-step instructions for those who don't know  
Linux

(like me):

Installation and Initial Set-Up of R for Ubuntu Linux

1. Open the Bash terminal (Applications  Accessories  Terminal)
2. Type these lines to add the security key to access the latest  
version of

the R Ubuntu package:
u...@computer:~$ gpg --keyserver subkeys.pgp.net --recv-key E2A11821
u...@computer:~$ gpg -a --export E2A11821 | sudo apt-key add -
3. Use the Bash terminal to open your sources.list file with gedit  
(text

editor) for editing:
u...@computer:~$ sudo gedit /etc/apt/sources.list
4. Add this line to the bottom of the sources.list file:
deb http://rh-mirror.linux.iastate.edu/CRAN/bin/linux/ubuntu hardy/
5. Save the file and go back to the Bash terminal.
6. Type this to update apt-get's database before you install R:
u...@computer:~$ sudo apt-get update
7. Install R with this command:
u...@computer:~$ sudo apt-get install r-base
8. Go to System  Administration  Synaptic Package Manager, and  
download

the build-essential package.
9. To use R, simply enter R in the Bash terminal.  To quit, enter q().


Additional programs will be needed to install other packages or work  
with

other programs:
1. Install compilers for C++ and Fortran
u...@computer:~$ sudo apt-get install g++ gfortran
2. Install the developer versions of Blas and Lapack (what are these?)
u...@computer:~$ apt-get install libblas-dev liblapack-dev


Updating Packages in R
1. Open the Bash terminal and start R with root permissions
u...@computer:~$ sudo R
2. Type  update.packages()


Installing the R Commander GUI
1. Open the Bash terminal and type:
  u...@computer:~$ apt-get install r-cran-rcmdr


Using the R Commander GUI
library(Rcmdr)
...or once the library is open and Commander has been shut down, type:
commander()


Notes
It looks like most of R has been put here:
/etc/R (Rprofile.site is here)
/usr/lib/R


Downloaded Packages seem to go here:
/usr/local/lib/R/site-library/
--
View this message in context: 
http://www.nabble.com/installing-R-on-Ubuntu-tp10025949p21894865.html
Sent from the R help mailing list archive at Nabble.com.

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


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


Re: [R] Histogram for grouped data in R

2009-01-23 Thread Vincent Goulet

Le ven. 23 janv. à 08:55, darthgervais a écrit :



I have grouped data in this format

Size  -- Count
0-10 --  15
10-20 -- 25
20-50 -- 10
50-100 -- 5

I've been trying to find a way to set this up with the proper  
histogram

heights, but can't seem to figure it out. So any help would be much
appreciated!


Define your data as a grouped.data object using the function of the  
same name in package actuar. Then you can simply use hist() as usual  
to get what you want. See:


@Article{Rnews:Goulet+Pigeon:2008,
 author = {Vincent Goulet and Mathieu Pigeon},
 title = {Statistical Modeling of Loss Distributions Using actuar},
 journal = {R News},
 year = 2008,
 volume = 8,
 number = 1,
 pages = {34--40},
 month = {May},
 url = http, pdf = Rnews2008-1 }

HTH

---
  Vincent Goulet
  Acting Chair, Associate Professor
  École d'actuariat
  Université Laval, Québec
  vincent.gou...@act.ulaval.ca   http://vgoulet.act.ulaval.ca

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


Re: [R] Sweave documents have corrupted double quotes

2009-01-16 Thread Vincent Goulet

Paul,

The file did not make it to the list.

Did you try loading Sweave with the 'noae' option, that is:

\usepackage[noae]{Sweave}

This *may* solve your issue.

HTH Vincent

Le ven. 16 janv. à 11:31, Paul Johnson a écrit :


I'm attaching a file foo.Rnw and I'm hoping some of you might run it
through your R  latex systems to find out if the double-quotes in
typewriter font turn out as black boxes (as they do for me).  If you
don't use Sweave, but you have a system with a working version of R
and LaTeX, the file gives the instructions you need to use to process
the file. The

The file itself explains the problem. You can see the flawed output on
my web site

http://pj.freefaculty.org/latex/foo.pdf

I'm running Ubuntu Linux 8.10 with R 2.8.1 and TexLive 2007 (which is
provided with the distribution).

This is not a new problem, I noticed it two years ago while using
TeTeX on Fedora Linux, and so I doubt that this is specific to
TeXLive.  Back then, I took the path of resistance and stopped using
the typewriter font.  That is becoming inconvenient, however.

I would sincerely appreciate any pointers you have.

--
Paul E. Johnson
Professor, Political Science
1541 Lilac Lane, Room 504
University of Kansas
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


---
  Vincent Goulet
  Acting Chair, Associate Professor
  École d'actuariat
  Université Laval, Québec
  vincent.gou...@act.ulaval.ca   http://vgoulet.act.ulaval.ca

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


Re: [R] including Sweave tangled code in '.Rnw' document

2008-11-30 Thread Vincent Goulet

Kyle,

In addition to listings already mentioned by Berwin, you may find  
useful the answers package. This is what I use to create assignments/ 
exams/exercise sets with solutions all in one file.


HTH

Vincent

---
  Vincent Goulet, Associate Professor
  École d'actuariat
  Université Laval, Québec
  [EMAIL PROTECTED]   http://vgoulet.act.ulaval.ca

Le sam. 29 nov. à 14:11, Kyle Matoba a écrit :


Hello List,

I have been using Sweave for my homework this last quarter and have  
been
very impressed at how much time and effort it saves me.  I, however,  
have
run up against a problem which I have not been able to solve using  
any of
the Sweave/LaTeX tricks I know.  I work through my homework one  
problem at a
time, typesetting equations and writing R code, etc. and  
occasionally use

'Stangle()' from within R to extract the code if I need to pin down a
problem or experiment interactively.  I would like to be able to  
include
this resultant code in a verbatim environment in my final TeX'ed up  
document
as an appendix so that the grader can look it over, etc.  I could  
implement
this in any number of ways using linux tools, but would like to know  
if

there is a clean way to do so using LaTeX or Sweave so that the latest
version of the code is included in my homework each time I run 'R  
CMD Sweave

HW4.Rnw; pdflatex HW4.tex'.

e.g I envision something such as:

\begin{document}
fig3, echo=false, results=hide, fig=true, eps=F=
plot(runif(1000))
@

TA here is my code:

% some manner of Sweave/LaTeX macro to include the R code tangled  
out of

this '.Rnw' document
% in this case it would just be 'plot(runif(1000))', perhaps manually
enclosed in a verbatim environment

\end{document}
I am running R-2.6.2 on Ubuntu Hardy Heron.


Thanks for all your help with Sweave.  I think it is a fantastic tool.

Kyle

[[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] exponential of a matrix

2008-11-12 Thread Vincent Goulet

Le mar. 11 nov. à 17:20, Terry Therneau a écrit :



Is the matrix exponential available in some package?


You may also have a look at the expm package for a very  
straightforward operator:


http://r-forge.r-project.org/projects/expm/

Disclaimer: although entirely usable, the package is still considered  
in development. YMMV


Best

Vincent




The cannonical reference is Nineteen dubious ways to take the  
exponential of a matrix.  (Love that title)


Terry T.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] ubuntu system refuses to update packages

2008-11-10 Thread Vincent Goulet

Le lun. 10 nov. à 00:45, Leon Yee a écrit :


Dirk Eddelbuettel wrote:

On 9 November 2008 at 20:35, Alan Jackson wrote:
| There must be a simple answer to this.
| | I'm running ubuntu gutsy, currently have 2.7.2 loaded, but the  
update
| tools refuse to update it, and don't tell me why. With apt-get I  
get :

| | [668 ~]$ sudo apt-get -u -V --simulate dist-upgrade
| Reading package lists... Done
| Building dependency tree   | Reading state information... Done
| Calculating upgrade... Done
| The following packages have been kept back:
|r-base (2.7.2-1gutsy0 = 2.8.0-1gutsy1)
|r-base-core (2.7.2-1gutsy0 = 2.8.0-1gutsy1)
|r-base-dev (2.7.2-1gutsy0 = 2.8.0-1gutsy1)
|r-cran-rpart (3.1.41-1gutsy0 = 3.1.42-1gutsy0)
|r-recommended (2.7.2-1gutsy0 = 2.8.0-1gutsy1)
| 0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
| | If I use a gui package manager, it tells me the update will break
| the installation and refuses to go forward, but doesn't show what  
the

| issue is.
In cases like this just take the set of packages and pass them  
directly to

'sudo apt-get install' ie
  $ sudo apt-get install r-base r-base-core r-base-dev r-cran-rpart  
r-recommended
which will show which packages this will install (as new), upgrade,  
or

remove, if any.  It still allows you to pack out if you so choose.
In this case it is probably 'just' a fortran or c++ library  
transition.  If
you are still running gutsy you are also now two Ubuntu releases  
behind so

you may want to consider upgrading to hardy and/or intrepid.
By the way, this would have a good question for the r-sig-debian  
list.

Hth, Dirk


Hi,

  I encountered similar problems:

apt-get install r-base-core
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.

Since you only requested a single operation it is extremely likely  
that

the package is simply not installable and a bug report against
that package should be filed.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 r-base-core: Depends: tcl8.5 (= 8.5.0) but it is not installable
  Depends: tk8.5 (= 8.5.0) but it is not installable
E: Broken packages

/etc/apt/sources.list

deb http://mirror.optus.net/ubuntu/ gutsy-security main restricted  
universe multiverse
deb-src http://mirror.optus.net/ubuntu/ gutsy-security restricted  
main multiverse universe


deb http://mirror.optus.net/ubuntu/ gutsy universe main
deb-src http://mirror.optus.net/ubuntu/ gutsy universe main
deb http://mirror.optus.net/ubuntu/ gutsy-updates universe main
deb-src http://mirror.optus.net/ubuntu/ gutsy-updates universe main

deb http://cran.ms.unimelb.edu.au/bin/linux/ubuntu gutsy/

deb http://security.ubuntu.com/ubuntu/ gutsy-security universe main
deb-src http://security.ubuntu.com/ubuntu/ gutsy-security universe  
main



It seems that R2.8.0 for gutsy is built on a system with tcl8.5 and  
tk8.5, which is not available in gutsy?


From the CRAN Ubuntu README:


Installation and compilation of R or some its packages may require  
Ubuntu packages from the backports repositories. In particular, this  
is the case for Tcl/Tk 8.5 on Gutsy and Hardy. Therefore, it is  
suggested to activate the backports repositories with an entry like


deb http://my.favorite.ubuntu.mirror/ hardy-backports main  
restricted universe


in your /etc/apt/sources.list file. See http://www.ubuntu.com/getubuntu/downloadmirrors 
 for the list of Ubuntu mirrors.



Vincent





Best wishes,
Leon

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


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


Re: [R] R 2.8.0 for Ubuntu Intrepid Ibex i386

2008-11-05 Thread Vincent Goulet

Le mer. 5 nov. à 12:11, Robert Zimbardo a écrit :


Hi all

Is there going to be a binary of R 2.8.0 for Ubuntu Intrepid Ibex  
i386 -

i.e., not just amd 64bit?


I was going to reply that the binaries have been there for a few days  
already, but I realize I forgot to copy them to my repository. It's  
done now and they will reach CRAN mirrors within the next few hours.


Sorry for the inconvenience.

In the future, please ask Ubuntu related questions on R-SIG-Debian  
(cc'd) where such postings have a far greater chance of being noticed.



Thx,
RZ


---
  Vincent Goulet, Associate Professor
  École d'actuariat
  Université Laval, Québec
  [EMAIL PROTECTED]   http://vgoulet.act.ulaval.ca

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


Re: [R] print.data.frame : row.name = FALSE not having intended effect

2008-09-23 Thread Vincent Goulet

Le mar. 23 sept. à 22:33, Matthew Pettis a écrit :


Thanks Dirk,

One more question, then... I looked at the link, but haven't tried all
the steps,


Well, you should. They're tested and true instructions.


but I am worried that the original listings in

/etc/apt/sources.list

will mask the version of r-base-dev I want to install...


It's actually the other way around, since apt will install the latest  
version of a package available.



How do I make
sure to point it at the right repository (sorry for asking Ubuntu
questions on the R list, but actually, right now, it looks like
ubuntuforums is having website issues...)


That's what the R-SIG-Debian mailing list if for. (Granted, it's not  
obvious if you don't happen to know Ubuntu is a Debian derivative.)





thanks,
Matt

On Tue, Sep 23, 2008 at 9:22 PM, Dirk Eddelbuettel [EMAIL PROTECTED]  
wrote:


On 23 September 2008 at 20:55, Matthew Pettis wrote:
| Never mind -- the answer is buried in my own question... I was  
looking
| at documentation for version 2.7.2, and when I looked at the one  
for

| 2.6.2, I see the row.names option isn't in that release.
|
| Any suggestions on how I can code around that in 2.6.2, so I don't
| have to upgrade to 2.7.2 just yet?

Or take the other route: use R 2.7.2, packaged conveniently for  
your Ubuntu

system via CRAN.  See here:

  http://cran.us.r-project.org/bin/linux/ubuntu/

Dirk

--
Three out of two people have difficulties with fractions.





--
It is from the wellspring of our despair and the places that we are
broken that we come to repair the world.
-- Murray Waas

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




---
  Vincent Goulet, Professeur agrégé
  École d'actuariat
  Université Laval, Québec
  [EMAIL PROTECTED]   http://vgoulet.act.ulaval.ca

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


Re: [R] Hmisc and Ubuntu (aptitude install)

2008-09-22 Thread Vincent Goulet

Matthew,

As per the CRAN Ubuntu README

http://cran.r-project.org/bin/linux/ubuntu/

install the Ubuntu r-base-dev package to compile R packages from  
sources.


Vincent

Le lun. 22 sept. à 00:08, Matthew Pettis a écrit :


Hi,

I'm trying to get the Hmisc module on my Ubuntu Hardy Heron install.
I tried getting Hmisc from within R by issuing the standard
'install.packages' command, but it said I needed 'gfortran' to
compile.  I thought I could circumvent this by using 'aptitude' to get
the package 'r-cran-hmisc', but when I got it, the package had
critical missing parts (got 404s).  So, I'll be trying to go back and
download 'gfortran', but can anybody tell me if this aptitude ubuntu
package should be kept up to date and is just currently overlooked?

Thanks,
Matt

--
It is from the wellspring of our despair and the places that we are
broken that we come to repair the world.
-- Murray Waas

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] RCurl compilation error on ubuntu hardy

2008-09-17 Thread Vincent Goulet

Emmanuel,

Please see inline for comments.

Le mer. 17 sept. à 00:59, Emmanuel Levy a écrit :


Dear list members,

I encountered this problem and the solution pointed out in a previous
thread did not work for me.
(e.g.  install.packages(RCurl, repos = http://www.omegahat.org/R;)

I work with Ubuntu Hardy, and installed R 2.6.2 via apt-get.


Please install the latest version, 2.7.2 from CRAN. See the  
instructions in the Ubuntu README:


http://cran.r-project.org/bin/linux/ubuntu/


I really need RCurl in order to use biomaRt ... any help would be
greatly appreciated.


The package compiled just fine here after installing the libcurl4- 
gnutls-dev (Ubuntu) package. You just have a permission problem; see  
below.



Best wishes,

Emmanuel

=


sessionInfo()

R version 2.6.2 (2008-02-08)
x86_64-pc-linux-gnu

locale:
LC_CTYPE 
= 
en_CA 
.UTF 
-8 
;LC_NUMERIC 
= 
C 
;LC_TIME 
= 
en_CA 
.UTF 
-8 
;LC_COLLATE 
= 
en_CA 
.UTF 
-8 
;LC_MONETARY 
= 
en_CA 
.UTF 
-8 
;LC_MESSAGES 
= 
en_CA 
.UTF 
-8 
;LC_PAPER 
= 
en_CA 
.UTF 
-8 
;LC_NAME 
= 
C 
;LC_ADDRESS 
=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_CA.UTF-8;LC_IDENTIFICATION=C


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

loaded via a namespace (and not attached):
[1] rcompgen_0.1-17 tools_2.6.2




=



install.packages(RCurl, repos = http://www.omegahat.org/R;)
Warning in install.packages(RCurl, repos = http://www.omegahat.org/R 
) :

 argument 'lib' is missing: using '/usr/local/lib/R/site-library'


See? R will *try* to install the package in /usr/local/lib/R/site- 
library, which you do not have access to as a normal user.


I do not recommend to install as root instead. The packages you  
install yourself as a user belong to your home directory. See the  
ADMINISTRATION AND MAINTENANCE OF R PACKAGES section in the Ubuntu  
README linked above for indications of the correct way to do this.



trying URL 'http://www.omegahat.org/R/src/contrib/RCurl_0.9-4.tar.gz'
Content type 'application/x-gzip' length 150884 bytes (147 Kb)
opened URL
==
downloaded 147 Kb

* Installing *source* package 'RCurl' ...
checking for curl-config... /usr/bin/curl-config
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking how to run the C preprocessor... gcc -E
Version has a libidn field
configure: creating ./config.status
config.status: creating src/Makevars
** libs
gcc -std=gnu99 -I/usr/share/R/include -I/usr/share/R/include
-DHAVE_LIBIDN_FIELD=1 -fpic  -g -O2 -c base64.c -o base64.o
In file included from base64.c:1:
Rcurl.h:52: error: expected specifier-qualifier-list before 'cetype_t'
make: *** [base64.o] Error 1
chmod: cannot access `/usr/local/lib/R/site-library/RCurl/libs/*': No
such file or directory


This should have been the clue.

---
  Vincent Goulet, Associate Professor
  École d'actuariat
  Université Laval, Québec
  [EMAIL PROTECTED]   http://vgoulet.act.ulaval.ca




ERROR: compilation failed for package 'RCurl'
** Removing '/usr/local/lib/R/site-library/RCurl'

The downloaded packages are in
/tmp/RtmpQ8FMBZ/downloaded_packages
Warning message:
In install.packages(RCurl, repos = http://www.omegahat.org/R;) :
 installation of package 'RCurl' had non-zero exit status

= 
= 
= 
= 
= 
= 
= 
= 
= 
= 
==


Hi Martin,
are you working on a 64-bit linux distribution and which version of
RCurl are you trying to install? There has been a problem with a
recent version of RCurl and the R_base64_decode, search the archives
of the Bioconductor mailing list for a thread called
RCurl loading problem with 64 bit linux distribution.
Please try using the newest versions of R (R-2.7.0 has been released a
few weeks ago) and RCurl, which you can obtain from within R by
typing:
install.packages(RCurl, repos = http://www.omegahat.org/R;)
The new version of RCurl (= 0.9.2) worked fine for me, while 0.9.0
and 0.9.1 did not.
Hope this helps.
Joern


martin sikora wrote:

   dear list members,

   i'm having a problem installing the biomaRt package on my linux
machine, due to the fact of a compilation error with RCurl. i am using
R 2.6.2 on fedora 7, and this is the output i get:

   gcc -m32 -std=gnu99 -I/usr/include/R -I/usr/include/R
-DHAVE_LIBIDN_FIELD=1 -I/usr/local/include-fpic  -O2 -g -pipe
-Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector
--param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic
-fasynchronous-unwind-tables -c base64.c -o base64

Re: [R] unix-type commandline keystrokes in the windows RGUI

2008-09-17 Thread Vincent Goulet
Look at GNU Emacs with ESS, you'll get what you want out of the box  
--- and much more! See


http://vgoulet.act.ulaval.ca/en/emacs

[shameless plug] for a distribution of Emacs bundled with ESS.

HTH

Vincent


Le mer. 17 sept. à 09:26, mfrumin a écrit :



Hi all,

I am generally quite fond of the unix commandline keystrokes (e.g.  
searching
back in your history with [CTRL]-R, and cutting/pasting with [CTRL]- 
K/Y)
which work in the R commandline in *nix.  Does anyone know if  
there's any

way to get similar functionality in the Windows RGUI?

I know that as of now, [CTRL]-A and -E do the same as unix  
(beginning and
end of line) and [CTRL]-Y does a paste, but [CTRL]-K crops from the  
cursor
to the end of the line but doesn't put the text into the clipboard.   
the
most important thing I want is the [CTRL]-R functionality which is  
so poorly

approximated by pressing the up arrow a million times.

I've searched on the archives and didn't find anything about this.
Any

thoughts?

Thanks,
Mike
--
View this message in context: 
http://www.nabble.com/unix-type-commandline-keystrokes-in-the-windows-RGUI-tp19532125p19532125.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] [R-pkgs] New version of actuar

2008-09-16 Thread Vincent Goulet

=== actuar: An R Package for Actuarial Science ===

We are pleased to announce the immediate availability of version 1.0-0  
of actuar. This release follows publication of our papers in JSS (*)  
and R News (**). From the NEWS file:


Version 1.0-0
=

NEW FEATURES

  o Improved support for regression credibility models. There is now
an option to make the computations with the intercept at the
barycenter of time. This assures that the credibility adjusted
regression line (or plane, or ...) lies between the individual and
collective ones. In addition, contracts without data are now
supported like in other credibility models.

  o Argument 'right' for grouped.data() to allow intervals closed on
the right (default) or on the left.

  o Method of quantile() for grouped data objects to compute the
inverse of the ogive.

USER-VISIBLE CHANGES

  o cm() no longer returns the values of the unbiased estimators when
method = iterative.

  o Specification of regression models in cm() has changed: one should
now provide the regression model as a formula and the regressors
in a separate matrix or data frame.

  o Due to above change, predict.cm() now expects 'newdata' to be a
data frame as for stats:::predict.lm().

  o Function bstraub() is no longer exported. Users are expected to
use cm() as interface instead.

BUG FIXES

  o Functions rfoo() are now more consistent in warning when NA's
(specifically NaN's) are generated (as per the change in R 2.7.0).

  o frequency.portfolio was wrongly counting NAs.

  o Domain of pdfs returned by aggregateDist() now restricted to
[0, 1].

  o Quantiles are now computed correctly (and more efficiently) in 0
and 1 by quantile.aggregateDist().

  o coverage() no longer requires a cdf when it is not needed, namely
when there is no deductible and no limit.


The CRAN page for the package is

http://cran.r-project.org/package=actuar

The project's web site is

http://www.actuar-project.org

Comments and contributions to the project are more than welcome.

(*) http://www.jstatsoft.org/v25/i07
(**) http://cran.r-project.org/doc/Rnews/Rnews_2008-1.pdf

---
  Vincent Goulet, Associate Professor
  École d'actuariat
  Université Laval, Québec
  [EMAIL PROTECTED]   http://vgoulet.act.ulaval.ca

___
R-packages mailing list
[EMAIL PROTECTED]
https://stat.ethz.ch/mailman/listinfo/r-packages

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


Re: [R] best quad core configuration?

2008-07-30 Thread Vincent Goulet

Le mer. 30 juil. à 13:04, Alan Swanson a écrit :

I am purchasing a quad-core 64-bit system.  My proposed  
configuration is an
intel core duo quad with 8Gb memory and an ubuntu OS.  I'm choosing  
ubunto
because I have good local support, but it doesn't seem as well  
supported as

debian for R.


And what makes you think that? First off, Ubuntu is Debian based, so  
every Debian package (well, the R ones at least) is also in Ubuntu.  
Second, we also provide backports of R for Ubuntu releases down to  
Dapper. I consider this is rather good support; see


http://cran.r-project.org/bin/linux/ubuntu/


 Will ubuntu limit me in any significant way?   I have noticed
a bias towards AMD machines among R users - are there compelling  
reasons to

go with an equivalent AMD system instead?  Will I be able to use amd64
binaries on this system, or would I have to compile everything myself?


As the README file linked above mentions, we provide up-to-date R  
binaries for i386 and amd64.


For your other points, I will let more competent people answer.

---
  Vincent Goulet, Associate Professor
  École d'actuariat
  Université Laval, Québec
  [EMAIL PROTECTED]   http://vgoulet.act.ulaval.ca



Would it difficult to install Intel MKL 10.0 BLAS and LAPACK  
libraries on
this machine?  Would it be difficult to run both 32-bit and 64-bit  
versions
of R on this machine?  The most computationally-intensive thing I  
will be
using the machine for is large MCMC simulations, probably using  
multiple
instances of LinBUGS.  Any advice on configuring by machine for  
maximum

speed for these simulations?

Thanks,

Alan Swanson




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

2008-07-23 Thread Vincent Goulet

Le mer. 23 juil. à 14:29, Angelo Scozzarella a écrit :


Hi,

how can I treat data organised in classes and frequencies?

Ex.

class   frequency

20-23   9
23-25   7
26-28   5
29-31   5
32-34   3


It depends what you mean by treat, but package actuar has a function  
grouped.data() to create such objects. Then, there are methods to  
compute the mean or plot the histogram. See the lossdist package  
vignette for details.


HTH  Vincent

--
  Vincent Goulet, Associate Professor
  École d'actuariat
  Université Laval, Québec
  [EMAIL PROTECTED]   http://vgoulet.act.ulaval.ca


Thanks

Angelo Scozzarella


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


Re: [R] Graphics not working for R in ubuntu

2008-07-19 Thread Vincent Goulet
As others have mentioned, there is no official GUI for R under  
Linux. I suggest you have a look at the Related Projects area of the  
R Project web site, there is a link to a section devoted to GUIs.


I would personally recommend the Emacs + ESS combo as a powerful (if  
not entirely intuitive at first) interface to R. Both softwares are in  
the Ubuntu repositories, so installation is a simple apt-get away.


Finally, please have a look at the R on Ubuntu README:

http://cran.r-project.org/bin/linux/ubuntu/

Best,

Vincent

Le sam. 19 juil. à 02:09, Nataraj a écrit :


Dear list members,

I have installed R in Ubuntu successfully but issuing
command like R in terminal will able to see only the R
working in command mode, the regular GUI which I use to
have in my windows installation of R missing in linux..I am
new to linux and so clueless how I can go about that and
How I could enable it in linux? More, I never got any
problem in configuration  and compilation processes while I
was installing R in ubuntu.


Thanks for your valuable time to look into my problem!

Regards,
B.Nataraj

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




---
  Vincent Goulet, Associate Professor
  École d'actuariat
  Université Laval, Québec
  [EMAIL PROTECTED]   http://vgoulet.act.ulaval.ca

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


Re: [R] Insurance review statistical methods

2008-07-15 Thread Vincent Goulet
I don't know about TRICAST, but package actuar (on CRAN) provides some  
more specifically actuarial functionality to R. You may want to have a  
look. See also http://www.actuar-project.org,


Le lun. 14 juil. à 17:47, Kenneth Roy Cabrera Torres a écrit :


Hi R users:

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

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

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

Thank you for your help.

Kenneth

--
Kenneth Roy Cabrera Torres [EMAIL PROTECTED]

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




---
  Vincent Goulet, Associate Professor
  École d'actuariat
  Université Laval, Québec
  [EMAIL PROTECTED]   http://vgoulet.act.ulaval.ca

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

2008-07-15 Thread Vincent Goulet
 to download some  
database
or other packaged code that I want to play around with but would  
later like
to get rid of, a library in the home directory that is still in R's  
path
might be better. I would appreciate suggestions. What are others  
doing in

this situation? Currently I have the following outcome of .libPaths()
command:


.libPaths()

[1] /usr/local/lib/R/site-library /usr/lib/R/site-library
[3] /usr/lib/R/library

Which library path should I choose?


Whatever you wish (my personal pick below). This is also discussed in  
the README:


	Individual users can install R packages into their home directory.  
The simplest procedure is to create a file 	~/.Renviron containing,  
e.g.,

R_LIBS=~/lib/R/library:${R_LIBS}
	The install.packages() and update.packages() functions will then work  
in directory ~/lib/R/library.


HTH

---
  Vincent Goulet, Associate Professor
  École d'actuariat
  Université Laval, Québec
  [EMAIL PROTECTED]   http://vgoulet.act.ulaval.ca

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


Re: [R] Another failed attempt to install an R package in Ubuntu

2008-07-12 Thread Vincent Goulet

MIklos,

You may have missed this part of the Ubuntu README on CRAN:

	Users who need to compile packages should also install the r-base-dev  
package:


sudo apt-get install r-base-dev
This will fetch all the standard tools you need to compile packages.

If you have more Ubuntu specific questions, please post them to R-SIG- 
Debian.


Best,

Vincent

Le ven. 11 juil. à 23:32, Miklos Kiss a écrit :



I am running Ubuntu 8.04 through Wubi on a HP Pavilion dv4000 (my home
computer) and I recently installed R 2.7.1.  I attempted to install  
the

randomForest package from within the R environment and from the Linux
terminal.  Both attempts failed.  I've tried several mirrors but  
with no
luck.  Below is an example of the series of error messages I got  
when R told

me that the installation wasn't going well.

It tells me that several header files are missing.  For some reason  
it is
also trying to install them in '/home/mik/R/i486-pc-linux-gnu- 
library/2.7'
but my R library packages are located in '/usr/lib/R/library'.  I  
tried

downloading various x11dev packages and such, as suggested in similar
threads in this forum, but that didn't seem to help.

I'm really new (installed Ubuntu less than 4 months ago) to Linux  
but I've

been using R for about a year.  If anyone can point me in the right
direction on how to correctly install this package, I'd very much  
appreciate

it.

Thank you,
Miklos Kiss

install.packages()
--- Please select a CRAN mirror for use in this session ---
Loading Tcl/Tk interface ... done
Warning in install.packages() :
 argument 'lib' is missing: using
'/home/mik/R/i486-pc-linux-gnu-library/2.7'
trying URL 'http://cran.mtu.edu/src/contrib/ 
randomForest_4.5-25.tar.gz'

Content type 'application/x-gzip' length 70212 bytes (68 Kb)
opened URL
==
downloaded 68 Kb

* Installing *source* package 'randomForest' ...
** libs
gcc -std=gnu99 -I/usr/share/R/include  -fpic  -g -O2 -c  
classTree.c -o

classTree.o
In file included from classTree.c:15:
/usr/share/R/include/R.h:28:20: error: stdlib.h: No such file or  
directory
/usr/share/R/include/R.h:29:19: error: stdio.h: No such file or  
directory

In file included from
/usr/lib/gcc/i486-linux-gnu/4.2.3/include/syslimits.h:7,
from /usr/lib/gcc/i486-linux-gnu/4.2.3/include/ 
limits.h:11,

from /usr/share/R/include/R.h:30,
from classTree.c:15:
/usr/lib/gcc/i486-linux-gnu/4.2.3/include/limits.h:122:61: error:  
limits.h:

No such file or directory
In file included from classTree.c:15:
/usr/share/R/include/R.h:32:18: error: math.h: No such file or  
directory
/usr/share/R/include/R.h:33:19: error: errno.h: No such file or  
directory

In file included from /usr/share/R/include/R.h:50,
from classTree.c:15:
/usr/share/R/include/R_ext/RS.h:24:39: error: string.h: No such file  
or

directory
classTree.c: In function ‘catmax_’:
classTree.c:305: warning: implicit declaration of function ‘pow’
classTree.c:305: warning: incompatible implicit declaration of built- 
in

function ‘pow’
make: *** [classTree.o] Error 1
ERROR: compilation failed for package 'randomForest'
** Removing '/home/mik/R/i486-pc-linux-gnu-library/2.7/randomForest'

The downloaded packages are in
/tmp/RtmpT83A76/downloaded_packages
Warning message:
In install.packages() :
 installation of package 'randomForest' had non-zero exit status

--
View this message in context: 
http://www.nabble.com/Another-failed-attempt-to-install-an-R-package-in-Ubuntu-tp18415721p18415721.html
Sent from the R help mailing list archive at Nabble.com.

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


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


Re: [R] version problems of rkward in ubuntu hardy repository

2008-07-09 Thread Vincent Goulet

Le mer. 09 juil. à 06:20, Rainer M Krug a écrit :


Hi

I tried to install rkward under ubuntu hardy heron, but it tried to
use the one from the cran repository which was newer, but it did not
install. To be able to install rkward, I had to disable the cran
repository, install rkward, lock it's version and enable the
repository again.

I have the feeling, that the dependencies are not correct (it is
looking for libqt4GUI, but I have a libqt4-GUI from the ubuntu
repository).


Dear Rainer,

Activating the hardy-backports repository should fix the issue. Add  
something along the lines of


deb http://us.archive.ubuntu.com/ubuntu/ hardy-backports main  
restricted universe multiverse


in your /etc/apt/sources.list file.

HTH   Vincent




Just for information,

Rainer


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

Plant Conservation Unit
Department of Botany
University of Cape Town
Rondebosch 7701
South Africa

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


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


Re: [R] unable to install for r-base dependency?

2008-06-19 Thread Vincent Goulet

Le jeu. 19 juin à 10:55, [EMAIL PROTECTED] a écrit :


Hi,

I have been trying to install R for Ubuntu linux. Strangely, I got  
the dependency error message below.


Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
r-cran-cluster: Depends: r-base-core (= 2.7.1~20080614) but  
2.7.0-1gutsy0 is to be installed

E: Broken packages


On which architecture is this? I suspect amd64 because the version of  
cluster on i386 is still 1.11.10, which depends on R = 2.6.2. The  
maintainer of the amd64 packages (Michael Rutter, CCd) might have  
built the recently released 1.11.11 version with the beta R  
2.7.1~20080614, but failed to provide the corresponding r-base*  
packages.


We'll fix that. Sorry for the inconvenience.

This is my first time I see dependency issues in installing R on  
Linux. Does anyone help me to solve this? It seems version numbers  
do not match (r-base 2.7.0 and r-base-core 2.7.1)..


I used 'sudo apt-get install r-base' in a terminal and used  
'synaptic manager' as well.


Thank you very much.

Taka

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


---
  Vincent Goulet, Associate Professor
  École d'actuariat
  Université Laval, Québec
  [EMAIL PROTECTED]   http://vgoulet.act.ulaval.ca

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


Re: [R] Maximum likelihood estimation in R with censored Data

2008-06-13 Thread Vincent Goulet


Le ven. 13 juin à 13:55, Ben Bolker a écrit :


Bluder Olivia olivia.bluder at k-ai.at writes:



Hello,

I'm trying to calculate the Maximum likelihood estimators for a  
dataset

which contains censored data.

I started by using the function nlm, but isn't there a separate  
method
for doing this for e.g. the weibull and the log-normal  
distribution?


Thanks,

Olivia


 This is not *quite* enough detail about what you
want to do.  Can you (as the posting guide suggests!)
give us a small example of what you want to do?  You may be able
to do this via the survreg() command in the survival
package, or you may want to do it yourself by constructing
a log-likelihood function with dweibull() for uncensored
data and pweibull() for censored data [or dlnorm/plnorm].


If you want to go the second route, function coverage() in package  
actuar will build the censored density function for you. You can then  
feed this function to fitdistr() just like for usual ML estimation.


HTH  Vincent




 Ben Bolker

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

2008-05-23 Thread Vincent Goulet

Le ven. 23 mai à 09:37, mohamed nur anisah a écrit :


Dear all,

 i have 2 lists of data with each of the list contain 14 columns.


No, you have one list with two elements; each is a 14-column data frame.


How am i going to extract column 12 and 13 from each of the list ??


Let's call your list 'x'. Then

lapply(x, [, c(12, 13))

or, better yet,

lapply(x, [, c(breakp.start, breakp.end))

if I counted your columns correctly.


and can i combine my extracted columns to form a single list.


You mean a single data frame? Given that the number of rows is not the  
same in both elements, no. If they were, using sapply() instead of  
lapply() would do the trick.


HTH   Vincent

Attach with are my data. Your coorperation is highly appreciated.  
Many thanks


 Regards,
 Anisah

[[1]]
  CS(O)   id no.anchor   ref loc.start  loc.end CS(O).size  
CS(O)ref.density tested loc.start  loc.end breakp.start breakp.end  
den of anchor
1 CS  2.0 3 mmu19   6465196  6978022  
5128266  cfa18  55567952 55782336  6978022 
699273428
2 CS  3.057 mmu19   6992734 10249966 
3257232   17  cfa18  55792632 57688808 10249966
1027743025
3 CS  4.021 mmu19  10277430 10955201  
61   31  cfa18  57721864 58419812 10955201
1100852636
4 CS  5.0 2 mmu19  11008526 11045352   
36826   54  cfa18  58462088 58518608 11045352
1131686532
5 CS  6.0 7 mmu19  11316865 11814604  
497739   14  cfa21  53902028 53514536 11814604
1193722837
6 CS  7.014 mmu19  11937228 13847633 
19104057  cfa18  40111560 41204940 13847633
1451509117
7 CS  8.0 3 mmu19  14515091 16022770 
15076792   cfa1  82195232 83511824 16022770
16199850 5
8 CS  9.025 mmu19  16199850 23625856 
74260063   cfa1  83903856 90638880 23625856
2375455414
9 CS 10.033 mmu19  23754554 29676192 
59216386   cfa1  90773872 96913624 29676192
2976391816
10CS 11.0 6 mmu19  29763918 30164446  
400528   15  cfa11  29919668 30510776 30164446
30611872 8
11CS 12.019 mmu19  30611872 34558312 
39464405  cfa26  38767664 41958808 34558312
3473440415
12   CSO 13.173 mmu19  34734404 44009616 
92752128  cfa28   7343952 15872122 44009616
4408825621
13   CSO 13.271 mmu19  44088256 53582632 
94943767  cfa28  15923283 24830712 53582632
5365479614


[[2]]
  CS(O)   id no.anchor  ref loc.start   loc.end CS(O).size  
CS(O)ref.density tested loc.start   loc.end breakp.start breakp.end  
den of anchor
1CSO  2.1 4 mmuX   7311438   7428353  
116915   34   cfaX  41732964  41660008  7428353 
835693216
2CSO  2.241 mmuX   8356932  20225456
118685243   cfaX  32299338  41540632 20225456
2064158413
3CSO  2.3 8 mmuX  20641584  33046200
124046161   cfaX  91770240  94412912 33046200
3317518815
4CSO  3.173 mmuX  33175188  57970280
247950923   cfaX  94538728 114133200 57970280
64939220 3
5CSO  3.229 mmuX  64939220  70011280 
50720606   cfaX 119319152 124625688 70011280
7003978432
6 CS  4.021 mmuX  70039784  70677328  
637544   33   cfaX 124652504 125280776 70677328
7124127229
7CSO  5.1 2 mmuX  71241272  71362456  
121184   17   cfaX 125764816 125872960 71362456
7142557614
8CSO  6.1 4 mmuX  71425576  71824776  
399200   10   cfaX 125917392 126261784 71824776
73894168 6
9CSO  6.2 2 mmuX  73894168  74014744  
120576   17   cfaX   6363930   1898656 74014744
7470540811
10   CSO  6.317 mmuX  74705408  90487648
157822401   cfaX  32034930  19573208 90487648
9122816010
11   CSO  6.449 mmuX  91228160 101058192 
98300325   cfaX  51733740  61930260101058192   
101967264 9
12CS  7.0 3 mmuX 101967264 102176888  
209624   14   cfaX  62797768  63194052102176888   
10223004011
13   CSO  8.1 2 mmuX 102230040 102409592  
179552   11   cfaX  63307688  63460248102409592   
103123352 9
14   CSO  8.216 mmuX 103123352 110591464 
74681122   cfaX  63896752  71000280110591464   

Re: [R] Odp: Problem in converting natural numbers to bits and others

2008-05-21 Thread Vincent Goulet


Le mer. 21 mai à 04:38, Petr PIKAL a écrit :


Hallo

[EMAIL PROTECTED] napsal dne 21.05.2008 09:42:40:


Hi,

I just started using R for about one week and I have few problems.

i)I have a problem in finding right function to convert a table of

natural

numbers to bitwise. For a simple example;

I have the below table:-

Column  Col1   Col2   Col3
Sample1 57  10
Sample2 02   1
Sample3 4 0   0


Supposedly i wanted to convert to :-


Column  Col1   Col2   Col3
Sample1 11   1
Sample2 01   1
Sample3 1 0   0


data-read.table(clipboard, header=T
If data is your data frame,

data.bit-data.frame(column=data[,1],(data[,-1]0)*1)


sign(data) will also do.

Vincent






ii)Besides, I would like to create a formula of Sum(3*(Element in  
each

column for a row))..does it equivalent to 3*(data[1:3,1:2]) in this

case?or

I need to have Sum(3*(data[1:3,1:2])). Basically I wanted to mutliply

each

element of column table of a row and sum it  up.


Rather complicated.


3*(data[1:3,2:3])

 Col1 Col2
1   15   21
206
3   120

sum(3*(data[1:3,2:3]))

[1] 54

Works but I am suspicious that you wont something else.




iii)I would also like to know how to insert an if else statement  
where

in

the above case, I wanted to check if data[1:3,]
returns me 1 or 0, it will execute some calculations.
I refer to the R intro pdf and it mentioned using if (expr_1 ) expr_2

else

expr_3. Does that mean if(data[1:3,1:2])0 output[1:3,1:2]=0
else output[1:3,1:2]=100. If I did this command, how does R knows

which

row and column to map the output with?


If ... else ... is usually for working as programming steps

ifelse(..., ..., ...)

works with objects and is parts. You shall think first how to do your
calculations with whole objects, it is usually more effective.

Regards
Petr



Please advise. Appreciate alot. Thanks.

  [[alternative HTML version deleted]]

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

http://www.R-project.org/posting-guide.html

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


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

2008-05-19 Thread Vincent Goulet

Agustin,

Given this message and your previous one about starting R by clicking  
on the .RData file, I would suggest/recommend you have a look at the  
Emacs + ESS combination; see


http://cran.r-project.org/doc/FAQ/R-FAQ.html#R-and-Emacs

In my opinion, this is the best multi-platform (Unix, MacOS, Windows)  
user interface you will find for R.


HTH   Vincent

Le lun. 19 mai à 03:24, Agustin Lobo a écrit :


Hi!

Is it possible to set a file to which both
commands and output would get automatically
saved? I've tried with sink(), but only get
the output. I mean something
like a combined history and sink, as you
get with File/Save to File.. in the windows
GUI.
Tis is done with diary filename in Matlab,
and you can state diary on and
diary off to control what is being saved to
the file.

Thanks

Agus



--
Dr. Agustin Lobo
Institut de Ciencies de la Terra Jaume Almera (CSIC)
LLuis Sole Sabaris s/n
08028 Barcelona
Spain
Tel. 34 934095410
Fax. 34 934110012
email: [EMAIL PROTECTED]
http://www.ija.csic.es/gt/obster

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

2008-05-16 Thread Vincent Goulet

Le ven. 16 mai à 21:24, Roslina Zakaria a écrit :


Dear R-expert,
Is it possible to save graph from R into Latex document? I can see  
save as metafile , PNG, pdf etc, but I'm not sure which one to use.

Thank  you so much for your help.


If you use latex, you should go for Encapsulated PostScript (EPS)  
using the postscript() device. With pdflatex, you may opt for PDF.


Want a good hint? Have a look at Sweave[1] and let it take care of the  
graph for you. That way, the code to create the graph will be saved  
with your LaTeX document.


HTHVincent

[1] See http://www.statistik.lmu.de/~leisch/Sweave/

---
  Vincent Goulet, Associate Professor
  École d'actuariat
  Université Laval, Québec
  [EMAIL PROTECTED]   http://vgoulet.act.ulaval.ca

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


Re: [R] [OT] xemacs on windows vista

2008-05-12 Thread Vincent Goulet

Le lun. 12 mai à 15:15, Wensui Liu a écrit :


Hi, dear all,
I just switch to vista (ultimate) and have heard there is some problem
for the installation of xemacs on vista. Is there any insight or
experience that you could share?


Yes: go with GNU Emacs. There doesn't seem to be any compelling reason  
to prefer XEmacs nowadays. And if you use my distribution


http://vgoulet.act.ulaval.ca/en/emacs

you get a wizard based installation with up-to-date AUCTeX and ESS  
built-in.


Otherwise, I have never heard of special issues on Vista.

HTH

Vincent



I really appreciate any input.
thank you so much!

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] speeding up a special product of three arrays

2008-05-09 Thread Vincent Goulet

Le jeu. 8 mai à 17:20, Giuseppe Paleologo a écrit :

I am struggling with R code optimization, a recurrent topic on this  
list.


I have three arrays, say A, B and C, all having the same number of  
columns.

I need to compute an array D whose generic element is

D[i, j, k] - sum_n A[i, n]*B[j, n]*C[k, n]

Cycling over the three indices and subsetting the columns won't do.  
Is there
any way to implement this efficiently in R or should I resign to do  
this in

C?


Hum, interesting one. Here's one solution relying on indexing. Will  
this be fast enough for your purposes?


 set.seed(1)
 (A - matrix(sample(1:10, 4), 2, 2))
 [,1] [,2]
[1,]35
[2,]47
 (B - matrix(sample(1:10, 6), 3, 2))
 [,1] [,2]
[1,]35
[2,]94
[3,]81
 (C - matrix(sample(1:10, 8), 4, 2))
 [,1] [,2]
[1,]35
[2,]27
[3,]68
[4,]   104
 nrA - nrow(A)
 nrB - nrow(B)
 nrC - nrow(C)
 res - structure(numeric(prod(nrA, nrB, nrC)), dim = c(nrA, nrB,  
nrC))
 res[] - rowSums(A[slice.index(res, 1), ] * B[slice.index(res,  
2), ] * C[slice.index(res, 3), ])

 res
, , 1

 [,1] [,2] [,3]
[1,]  152  181   97
[2,]  211  248  131

, , 2

 [,1] [,2] [,3]
[1,]  193  194   83
[2,]  269  268  113

, , 3

 [,1] [,2] [,3]
[1,]  254  322  184
[2,]  352  440  248

, , 4

 [,1] [,2] [,3]
[1,]  190  350  260
[2,]  260  472  348

HTH

---
  Vincent Goulet, Associate Professor
  École d'actuariat
  Université Laval, Québec
  [EMAIL PROTECTED]   http://vgoulet.act.ulaval.ca

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


Re: [R] speeding up a special product of three arrays

2008-05-09 Thread Vincent Goulet

Le ven. 09 mai à 03:44, Dimitris Rizopoulos a écrit :


try this:

A - matrix(rnorm(10*4), 10, 4)
B - matrix(rnorm(3*4), 3, 4)
C - matrix(rnorm(5*4), 5, 4)

nrA - nrow(A); nrB - nrow(B); nrC - nrow(C)
ind - as.matrix(expand.grid(1:nrA, 1:nrB, 1:nrC))
D - rowSums(A[ind[, 1], ] * B[ind[, 2], ] * C[ind[, 3], ])
dim(D) - c(nrA, nrB, nrC)
D


Dimitris,

We basically have the same solution. Actually, I first went exactly  
the same path as you, but I didn't think of expand.grid(), so I was  
creating the index matrix manually (easy, but ugly).


Now, just out of curiosity, I made a few tests with ~ 100-row matrices  
and my solution is slightly faster (to the order of 1 sec. vs 1.2  
sec). :-) This is mostly due to slice.index() being faster than  
expand.grid(). In fact, if one doesn't mind the ugliness, building the  
indexes manually brings your solutions on par with mine in terms of  
speed. Doing this is left as an exercise to the reader...


Does this matter? No. It's just that it's a sunny Friday...

Cheers

Vincent





I hope it helps.

Best,
Dimitris


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

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


- Original Message - From: Giuseppe Paleologo [EMAIL PROTECTED] 


To: r-help@r-project.org
Sent: Thursday, May 08, 2008 11:20 PM
Subject: [R] speeding up a special product of three arrays


I am struggling with R code optimization, a recurrent topic on this  
list.


I have three arrays, say A, B and C, all having the same number of  
columns.

I need to compute an array D whose generic element is

D[i, j, k] - sum_n A[i, n]*B[j, n]*C[k, n]

Cycling over the three indices and subsetting the columns won't do.  
Is there
any way to implement this efficiently in R or should I resign to do  
this in

C?

Thanks,

Giuseppe

[[alternative HTML version deleted]]

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



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

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


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


Re: [R] help with updating to R2.7

2008-05-08 Thread Vincent Goulet
, reproducible code.




---
  Vincent Goulet, Associate Professor
  École d'actuariat
  Université Laval, Québec
  [EMAIL PROTECTED]   http://vgoulet.act.ulaval.ca

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/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] Announcement: support of littler, rkward and rpy on Debian/Ubuntu

2008-05-06 Thread Vincent Goulet

Dear useRs,

This is to announce that the maintainers of the various distributions  
have decided to provide experimental up-to-date versions of the  
following R related packages on Debian stable and Ubuntu (i386 and  
amd64 architectures):


littler
rkward
python-rpy(not on Ubuntu Dapper)
python-rpy-doc (not on Ubuntu Dapper)

By experimental we mostly mean that support for these packages may  
remain somewhat of a moving target for some time. The maintainers are  
not necessarily users of these packages themselves, so positive and  
negative feedback through the usual channels (see below) would be  
appreciated.


See the Debian and Ubuntu README files on CRAN for more details:

http://cran.r-project.org/bin/linux/debian/
http://cran.r-project.org/bin/linux/ubuntu/

This message is CCd to r-help to reach as wide an audience as  
possible, but we remind that the best place to report problems with  
these packages or to ask R questions specific to Debian and Ubuntu is  
the R-SIG-Debian mailing list. See


https://stat.ethz.ch/mailman/listinfo/r-sig-debian

for more information.

---
  Vincent Goulet, Associate Professor
  École d'actuariat
  Université Laval, Québec
  [EMAIL PROTECTED]   http://vgoulet.act.ulaval.ca

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
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 do I write a sum of matrixes??

2008-05-06 Thread Vincent Goulet

Le mar. 06 mai à 14:23, Alberto Monteiro a écrit :


3) Bill Venables offered this about a week ago in this list:
--
This is probably as good a way as any way for this kind of problem.
First define a binary operator:


%^% - function(x, n)

   with(eigen(x), vectors %*% (values^n * t(vectors)))


This example only works for _diagonalizable_ matrices. It
crashes, for example, in cases like:

m -  rbind(c(1,1,0), c(0,1,1), c(0,0,1))
m %^% 2
m %*% m


Then the %^% operator defined in package expm [1] will work for any  
kind of (square) matrix. The actual work is done in C, so it is pretty  
fast.


[1] On R-Forge: http://r-forge.r-project.org/projects/expm/

---
  Vincent Goulet, Associate Professor
  École d'actuariat
  Université Laval, Québec
  [EMAIL PROTECTED]   http://vgoulet.act.ulaval.ca

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


Re: [R] g(x,y) = f(x,y) - e(x)- e(y)?

2008-04-23 Thread Vincent Goulet
Le mer. 23 avr. à 06:59, William Simpson a écrit :

 Thanks Phipp very much for your help. I had meant, given that I'd
 computed the matrix f[x,y] and the vector e[x], how to take the
 difference. What is confusing is how to subtract a vector from a
 matrix. I don't want the recycling rule.

Well, then, how do you define the difference between a matrix and a  
vector if the vector is not recycled into a matrix?

Thanks to the column major order S uses and recycling, the difference  
between an m x n matrix 'M' and a vector of length n 'v',

M - v,

yields the right thing, namely the difference between each column of  
M and v.

HTH   Vincent




 Cheers
 Bill

 On Tue, Apr 22, 2008 at 9:53 AM, Philipp Pagel [EMAIL PROTECTED]  
 wrote:

 g(x,y) = f(x,y) - e(x)- e(y)
 These are continuous functions. I am not sure how to do this with  
 the
 discrete equivalents in R.

 Is this what you are looking for?

 g - function(x, y) {

f(x,y) - e(x) - e(y)
 }

 cu
Philipp

 --
 Dr. Philipp Pagel
 Lehrstuhl für Genomorientierte Bioinformatik
 Technische Universität München
 Wissenschaftszentrum Weihenstephan
 85350 Freising, Germany
 http://mips.gsf.de/staff/pagel

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

2008-04-22 Thread Vincent Goulet
The R 2.7.0 packages for Ubuntu on i386 and amd64 are on their way to  
CRAN.

Please note the new release support policy: we now support all stable  
Desktop releases of Ubuntu until their official end of life date. As  
of Thursday (we're a day or two ahead, here), these are Hardy Heron  
(8.04), Gutsy Gibbon (7.10), Feisty Fawn (7.04) and Dapper Drake  
(6.06). This means that CRAN will have more recent R packages for  
Hardy when it is released Thursday.

For more information, see the Ubuntu README in

http://cran.r-project.org/bin/linux/ubuntu/

Please report problems to the R-SIG-Debian forum, where messages have  
the greatest chance to be noticed.

---
   Vincent Goulet, Associate Professor
   École d'actuariat
   Université Laval, Québec
   [EMAIL PROTECTED]   http://vgoulet.act.ulaval.ca

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


Re: [R] Equivalent to a BY command in SAS

2008-04-13 Thread Vincent Goulet
Le dim. 13 avr. à 22:36, zerfetzen a écrit :

 Hi,
 I'm very new to R and absolutely love it.  Does anyone know how to use
 something in R that functions like a BY command in SAS?

 For example, let's say you have a variable x, and you want to see  
 the mean.
 Easy...

 mean(x)

 But what if you want to see the mean of x conditional on another  
 discrete
 variable?  My best attempts so far are something like...

 mean(x, y_cat=1)

 ...which of course doesn't work.  I have downloaded plenty of R user  
 guides
 that are very informative, but am not seeing much on detailed  
 descriptives
 or data manipulation (for my life, I can't figure out how to sort an
 attached data frame, but that's another issue).  Thanks.

You didn't give much detail about what exactly you want to do (have a  
look at the Posting Guide), but... perhaps by() will do what you what.  
See ?by .

Bye!

---
   Vincent Goulet, Associate Professor
   École d'actuariat
   Université Laval, Québec
   [EMAIL PROTECTED]   http://vgoulet.act.ulaval.ca

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


Re: [R] If statements for vectors

2008-04-09 Thread Vincent Goulet
Le mer. 9 avr. à 18:00, Paul Johnson a écrit :
 On Wed, Apr 9, 2008 at 4:07 PM, Laura Bonnett [EMAIL PROTECTED] 
  wrote:
 Dear Sirs,

 I am using both the Bioconductor adds on (Affy, AffyPLM,...) and the
 'standard' R-package.

 I am trying to select a list of genes which all have expression  
 values below
 a certain threshold.
 I have done this by creating a vector which has 0s where the  
 expression is
 greater than the threshold and 1s where it is less than or equal to  
 it.
 Multiplying this vector by the expression values produces a list of  
 0s and
 expression values below the threshold value.

 However, now I need to remove the 0s.  I thought that this would be
 relatively trivial but it appears it isn't!!!


 Without a working example from you, I have no way to test this
 proposal.  But if I were you, I would get the index values of the
 right cases in one step, and then use that to choose the ones I want.

 theGoodOnes - which(exp2 = 0)
 exp3 - exp2[theGoodOnes]


 This can be crammed into one line, but I'd do it in two just to make
 sure it is correct, at least the first time.

This type of extraction is so common that it has become idiomatic to  
write

exp3 - exp2[exp2 = 0]

Also, Laura, if you want to truncate (not eliminate) values to a  
certain threshold or limit, use the vectorized functions pmax() and  
pmin(). For the type of manipulation you needed to do it's almost  
never necessary to use for() loops.

HTH

Vincent



 My example:

 x - rnorm(100)
 which(x = 0)
 [1]  9 11 12 13 14 16 19 20 21 22 24 25 28 30 32 34 35 36 38 40 41  
 42 43 44 46
 [26] 47 49 50 53 54 57 59 61 63 64 66 68 69 70 72 75 78 80 81 82 83  
 88 90 97 98
 theGoodOnes - which(x=0)
 newX - x[theGoodOnes]
 newX
 [1] 0.89285908 0.51753998 1.18485887 2.10003705 0.54535841 1.28313738
 [7] 1.34092172 0.76064356 0.02201121 0.80808363 0.04578730 0.23045983
 [13] 1.04306626 0.12694184 0.89706863 0.86302992 1.53471660 0.51192410
 [19] 1.00366834 1.76923470 0.49508470 1.27888454 0.76706729 1.46340483
 [25] 1.69315538 0.50537603 0.18422329 0.72968629 0.45490526 2.18208183
 [31] 0.71926926 0.68915832 1.49076770 0.48763971 0.39273110 0.80709549
 [37] 0.22099019 0.38103757 0.14626929 0.63933750 1.26643194 3.33091910
 [43] 2.50341609 2.05286611 0.31986095 0.64548972 0.34712937 0.04075135
 [49] 0.07206342 0.20325505


 -- 
 Paul E. Johnson
 Professor, Political Science
 1541 Lilac Lane, Room 504
 University of Kansas

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

---
   Vincent Goulet, Associate Professor
   École d'actuariat
   Université Laval, Québec
   [EMAIL PROTECTED]   http://vgoulet.act.ulaval.ca

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


Re: [R] [OT] Typesetting / highlighting R code in Latex

2008-04-06 Thread Vincent Goulet
Le dim. 6 avr. à 14:44, Dirk Eddelbuettel a écrit :

 On 6 April 2008 at 10:40, Dirk Eddelbuettel wrote:
 | Using Latex and the beamer class, I would like to highlight code  
 snippets.
 | Does anybody know a suitable 'preprocessor' or 'filter' for R (and/ 
 or C/C++)
 | code ?
 |
 | I have been including it in simple \begin{verbatim} ...  
 \end{verbatim} and I
 | know there is a better way -- in fact I saw it used a while back  
 in some
 | package I looked at.  And I didn't write that down...
 |
 | What I am looking for is the basic equivalent of 'everything in  
 verbatim'
 | plus the ability to hightlight certain parts to stress the points  
 I'd like to
 | make.
 |
 | There must be something.  Pointers would be greatly appreciated!

 The listing class was what I was looking for -- thanks for the quick  
 off-list
 reply.  Basic synopis of listing is eg here
 http://en.wikibooks.org/wiki/LaTeX/Packages/Listings

The listing package is great. I used it for my Introduction à la  
programmation en S manual (on CRAN) to index the code sections  
automagically. That said, I had to add a few keywords to the list  
bundled with the package; you may want to have a look at my  
customizations in


https://vgoulet.act.ulaval.ca/svn/documents/intro_S/trunk/introduction_programmation_S.tex

[Lines 96--113]

HTH

Vincent



 Dirk

 --
 Three out of two people have difficulties with fractions.

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/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] Emacs 22.2-modified-1 is out

2008-03-28 Thread Vincent Goulet
I updated my modified GNU Emacs for Windows release to the now current  
version 22.2 of Emacs. The distribution is available at

http://vgoulet.act.ulaval.ca/en/emacs

For those hearing about this distribution for the first time, here's a  
short description: ready-to-install version of GNU Emacs 22.2 for  
Windows (released March 26, 2008) with the following additions:

* ESS 5.3.6;
* AUCTeX 11.85;
* Aspell 0.50.3;
* English and French dictionaries for Aspell;
* libraries for image formats XPM (xpm4.dll), PNG (libpng13.dll,  
zlib1.dll), JPEG (jpeg62.dll), TIFF (libtiff3.dll) and GIF  
(giflib4.dll);
* w32-winprint.el, to ease printing under Windows;
* htmlize.el, to print in color with w32-winprint.el;
* site-start.el, a site wide configuration file to make everything work.

The software installs with the Inno Setup wizard.

Please report problems to me directly.

---
   Vincent Goulet, Associate Professor
   École d'actuariat
   Université Laval, Québec
   [EMAIL PROTECTED]   http://vgoulet.act.ulaval.ca

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


Re: [R] Sweave and printing error

2008-03-26 Thread Vincent Goulet
Le mar. 25 mars à 17:12, Christophe Genolini a écrit :

 Hi the list.

 I am writing a tutorial for my student using LaTeX and sweave. I  
 include
 some example that work (obiously) but I would also like to include  
 some
 example that do NOT work (for pedagogie)...
 Is it possible ?

 At this point, I find that :
 - if there is a error in the code, Sweave stop
 - if I put the error in try(), Sweave compile but does not print the
 error as output.

 Any solution ?

 Thanks a lot

 Christophe

Something along these lines should do what you want:

echo=TRUE, eval=FALSE=
TRUE - 3
@
echo=FALSE, eval=TRUE=
cat(try(TRUE - 3))
@

If I recall correctly, this was discussed here before.

HTH

---
   Vincent Goulet, Associate Professor
   École d'actuariat
   Université Laval, Québec
   [EMAIL PROTECTED]   http://vgoulet.act.ulaval.ca

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


Re: [R] Newbie help with Sweave

2008-03-25 Thread Vincent Goulet
Le mar. 25 mars à 10:19, Duncan Murdoch a écrit :

 On 3/25/2008 10:06 AM, James W. MacDonald wrote:
 Hi Kevin,

 I usually install R in e.g., C:\R-2.6.2 to avoid such problems.

 Explicitly including

 \usepackage{Sweave}

 may also help, so that Sweave doesn't try to give an explicit path.
 Then again, it may not, depending on which LaTeX you're using.  This  
 is
 really a LaTeX problem, rather than an R problem:  different LaTeX
 distributions keep changing the rules for how to specify include
 directories.

 Duncan Murdoch

I also explicitly include \usepackage{Sweave} in my Sweave documents,  
but in addition I put a copy of the Sweave.sty file in my local texmf  
tree. After updating the TeX database, TeX/LaTeX finds the package  
file without any problem.

(Kevin: email off-list if you're not familiar with the concepts of  
local texmf tree and updating the TeX database.)

HTH




 Best,

 Jim



 Zembower, Kevin wrote:
 Kevin, thanks for writing. Yes, sorry, I forgot to mention that  
 this is
 a Windows XP Professional system running GNU Emacs 22.1.1
 (i386-mingw-nt5.1.2600) from Vincent Goulet, and R 2.6.2 Windows
 version. I pasted in the sessionInfo() output from ESS inside of  
 Emacs
 to the end of this note.

 Was your TA successful in correcting this error? How? Should I  
 report
 this to R-development as something worth fixing for the next  
 release?

 Thanks, again, for your response and advice.

 -Kevin



 -Original Message-
 From: Kevin E. Thorpe [mailto:[EMAIL PROTECTED]
 Sent: Monday, March 24, 2008 9:01 PM
 To: Zembower, Kevin
 Cc: [EMAIL PROTECTED]
 Subject: Re: [R] Newbie help with Sweave

 Is this in a windows system?  A TA of mine was just getting the  
 exact
 same message.  He tracked it down to the pathname for Sweave.sty  
 having
 trouble with Program Files in the path.

 Kevin

 Zembower, Kevin wrote:
 I think I've gotten my Emacs/Sweave/R system set up correctly,  
 thanks
 to
 Vincent and Jim, but I haven't been successful getting my first
 document
 produced. I'm trying to use one of Friedrich Leisch's examples,
 http://www.ci.tuwien.ac.at/~leisch/Sweave/example-1.Snw. I cut and
 pasted the text into a document sweaveexample.Rnw in Emacs. It  
 seemed
 to
 be processed successfully with R:
 Sweave(sweaveexample.Rnw)
 Writing to file sweaveexample.tex
 Processing code chunks ...

 You can now run LaTeX on 'sweaveexample.tex'

 However, when I try to open the file sweaveexample.tex and  
 process it
 with Latex in Emacs, I get this error:
 ERROR: Missing \endcsname inserted.

 --- TeX said ---
 to be read again
   \protect
 l.7 \begin
  {document}
 --- HELP ---
 From the .log file...

 The control sequence marked to be read again should
 not appear between \csname and \endcsname.

 I've tried a variety of examples, but the error messages are the  
 same.

 Can anyone point out my errors or mistakes? I've pasted in the full
 files below. Thanks so much for your help and advice.

 -Kevin

 Kevin Zembower
 Internet Services Group manager
 Center for Communication Programs
 Bloomberg School of Public Health
 Johns Hopkins University
 111 Market Place, Suite 310
 Baltimore, Maryland  21202
 410-659-6139
 ==
 sweaveexample.tex:
 ==
 \documentclass[a4paper]{article}

 \title{Sweave Example 1}
 \author{Friedrich Leisch}

 \usepackage{C:/PROGRA~1/R/R-26~1.2/share/texmf/Sweave}
 \begin{document}

 \maketitle

 In this example we embed parts of the examples from the
 \texttt{kruskal.test} help page into a \LaTeX{} document:

 \begin{Schunk}
 \begin{Sinput}
 data(airquality)
 library(ctest)
 kruskal.test(Ozone ~ Month, data = airquality)
 \end{Sinput}
 \begin{Soutput}
Kruskal-Wallis rank sum test

 data:  Ozone by Month
 Kruskal-Wallis chi-squared = 29.2666, df = 4, p-value = 6.901e-06
 \end{Soutput}
 \end{Schunk}
 which shows that the location parameter of the Ozone
 distribution varies significantly from month to month. Finally we
 include a boxplot of the data:

 \begin{center}
 \includegraphics{sweaveexample-002}
 \end{center}

 \end{document}
 
 sweaveexample.Rnw:
 ==
 \documentclass[a4paper]{article}

 \title{Sweave Example 1}
 \author{Friedrich Leisch}

 \begin{document}

 \maketitle

 In this example we embed parts of the examples from the
 \texttt{kruskal.test} help page into a \LaTeX{} document:

 =
 data(airquality)
 library(ctest)
 kruskal.test(Ozone ~ Month, data = airquality)
 @
 which shows that the location parameter of the Ozone
 distribution varies significantly from month to month. Finally we
 include a boxplot of the data:

 \begin{center}
 fig=TRUE,echo=FALSE=
 boxplot(Ozone ~ Month, data = airquality)
 @
 \end{center}

 \end{document}




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

Re: [R] Installation of R, Sweave, ESS and [X]Emacs on Windows?

2008-03-20 Thread Vincent Goulet
Kevin,

Save yourself a lot of trouble and use my modified version of GNU  
Emacs available from

http://vgoulet.act.ulaval.ca/en/emacs

and also linked from the ESS home page. It comes bundled with ESS and  
AUCTeX, so the only other thing you will need to install for the  
purposes you mention is R itself (upgrade while you're at it, you're  
two versions behind) and a TeX distribution (consider TeX Live or  
MiKTeX). There is no need for Cygwin with this setup.

Hope this helps

---
   Vincent Goulet, Associate Professor
   École d'actuariat
   Université Laval, Québec
   [EMAIL PROTECTED]   http://vgoulet.act.ulaval.ca


Le jeu. 20 mars à 11:34, Zembower, Kevin a écrit :

 I'm trying to get R, Sweave, ESS and XEmacs or emacs all installed and
 working together on my Windows XP Pro system. I've got R 2.6.0 working
 just fine, installed from the R Windows installer. I also have
 CYGWIN_NT-5.1 with XEmacs 21.4 working okay. Can anyone point me to  
 any
 documentation on how to bring these together so that R code typed in
 Xemacs can be run in R? I found the ESS installation directions here  
 at
 http://ess.r-project.org/Manual/ess.html#Microsoft-Windows- 
 installation
 but they seem daunting. I'm not sure that Xemacs from cygwin can work
 with R installed alone. Can anyone confirm that I just have to follow
 these directions to have everything I want?

 Thank you all for your help and advice.

 -Kevin

 Kevin Zembower
 Internet Services Group manager
 Center for Communication Programs
 Bloomberg School of Public Health
 Johns Hopkins University
 111 Market Place, Suite 310
 Baltimore, Maryland  21202
 410-659-6139

 __
 R-help@r-project.org mailing list
 https://stat.ethz.ch/mailman/listinfo/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] Use of ellipses ... in argument list of optim(), integrate(), etc.

2008-03-13 Thread Vincent Goulet
 From the NEWS file:

CHANGES IN R VERSION 2.6.0
SIGNIFICANT USER-VISIBLE CHANGES
  o integrate(), nlm(), nlminb(), optim(), optimize() and uniroot()  
now have '...' much earlier in their argument list. This reduces the  
chances of unintentional partial matching but means that the later  
arguments must be named in full.

---
   Vincent Goulet, Associate Professor
   École d'actuariat
   Université Laval, Québec
   [EMAIL PROTECTED]   http://vgoulet.act.ulaval.ca

Le jeu. 13 mars à 12:05, Ravi Varadhan a écrit :

 Hi,



 I have noticed that there is a change in the use of ellipses or . in R
 versions 2.6.1 and later.  In versions 2.5.1 and earlier, the . were  
 always
 at the end of the argument list, but in 2.6.1 they are placed after  
 the main
 arguments and before method control arguments.  This results in the  
 user
 having to specify the exact (complete) names of the control  
 arguments, i.e.
 partial matching is not allowed.

 An example with integrate() :

 integrate(function(x) exp(-x^2), lower=-Inf, upper=L, subdiv=1000)

 Error in f(x, ...) : unused argument(s) (subdiv = 1000)

 integrate(function(x) exp(-x^2), lower=-Inf, upper=L,  
 subdivisions=1000)

 1.633051 with absolute error  1.6e-06

 Here is an example with optim():

 res - optim(50, fw, meth=BFGS, control=list(maxit=2, temp=20,
 parscale=20))

 Error in fn(par, ...) : unused argument(s) (meth = BFGS)

 FYI, I am using R version 2.6.1 on Windows XP.

 May I ask what the rationale behind this change is and also about  
 the pros
 and cons of the two different ways of specifying (.)?

 Thank you very much.

 Best,

 Ravi.

 
 Ravi Varadhan, Ph.D.
 Assistant Professor, The Center on Aging and Health
 Division of Geriatric Medicine and Gerontology
 Johns Hopkins University
 Ph: (410) 502-2619
 Fax: (410) 614-9625
 Email: [EMAIL PROTECTED]
 Webpage:  http://www.jhsph.edu/agingandhealth/People/Faculty/Varadhan.html
 

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


Re: [R] best text editor for Linux?

2008-02-02 Thread Vincent Goulet
Le sam. 02 févr. à 05:49, 宋时歌 a écrit :

 On Linux platform, nothing beats Emacs + ESS.

To me, an added bonus of Emacs + ESS is that you can remove the On  
Linux platform, above. Emacs is one of the very few (only?)  
programmer's text editor with a good R mode that runs on all platforms  
where R runs: Unix/Linux, Windows (http://vgoulet.act.ulaval.ca/emacs)  
and MacOS (http://aquamacs.org). On whatever platform I need to work,  
I can use the same tools. Furthermore, M-w and C-y are the *correct*  
keyboard shortcuts for copy and paste! :-D

See also Section 6 of the R FAQ:

http://cran.r-project.org/doc/FAQ/R-FAQ.html#R-and-Emacs

Wade, when you write: I want to switch to Linux, but can't find much  
in the way of a text editor in sync with R, you didn't look very  
hard, now did you? ;-)

HTH

Vincent



 Shige

 On Feb 2, 2008 11:06 AM, Wade Wall [EMAIL PROTECTED] wrote:

 Hi all,

 I know this question has been asked in the past, but I am wondering  
 if
 anyone running R on Linux has any guidance as to a text editor that  
 works
 well with R.  At the present time I am running R on Windows and using
 TINN-R.  For a number of reasons I want to switch to Linux, but  
 can't find
 much in the way of a text editor in sync with R.  Any experiences,
 recommendations would be appreciated.

 Wade Wall

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

---
   Vincent Goulet, Associate Professor
   École d'actuariat
   Université Laval, Québec
   [EMAIL PROTECTED]   http://vgoulet.act.ulaval.ca

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


Re: [R] MLE for censored distributions in R

2008-01-23 Thread Vincent Goulet
Le mar. 22 janv. à 17:47, Thomas Downey a écrit :


 Hi just wondering if there is a package that can get the maximum  
 likelihood
 or method of moments estimator for distributions with censored  
 data?  The
 distributions I'm interested in are: Exponential, pareto, beta,  
 gamma and
 lognormal.

I'm highly biased here, but you may have a look at package actuar. The  
function coverage() will define the pdf or cdf of a random variable  
modified in many sorts of ways (truncation, censoring, inflation,  
etc.) based on any distribution you want. You can then use the  
function is usual fitting procedures such as fitdistr() for ML. See  
the lossdist vignette in the package for details.

HTH

---
   Vincent Goulet, Associate Professor
   École d'actuariat
   Université Laval, Québec
   [EMAIL PROTECTED]   http://vgoulet.act.ulaval.ca

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

2008-01-21 Thread Vincent Goulet

Ubuntu users on the amd64 platform will be pleased to know that up-to- 
date binary R packages are now available from CRAN. Following the  
policy for the i386 architecture, the supported Ubuntu releases are  
the latest two Ubuntu releases and the latest LTS release. Currently,  
these are Gutsy Gibbon (7.10), Feisty
Fawn (7.04) and Dapper Drake (6.06), respectively.

For instructions on obtaining these packages and further informatio,  
please see the CRAN Ubuntu README file at

http://cran.r-project.org/bin/linux/ubuntu

or, better yet, use your local CRAN mirror.

Please report any problems with the packages to the r-sig-debian  
mailing list, where messages have a much bettter chance of being  
noticed and swiftly replied to. In other words, please avoid posting  
Ubuntu (or Debian, for that matter) specific questions to r-help.

Finally, kudos to Michael Rutter who stepped up as maintainer for the  
amd64 Ubuntu packages.

---
   Vincent Goulet, Associate Professor
   École d'actuariat
   Université Laval, Québec
   [EMAIL PROTECTED]   http://vgoulet.act.ulaval.ca

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


Re: [R] editor under MAC system

2007-12-11 Thread Vincent Goulet
Le mar. 11 déc. à 07:03, Neil Shephard a écrit :

 YIHSU CHEN-3 wrote:

 Dear R-user;
 I recently switched from PC to MAC.  Is there a compatible editor as
 Win-editor with package RWinEdit for MAC?



 I'd recommend using Emacs with ESS (see http://ess.r-project.org/).   
 The
 advantage of this (beyond the seamless integration) is that its pretty
 platform neutral, and what you learn on your new Mac system will be  
 portable
 (i.e. the same method of writing/interacting with your R script/ 
 session
 whether your on Mac/M$-windows/*NIX variant).

I concur. Emacs is one of very few cross-platform editors with a  
special mode for R/S-Plus. If you want to give Emacs a try, I  
recommend Aquamacs (http://aquamacs.org) on OS X. It ships with the  
latest ESS and is better integrated to the OS than a regular Emacs.

In the future, post Mac related question to r-sig-mac, though.

HTH Vincent



 Neil
 -- 
 View this message in context: 
 http://www.nabble.com/editor-under-MAC-system-tp14249571p14272456.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.

---
   Vincent Goulet, Associate Professor
   École d'actuariat
   Université Laval, Québec
   [EMAIL PROTECTED]   http://vgoulet.act.ulaval.ca

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


[R] [R-pkgs] New version of actuar

2007-11-16 Thread Vincent Goulet
UseRs,

Version 0.9-4 of actuar should be making its way to CRAN mirrors. The  
main highlights of this new version are speed enhancements for a few  
functions, support for phase-type distributions and functions for ruin  
theory.

The relevant section of the NEWS file follows

Version 0.9-4
=

Maintenance and new features release.

NEW FEATURES -- LOSS DISTRIBUTIONS

   o Functions mgffoo() to compute the moment (or cumulant if 'log =
 TRUE') generating function of the following distributions:
 chi-square, exponential, gamma, inverse gaussian (from package
 SuppDists), inverse gamma, normal, uniform and phase-type (see
 below).

   o Functions mfoo() to compute the raw moments of all the probability
 distributions supported in the package and the following of base
 R: chi-square, exponential, gamma, inverse gaussian (from package
 SuppDists), inverse gamma, normal, uniform.

   o Functions {d,p,mgf,m,r}phtype() to compute the probability density
 function, cumulative distribution function, moment generating
 function, raw moments of, and to generate variates from,
 phase-type distributions.

NEW FEATURES -- RISK THEORY

   o Function VaR() with a method for objects of class aggregateDist
 to compute the Value at Risk of a distribution.

   o Function CTE() with a method for objects of class aggregateDist
 to compute the Conditional Tail Expectation of a distribution.

   o Function adjCoef() to compute the adjustment coefficient in ruin
 theory. If proportional or excess-of-loss reinsurance is included
 in the model, adjCoef() returns a function to compute the
 adjustment coefficient for given limits. A plot method is also
 included.

   o Function ruin() returns a function to compute the infinite time
 probability of ruin for given initial surpluses in the
 Cramér-Lundberg and Sparre Andersen models. Most calculations are
 done using the cdf of phase-type distributions as per Asmussen and
 Rolski (1991).

   o Calculations of the aggregate claim distribution using the
 recursive method much faster now that recursions are done in C.

NEW FEATURES -- CREDIBILITY THEORY

   o Modular rewrite of cm(): the function now calls internal functions
 to carry calculations for each supported credibility model. This
 is more efficient.

   o Basic support for the regression model of Hachemeister in function
 cm().

   o For the hierarchical credibility model: support for the variance
 components estimators of Bühlmann and Gisler (2005) and Ohlsson
 (2005). Support remains for iterative pseudo-estimators.

   o Calculations of iterative pseudo-estimators in hierarchical
 credibility are much faster now that they are done in C.

OTHER NEW FEATURES

   o Four new vignettes: introduction to the package and presentation
 of the features in loss distributions, risk theory and credibility
 theory.

   o Portfolio simulation material of the credibility demo moved to
 demo simulation.

USER-VISIBLE CHANGES

   o Argument 'approx.lin' of quantile.aggregateDist() renamed
 'smooth'.

   o Function aggregateDist() gains a 'maxit' argument for the maximum
 number of recursions when using Panjer's algorithm. This is to
 avoid infinite recursion when the cumulative distribution
 function does not converge to 1.

   o Function cm() gains a 'maxit' argument for the maximum number of
 iterations in pseudo-estimators calculations.

   o Methods of aggregate(), frequency(), severity() and weights() for
 objects of class simpf gain two new arguments:

 1. 'classification'; when TRUE, the columns giving the
classification structure of the portfolio are excluded from the
result. This eases calculation of loss ratios (aggregate claim
amounts divided by the weights);

 2. 'prefix'; specifies a prefix to use in column names, with
 sensible defaults to avoid name clashes for data and weight
 columns.

BUG FIXES

   o The way weights had to be specified for the chi-square method of
 mde() to give expected results was very unintuitive. The fix has
 no effect when using the default weights.

   o The empirical step function returned by the recursive and
 convolution methods of aggregateDist() now correctly returns 1
 when evaluated past its largest knot.

DEPRECATED

   o Direct usage of bstraub() is now deprecated in favor of cm(). The
 function will remain in the package since it is used internally by
 cm(), but it will not be exported in future releases of the
 package. The current format of the results is also deprecated.


---
   Vincent Goulet, Associate Professor
   École d'actuariat
   Université Laval, Québec
   [EMAIL PROTECTED]   http://vgoulet.act.ulaval.ca

___
R-packages mailing list
[EMAIL PROTECTED]
https://stat.ethz.ch/mailman/listinfo/r-packages