Re: [ESS] Error installing on ubuntu

2024-04-27 Thread Dirk Eddelbuettel via ESS-help


On 27 April 2024 at 10:53, 신선영(수학과) via ESS-help wrote:
| Dear all,
| 
| I get the following error message:
| 
| make -C lisp all
| make[1]: Entering directory '/home/mathi/ess-24.01.1/lisp'
| test -f ../etc/.IS.RELEASE || wget -qO - 
https://raw.githubusercontent.com/JuliaEditorSupport/julia-emacs/master/julia-mode.el
 > julia-mode.el
| test -f ../etc/.IS.RELEASE || wget -qO - 
https://raw.githubusercontent.com/JuliaEditorSupport/julia-emacs/master/julia-mode-latexsubs.el
 > julia-mode-latexsubs.el
| Computing dependencies
| sed: can't read julia-mode-latexsubs.el: No such file or directory
| 
| …
| …
| 
| In toplevel form:
| julia-mode.el:40:2: Error: Cannot open load file: No such file or directory, 
julia-mode-latexsubs
| make[1]: *** [Makefile:58: julia-mode.elc] Error 1
| make[1]: Leaving directory '/home/mathi/ess-24.01.1/lisp'
| make: *** [Makefile:30: lisp] Error 2
| 
| I uncommented some lines related with Julia in Makefile, but that did fix the 
issue.
| 
| Any advice is appreciated. Thanks.

Where did you start from?  I sometimes use the Debian/Ubuntu (that I used to
look after, now it is done by Seb, see https://tracker.debian.org/pkg/ess and
https://packages.ubuntu.com/search?suite=all=all=any=ess=sourcenames)
and sometimes I use melpa. It generally 'just works'.

Dirk

-- 
dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

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


Re: [ESS] FW: [GNU ELPA] ESS version 24.1.1

2024-02-18 Thread Dirk Eddelbuettel via ESS-help


On 18 February 2024 at 20:54, Brett Presnell via ESS-help wrote:
| 
| Forgot to mention that you may need to uninstall and reinstall the ess
| package after putting the :pin in place, but I'm not sure about that.
| Restarting emacs is maybe needed too, but not sure about that either.

The pin, along with uninstalling the 20240131* one I had, seems to have done
the trick.

Many thanks!

Dirk

-- 
dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

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


Re: [ESS] FW: [GNU ELPA] ESS version 24.1.1

2024-02-18 Thread Dirk Eddelbuettel via ESS-help


Rodney et al,

Thanks for the update(s)!

Alas, I also seem to see
  ess20240131.1041  installed Emacs 
Speaks Statistics
which seems to win over
  ess24.1.1 obsolete  Emacs 
Speaks Statistics

What is the suggested way to have 24.1.1 sort higher?

Thanks,  Dirk

-- 
dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

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


Re: [R] Convert character date time to R date-time variable.

2023-12-07 Thread Dirk Eddelbuettel


`anytime` was written for this:

  > anytime::anytime("2020-09-17_00:00:00")
  [1] "2020-09-17 CDT"
  > class(anytime::anytime("2020-09-17_00:00:00"))
  [1] "POSIXct" "POSIXt" 
  > 

Dirk


-- 
dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
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: [R] Unable to add the CRAN apt repository

2023-12-04 Thread Dirk Eddelbuettel


Steve,

The better list for such questions is r-sig-debian.

On 4 December 2023 at 13:41, Steve Gutreuter wrote:
| I just upgraded from Linux Mint 20 to 21 and am no longer able to add the CRAN
| Ubuntu repository to my list of repositories.  I am getting:
| 
| $> sudo /usr/bin/add-apt-repository "deb
| https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/"
| $> sudo apt update
| Hit:1 http://security.ubuntu.com/ubuntu jammy-security InRelease
| Hit:2 http://archive.ubuntu.com/ubuntu jammy InRelease
| Hit:3 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
| Hit:4 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
| Ign:5 http://packages.linuxmint.com victoria InRelease
| Hit:6 http://packages.linuxmint.com victoria Release
| Ign:8 https://cloud.r-project.org/bin/linux/ubuntu victoria-cran40/ InRelease
| Err:9 https://cloud.r-project.org/bin/linux/ubuntu victoria-cran40/ Release
| 404 Not Found [IP: 108.139.15.91 443]
| Reading package lists... Done
| E: The repository 'https://cloud.r-project.org/bin/linux/ubuntu 
victoria-cran40/
| Release' does not have a Release file.
| N: Updating from such a repository can't be done securely, and is therefore
| disabled by default.

There is no such thing as 'victoria-cran40' at these servers.

Use jammy-cran40 if you want the Ubuntu 22.04 binaries, otherwise use
focal-cran40 for Ubuntu 20.04.

Dirk


| Any hints will be much appreciated!
| 
| -- 
| Steve Gutreuter
| 
| 
|   [[alternative HTML version deleted]]
| 
| __
| 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.

-- 
dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
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] [R-win] Difficulty installing R packages under Windows 11 / Cygwin

2023-12-03 Thread Dirk Eddelbuettel via ESS-help


On 2 December 2023 at 22:06, Tomas Kalibera via ESS-help wrote:
| R is not being tested under WSL.

(From several arm lengths away:)  WSL2 appears to be very solid.

I had an early alpha tester of my (then brand-new) r2u [1] using and
stressing it, it appears to work a like regular Ubuntu system so 'everything
just works' yet it is on Windows. (Which I haven't touched in a decade+.)

Dirk

[1] r2u provides all of CRAN plus ~ 400 BioC package via apt with bspm as
added interface. So say install.packages(c("tidyverse", "rstan", "brms")) and
everything installs as binaries in 33 secs [2] with _all_ system dependencies
resolved via apt. (Also FYI, Inaki has a similar system for Fedora called
cran2copr.) More about r2u is at https://eddelbuettel.github.io/r2u

[2] Vidoe of that command running in 33 seconds in an empty container with
only R and r2u is at:
https://eddelbuettel.github.io/images/2023-12-03/r2u_tidyverse_rstan_brms_33secs_2023-12-03_07-26.gif

-- 
dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

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


Re: [ESS] How can one tell rlang not to mess up R session in ESS ?

2023-11-15 Thread Dirk Eddelbuettel via ESS-help


For completeness, and without any time yet to dig into Lionel's nord
modification, and as a friend who saw thread asked: what I ended up doing was
following the hint about cli and NO_COLOR and now (conditionally) set

## No color from cli inside emacs
## 
https://cli.r-lib.org/reference/faq.html#how-do-i-turn-off-ansi-colors-and-styles-
if (Sys.getenv("INSIDE_EMACS") != "")
Sys.setenv(NO_COLOR="TRUE")

That preserves cli behavior on the command-line etc but now prevents it from
turning my R buffer under ESS in Emacs unreadable should I encounter an
error.  And that is good enough for now.

Thanks again,  Dirk

-- 
dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

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


Re: [ESS] How can one tell rlang not to mess up R session in ESS ?

2023-11-14 Thread Dirk Eddelbuettel via ESS-help


On 14 November 2023 at 12:03, Deepayan Sarkar wrote:
| Are you suggesting that we should not be getting that by default? I

As I wrote in my message starting the thread:

   Casual searching at the rlang repo doesn't reveal anything so pardon me for
   asking here but what is a simple way to tell rlang to NOT do fancy pants
   color error backtraces?  At least under the theme I use ("nord", for Emacs)
   it basically nixes readability by leaving a 'dark on dark' default.

I have nothing against occassional cutesy symbols (ie happy rcmdcheck user)
but I get rather unhappy each rlang decided to 'help' by rendering my current
R session unusable.

Dirk

-- 
dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

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


Re: [ESS] How can one tell rlang not to mess up R session in ESS ?

2023-11-14 Thread Dirk Eddelbuettel via ESS-help


On 14 November 2023 at 17:22, Lionel Henry wrote:
| Worth noting I'm using `xterm-color` instead of `ansi-color` in my
| comint buffers. IIRC the latter (which is builtin) didn't support some
| features. Not sure if that could explain the bad behaviour you've
| observed.

I was also thinking cli could take advantage of TERM. In ESS under x11 and on
the terminal I seem to see

  > Sys.getenv("TERM")
  [1] "dumb"
  > 

so I guess ESS (or Emacs?) overrides because I otherwise settled on TERM and
BYOBY_TERM as screen-256color which is decent setting for Nord.

Back to rlang and cli messing up sessions they maybe should leave alone:
would the team consider not asking the user to set NO_COLOR and rather
inspect the terminal info and refraining from damaging working setups?

Best, Dirk

-- 
dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

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


Re: [ESS] How can one tell rlang not to mess up R session in ESS ?

2023-11-14 Thread Dirk Eddelbuettel via ESS-help


On 13 November 2023 at 18:54, Lionel Henry wrote:
| > Do you use this instead of the nord theme, or on top of the nord
| > theme?  Can you (briefly) describe what it does / what you like about
| > this addition?
| 
| I use it on top. This snippet comes in between loading and activation:
| 
| ```
| (require 'nord-theme)
| (load-theme 'nord)
| 
| *snippet*
| 
| (enable-theme 'nord)
| ```

That is good!  I noticed for a while that loading nord interfered with
starting in daemon mode so I dialed things down a little / conditioned on
interactive or some other trick (I am still a complete Elisp noob).

| I have a bunch of other stuff defined in there, like:
| 
| ```
| (custom-theme-set-faces
|  'nord
|  `(tab-bar ((t (:background ,nord1 :height 1.0
|  `(tab-bar-tab ((t (:foreground ,nord6 :background ,nord9 :box
| (:line-width (4 . 2) :style flat-button)
|  `(tab-bar-tab-inactive ((t (:foreground ,nord9 :background ,nord3
| :box (:line-width (4 . 2) :style flat-button))
| ```
| 
| This might not be the best way of doing this, but it's been some years
| since I added this and it still works.
| 
| Let me know if you're still having trouble with cli theming in ESS
| (and you want it to work instead of disabling it). It might be worth
| discussing in an issue on Github in that case.

Haven't restarted yet but I resorted for the blunt-but-likely-effective

## No color from cli inside emacs
## 
https://cli.r-lib.org/reference/faq.html#how-do-i-turn-off-ansi-colors-and-styles-
if (Sys.getenv("INSIDE_EMACS") != "")
Sys.setenv(NO_COLOR="TRUE")

See next message. Part of me still thinks rlang and cli do this wrong by
ignoring available env vars.

Thanks for the help,  Dirk
 
| Best,
| Lionel
| 
| 
| On 11/13/23, Dirk Eddelbuettel  wrote:
| >
| > Thanks Lionel. I was pretty sure I could count on a non-empty intersection
| > between ESS and rlang...
| >
| > On 13 November 2023 at 17:20, Lionel Henry wrote:
| > | See the cli website for disabling colours:
| > |
| > 
https://cli.r-lib.org/reference/faq.html#how-do-i-turn-off-ansi-colors-and-styles-
| >
| > Drats. I though of crayon but not cli. I still get lost in your endlessly
| > twisted maze of package. One day.
| >
| > | I use nord-theme too and I see I have this in my config, in case that
| > helps
| > | (I trimmed down this snippet manually, there might be a typo):
| > |
| > | ```lisp
| > | (let ((class '((class color) (min-colors 89)))
| > |   (nord0 (if (nord-display-truecolor-or-graphic-p) "#2E3440" nil))
| > |   (nord1 (if (nord-display-truecolor-or-graphic-p) "#3B4252"
| > "black"))
| > |   (nord2 (if (nord-display-truecolor-or-graphic-p) "#434C5E"
| > "#434C5E"))
| > |   (nord3 (if (nord-display-truecolor-or-graphic-p) "#4C566A"
| > "brightblack"))
| > |   (nord4 (if (nord-display-truecolor-or-graphic-p) "#D8DEE9"
| > "#D8DEE9"))
| > |   (nord5 (if (nord-display-truecolor-or-graphic-p) "#E5E9F0"
| > "white"))
| > |   (nord6 (if (nord-display-truecolor-or-graphic-p) "#ECEFF4"
| > "brightwhite"))
| > |   (nord7 (if (nord-display-truecolor-or-graphic-p) "#8FBCBB" "cyan"))
| > |   (nord8 (if (nord-display-truecolor-or-graphic-p) "#88C0D0"
| > "brightcyan"))
| > |   (nord9 (if (nord-display-truecolor-or-graphic-p) "#81A1C1" "blue"))
| > |   (nord10 (if (nord-display-truecolor-or-graphic-p) "#5E81AC"
| > "brightblue"))
| > |   (nord11 (if (nord-display-truecolor-or-graphic-p) "#BF616A" "red"))
| > |   (nord12 (if (nord-display-truecolor-or-graphic-p) "#D08770"
| > | "brightyellow"))
| > |   (nord13 (if (nord-display-truecolor-or-graphic-p) "#EBCB8B"
| > "yellow"))
| > |   (nord14 (if (nord-display-truecolor-or-graphic-p) "#A3BE8C"
| > "green"))
| > |   (nord15 (if (nord-display-truecolor-or-graphic-p) "#B48EAD"
| > "magenta")))
| > |   (let ((ansi-colours (vector nord1 ; black
| > |   nord11; red
| > |   nord14; green
| > |   nord13; yellow
| > |   nord8 ; blue
| > |   nord15; magenta
| > |   nord7 ; cyan
| > |       nord5 ; white
| > |   )))
| > | (setq xterm-color-names ansi-colours)
| > | (custom-theme-set-variables
| > |  'nord
| > |  `(ansi-color-names-vector ,ansi-colours
| &g

Re: [ESS] How can one tell rlang not to mess up R session in ESS ?

2023-11-13 Thread Dirk Eddelbuettel via ESS-help


Thanks Lionel. I was pretty sure I could count on a non-empty intersection
between ESS and rlang...

On 13 November 2023 at 17:20, Lionel Henry wrote:
| See the cli website for disabling colours:
| 
https://cli.r-lib.org/reference/faq.html#how-do-i-turn-off-ansi-colors-and-styles-

Drats. I though of crayon but not cli. I still get lost in your endlessly
twisted maze of package. One day.

| I use nord-theme too and I see I have this in my config, in case that helps
| (I trimmed down this snippet manually, there might be a typo):
| 
| ```lisp
| (let ((class '((class color) (min-colors 89)))
|   (nord0 (if (nord-display-truecolor-or-graphic-p) "#2E3440" nil))
|   (nord1 (if (nord-display-truecolor-or-graphic-p) "#3B4252" "black"))
|   (nord2 (if (nord-display-truecolor-or-graphic-p) "#434C5E" "#434C5E"))
|   (nord3 (if (nord-display-truecolor-or-graphic-p) "#4C566A" 
"brightblack"))
|   (nord4 (if (nord-display-truecolor-or-graphic-p) "#D8DEE9" "#D8DEE9"))
|   (nord5 (if (nord-display-truecolor-or-graphic-p) "#E5E9F0" "white"))
|   (nord6 (if (nord-display-truecolor-or-graphic-p) "#ECEFF4" 
"brightwhite"))
|   (nord7 (if (nord-display-truecolor-or-graphic-p) "#8FBCBB" "cyan"))
|   (nord8 (if (nord-display-truecolor-or-graphic-p) "#88C0D0" 
"brightcyan"))
|   (nord9 (if (nord-display-truecolor-or-graphic-p) "#81A1C1" "blue"))
|   (nord10 (if (nord-display-truecolor-or-graphic-p) "#5E81AC" 
"brightblue"))
|   (nord11 (if (nord-display-truecolor-or-graphic-p) "#BF616A" "red"))
|   (nord12 (if (nord-display-truecolor-or-graphic-p) "#D08770"
| "brightyellow"))
|   (nord13 (if (nord-display-truecolor-or-graphic-p) "#EBCB8B" "yellow"))
|   (nord14 (if (nord-display-truecolor-or-graphic-p) "#A3BE8C" "green"))
|   (nord15 (if (nord-display-truecolor-or-graphic-p) "#B48EAD" "magenta")))
|   (let ((ansi-colours (vector nord1 ; black
|   nord11; red
|   nord14; green
|   nord13; yellow
|   nord8 ; blue
|   nord15; magenta
|   nord7 ; cyan
|   nord5 ; white
|   )))
| (setq xterm-color-names ansi-colours)
| (custom-theme-set-variables
|  'nord
|  `(ansi-color-names-vector ,ansi-colours
| ```

Great, will play later.  Do you use this instead of the nord theme, or on top
of the nord theme?  Can you (briefly) describe what it does / what you like
about this addition?

Thanks,  Dirk

| Best,
| Lionel
| 
| 
| On 11/13/23, Dirk Eddelbuettel via ESS-help  wrote:
| >
| > Casual searching at the rlang repo doesn't reveal anything so pardon me for
| > asking here but what is a simple way to tell rlang to NOT do fancy pants
| > color error backtraces?  At least under the theme I use ("nord", for Emacs)
| > it basically nixes readability by leaving a 'dark on dark' default.
| >
| > Thanks in advance for any pointers.
| >
| > Dirk
| >
| > --
| > dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org
| >
| > __
| > ESS-help@r-project.org mailing list
| > https://stat.ethz.ch/mailman/listinfo/ess-help
| >

-- 
dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

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


[ESS] How can one tell rlang not to mess up R session in ESS ?

2023-11-13 Thread Dirk Eddelbuettel via ESS-help


Casual searching at the rlang repo doesn't reveal anything so pardon me for
asking here but what is a simple way to tell rlang to NOT do fancy pants
color error backtraces?  At least under the theme I use ("nord", for Emacs)
it basically nixes readability by leaving a 'dark on dark' default.

Thanks in advance for any pointers.

Dirk

-- 
dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

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


Re: [ESS] run R code upon starting each ESS session

2023-10-03 Thread Dirk Eddelbuettel via ESS-help


On 3 October 2023 at 18:52, Manuel Teodoro via ESS-help wrote:
| Is there a way to run R code upon starting each ESS session?
| 
| Something like Rprofile but I'd like to make it more dependent to emacs.
| 
| What I want is to have a few options settings in my R sessions by default.
| Since I use it in different computers but my Emacs configuration is shared
| among all of them, I would prefer to keep this also within my emacs config.
| 
| It can be either calling an R script, specifying the path to Rprofile
| directly to ESS or passing a string of R code to run at startup.
| 
| Any ideas are appreciated

Cool question. My immediate thought (weighted by the fact that I cannot write
elisp code ;-) ) was to test for that in the _the standard R startup files_.
A quick check of what `Sys.getenv()` returns inside Emacs reveals the
`INSIDE_EMACS` env var so now I just added

if (interactive() && nzchar(Sys.getenv("INSIDE_EMACS")))  {
cat("Hello Emacs user.\n")
}

to the bottom of .Rprofile and indeed:

  [... other stuff including the fortunes::fortune call output ...] 

  Hello Emacs user.
  > setwd('/home/edd/')
  > 

but not when I start R on the terminal.  That could be start for you.

Dirk

-- 
dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

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


Re: [ESS] How to Duplicate Previous Functionality/Workflow

2023-09-23 Thread Dirk Eddelbuettel via ESS-help


On 22 September 2023 at 07:04, Stephen J. Eglen via ESS-help wrote:
| 2. A non-answer to the original question, but I prefer writing Makefiles
| to build my documents, rather than using Emacs functionality.  Emacs has
| a good interface to running make (e.g. through M-x compile).  Use
| whatever is best for you, but just thought I'd mention it.

Even simpler: I just rely on M-x compile-command (and its shortcut).

On the first invocation I edit the out the existing stanza 'make -k' that
would get invoked, and make it 'render.r filename.Rmd' to process the file I
currently edit.  Evince refreshed automagically. This is arguably a little
pedestrian, but it takes me away from a land with a language I do not speak
(elisp) to one I am rather comfortable in (scripts, shell scripts, littler
aka 'r' scripts, Rscript, ...) that do the task.

polymode has sometimes been finicky to install / updated, esp a few years
ago, and is also (if I read the tea leaves correctly) one of the reasons we
have not had an ESS release in five (5) years (which really is rather sad, at
least to this long time user) but it has been working fine the last couple of
years. I now settled on a mix of elpa-* packages I get from Ubuntu and a
number of 'directly from elpa/melpa' packages.  By and large it is still a
great editing experience.  I would guestimate that for the last decade I
wrote most output appearing as html (ie course website) and more frequently
pdf (slides for talks or lectures, short papers) in it.

Dirk

-- 
dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

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


Re: [ESS] Working with Roxygen2

2023-06-27 Thread Dirk Eddelbuettel via ESS-help


On 28 June 2023 at 06:49, Vikas Rawal via ESS-help wrote:
| I am trying to build my first R package, and am using Roxygen2 to document
| the functions. I was wondering if there is anything that would provide a
| boilerplate template? Maybe a yasnippet or something better?

There is and AFAIK always has been.

I.e. when I open a new file /tmp/pyth.R and add

pyth <- function(x, y) {
sqrt(x^2 + y^2)
}

and save it, ESS mode offers in menu ESS an entry Roxygen with first option
Generate/Update Template and keyboard shortcut C-c C-o C-o (in my version).
That has been here since _forever_.  Invoking it adds this header above

##' .. content for \description{} (no empty lines) ..
##'
##' .. content for \details{} ..
##' @title 
##' @param x 
##' @param y 
##' @return 
##' @author Dirk Eddelbuettel
pyth <- function(x, y) {
sqrt(x^2 + y^2)
}

and that is 'Good Enough for Me (TM)'.  I can't remember if I had to set an
Emacs variable to have my username come up or if ESS queries my Linux host
but it is all quite nicely done.

Hth, Dirk

-- 
dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

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


Re: [ESS] Emacs, ESS and Rmarkdown: Is this the way compile is supposed to work?

2023-04-15 Thread Dirk Eddelbuettel via ESS-help


On 15 April 2023 at 19:21, Kevin Zembower via ESS-help wrote:
| I'm trying to get Emacs, ESS and Rmarkdown to work together for the 
| first time. Therefore, the problem might be me, and not the software.
| 
| I have this program as Prob_11.Rmd:
| ==
| ---
| title: "Problem 11, Page 414"
| author: "Kevin"
| date: "13 Apr 2023"
| output: html_document
| ---
| 
| ### Load the sample data ###
| 
| Loading the sample data table into two vectors:
| 
| ``` {r}
| 
| (age11 <- c(18, 10, 3, 15, 12, 14, 15, 4, 20, 8))
| 
| (age16 <- c(6, 7, 14, 5, 14, 12, 3, 9, 4, 7))
| 
| ```
| 
| 
| I get this as output after choosing Markdown->Preview & Export->Compile:
| =
| 
| http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd;>
| 
| http://www.w3.org/1999/xhtml;>
| 
| 
| *markdown-output*
| 
| 
| 
| 
| 
| 
| Load the sample data
| Loading the sample data table into two vectors:
| 
| (age11 - c(18, 10, 3, 15, 12, 14, 15, 4, 20, 8))
| 
| (age16 - c(6, 7, 14, 5, 14, 12, 3, 9, 4, 7))
| 
| 
| 
| 
| ==
| 
| This looks correct, except that I was expecting the last two lines to 
| look like:
| 
|  > (age11 <- c(18, 10, 3, 15, 12, 14, 15, 4, 20, 8))
|   [1] 18 10  3 15 12 14 15  4 20  8
|  > (age16 <- c(6, 7, 14, 5, 14, 12, 3, 9, 4, 7))
|   [1]  6  7 14  5 14 12  3  9  4  7
| 
| Am I doing something wrong? Am I misunderstanding what RMarkdown is 
| doing? I tried options like 'echo=TRUE' and 'eval=TRUE' without success.
| 
| Thanks for any advice or guidance. I posted this request on 
| stackoverflow.com, at 
| 
https://stackoverflow.com/questions/76014830/emacs-ess-and-rmarkdown-is-this-the-way-compile-is-supposed-to-work,
 
| but didn't get any response.

Actually, I did respond with this comment
https://stackoverflow.com/questions/76014830/emacs-ess-and-rmarkdown-is-this-the-way-compile-is-supposed-to-work#comment134066087_76014830

I believe you are confusing Markdown (no R) with support from Emacs (but no
connection to R) with what you desire for RMarkdown.  I responded that I
happen to do this differently via M-x compile-command and script to render
RMarkdown.

Anyway, this is the right list and there likely is a function from ESS
too. If so someone will likely offer advice.

Good luck,  Dirk

-- 
dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

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


Re: [R] converting to date object...

2023-04-12 Thread Dirk Eddelbuettel


That is what I wrote the anytime package for: effortless automatic
parsing.  Also works for dates:

   > library(anytime)
   > anydate("12 APR 2023")
   [1] "2023-04-12"
   > 

Dirk

-- 
dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
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] build problem

2023-02-05 Thread Dirk Eddelbuettel via ESS-help

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

-- 
dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

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


Re: [ESS] Debian installation bug report with current package and Emacs 28.1

2022-09-28 Thread Dirk Eddelbuettel via ESS-help


Per the email I had referenced earlier and its schedule, ESS has now been
removed from Debian 'unstable' ie the rolling top of the distribution.  While
the existing package in the stable release (as well as previous ones) is
still there for manual installation, future releases will not contain ESS.

Dirk

-- 
dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

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


Re: [ESS] Debian installation bug report with current package and Emacs 28.1

2022-09-13 Thread Dirk Eddelbuettel via ESS-help


A follow-up to this bug report: Due to the breakage caused by the (old) ess
package, I (as maintainer of the Debian package) now received the note that
the ess / elpa-ess packages will be archived away from Debian unstable as
they make Emacs 28.1 uninstallable.

So future Debian releases will not have ess / elpa-ess package.  Of course
installation from other sources remains possible.

We debated here for some time what to do about a new ESS release, but with
nothing concrete to show, and this is now a consequence of (in)action.  We
are all between a rock and a hard place: the upstream is 'not quite right'
for a release so none happens, yet Debian users want Emacs 28.1.  So there.

Dirk

-- 
dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

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


[ESS] Debian installation bug report with current package and Emacs 28.1

2022-08-21 Thread Dirk Eddelbuettel via ESS-help


Hi all,

I just got a fresh (and detailed) bug reports at 

   https://bugs.debian.org/1017829

which details issue with the package I look after ("frozen" at the last
official release) and the current emacs-gtk 28.1.

I find myself between a rock and a hard place here. I would prefer an updated
release, but of course as discussed here before "that ain't easy" and while I
could switch to a melpa tarball I am a little worried I may then get side
effects from the less tested combinations of what melpa has (and needs) and
what may be in Debian to satisfy those dependencies.  Thoughts?

Best,  Dirk

-- 
dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

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


[ESS] [Rather ancient] ESS documentation on 'script is the truth' ?

2022-05-07 Thread Dirk Eddelbuettel via ESS-help


Many moons ago the ESS documentation contained a short write-up by (IIRC)
Tony which detailed the workflow common for many of us: write in a script,
execute lines or regions, possibly save a transcript buffer.

Every now and then I want to refer people to this as it was a very clear
expression of why that workflow is good. But I cannot find this anymore --
the doc/ folder in the sources got cleaned a few years and this appears to
have vanished.  (Or is git history my friend here and I should possibly just
create a fresh checkout and hard reset a decade or two?)

Does anybody have a recollection of this, and better still, a copy?

Dirk

-- 
dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

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


Re: [ESS] Advice on setting up ESS to edit and knit Rmarkdown files

2021-09-22 Thread Dirk Eddelbuettel via ESS-help


On 22 September 2021 at 15:15, Lionel Henry wrote:
| We'd love to do a release but ESS is not in a good place right now.
| Recent versions of Emacs interrupt background commands (essential to
| completion and contextual help like eldoc) when the user starts
| typing, which causes hard to solve problems.

Yes :-/ I guess that was the state of affairs last time this came up.
 
| The dev branch is mostly working but not 100% correctly. Unfortunately
| none of us seem to have the time to work on ESS at the moment.
| 
| That said, while Martin, Vitalie and I notice issues here and there,
| we haven't had serious bug reports in a while, despite the dev branch
| being used by many Melpa users. So maybe releasing in the current
| state is better than nothing.

Noted. It's a trade-off. Nobody wants unhappy users from not-quite-baked code
but the staleness is also an issue. And I trust you all to make the right
call. It will, as always, sort itself out eventually.

Dirk

-- 
https://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

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


Re: [ESS] Advice on setting up ESS to edit and knit Rmarkdown files

2021-09-22 Thread Dirk Eddelbuettel via ESS-help


On 20 September 2021 at 13:59, Sparapani, Rodney via ESS-help wrote:
| Generally, this stuff should just work out-of-the-box.

Understood.

| And we are not a company like RStudio so this FOSS setup works for us as
| developers and hopefully it still serves the users well.

But legal structure has nothing to with 'calling a release'. Which is done by
authors (who should know the code better than users) saying "yep what we have
at HEAD right now is good" and then cut a tarball.  That is a _marker_.
Which some less-informed people like me can take (and then ship downstream to
Debian, and with that Ubuntu etc).

Without a marker, no shipment. Less ideal to me and others.

So pretty-please if someone would: could a release one of these moons. It
does not have to be frequent or regularly schedule or anything.  But maybe
more often than once every few years?  Maybe when you sync with upstream
Emacs (assuming you do now)?

Dirk

-- 
https://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

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


Re: [ESS] Advice on setting up ESS to edit and knit Rmarkdown files

2021-09-20 Thread Dirk Eddelbuettel via ESS-help


On 20 September 2021 at 13:59, Sparapani, Rodney via ESS-help wrote:
| Over the last few years, we have moved away from having to set up features
| with .emacs/etc.  as much as possible.  Generally, this stuff should just
| work out-of-the-box.

I completely concur and _love it_.

I mostly just have an old .emacs because well over the years I put some
toggles or preferences there.  But stuff does work.

(Every now and then defaults change in ways some of us don't like. I for one
prefer older indentations over the newer clang-format / R's lintr or styler
default which I find unreadable. Luckly I have a snippet I added in 1997 or
so straight from the manual and all is good for me. [ I did have to holler
once or twice whem the lintr was autoenabled with bad defaults to boot. ])

Dirk

-- 
https://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

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


Re: [ESS] Advice on setting up ESS to edit and knit Rmarkdown files

2021-09-19 Thread Dirk Eddelbuettel via ESS-help


Chris,

I don't have great advice.

I have been doing this in Emacs with ESS (and friends like polymode) 'for
years' and it mostly worked. So thumbs up -- it worth doing and I prefer
doing it in Emacs. Polymode is actually rather cool.

The world being what it is these days, the predictable six-month cycle of ESS
updates stopped at some point with "much bigger, much better" next release
"right around the corner".  And then that never happened (yet).  So sometimes
I tried updating via the Emacs package manager, but once or twice something
odd happened so I reverted to the content of the deb package I look after --
it is still at 18.10 (even though it is now, just like other Debian ELPA
packages, mostly a shim around the (versioned) ELPA package).

Long story short, 'apt install elpa-ess' should work. As emails I have 25-ish
years of cruft in .emacs but not too too much relative to ESS and
RMarkdown. It generally just works and it is fun to use. I really do live in
it for just about everything I write these days.

Dirk

-- 
https://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

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


Re: [ESS] How to move to start of previous command, but not start of line?

2021-08-27 Thread Dirk Eddelbuettel via ESS-help


On 27 August 2021 at 20:48, William Denton via ESS-help wrote:
| Let's say I enter the following keystrokes:
| 
| 1 + 1 RET M-p C-a
| 
| This adds 1+1, gets the result, then runs comint-previous-input and reenters 
the 
| previous command.  C-a moves to the start of the line ... but puts the point 
| before the prompt, where the | is below.
| 
| # ———
| > 1+1
| [1] 2
| |> 1 + 1
| # ———
| 
| Is there a way to go to the start of the command, not the line?  I'm often in 
a 
| situation where I get something working and then want to assign it to a 
| variable, and it would be nice to run M-p C-a and be able to type "foo <-" 
with 
| everything in place.  (Thereby saving me all the trouble of hitting the right 
| arrow twice, which I know is trivial, but this is Emacs so I bet someeone has 
| got this working, unless I missed it in the docs.)

When I do
   foo <- 1 + 1 RET M-p C-a
my cursor is on f.

And always has been. Vanilla Emacs, currently 27.1, though I started using it
just before the 20s if memory serves, vanilla ESS most of those years, and no
fanyc prompt inside R. Just a a standar '> ' as

  > getOption("prompt")
  [1] "> "
  > 

Dirk

-- 
https://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

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


Re: [R] No "doc" directory in my installation of R.

2021-08-09 Thread Dirk Eddelbuettel


Rolf,

Sorry for only briefly chiming in, and late, but I don't usually follow
r-help that much these days.

I am writing this from an Ubuntu machine running R as well as RStudio from
pre-made binary .deb packages. R comes via apt from CRAN (using Michael's
binaries), RStudio from them via helper scripts in a package of mine:

  edd@rob:~$ dpkg -l | grep "r-base-core\|rstudio\|rstudio-server" | cut -c-79
  ii  r-base-core4.1.0-1.2104.0 
 
  ii  rstudio2021-07.0.270  
 
  ii  rstudio-server 2021-07.0.270  
 
  edd@rob:~$

Contrary to what you wrote, RStudio *will* use whichever binary it finds
first in the path, just like any other Unix tool.  So when I do

   $ rstudio

I get R 4.1.0 from the binary above, but if I opt into my locally compiled
R-devel via a standard PATH prefix then

   $ PATH=/usr/local/lib/R-devel/bin/:$PATH rstudio

RStudio happily runs with R-devel.

Next, "doc/". This has been in /usr/share/R for probably well over a decade
on these Debian system; almost all other packages on Linux distros also split
between binary ("architecture-specific") directories (such as lib/) and
binary-independent ones (such as share/).

And by the way, in R you can do call R.home() with an argument to see:

   > R.home("doc")
   [1] "/usr/share/R/doc"
   > R.home("library")
   [1] "/usr/lib/R/library"
   > 

Of course, you are free to use whichever R installation and configuration
*you* mind most suitable. It is after all your machine.  But quite a few of
us are happy with these official binaries.

Lastly, and I we may have mentioned this to you before, a dedicated mailing
lists for 'R on Debian + Ubuntu' exists (in r-sig-debian at the usual ETH
server) and you might have gotten useful answers sooner.

Anyway, you are set now, so enjoy R!

Cheers, Dirk

-- 
https://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
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] [OT] Enabled a hook and no longer find which

2021-08-03 Thread Dirk Eddelbuettel via ESS-help


On 3 August 2021 at 09:35, Enrico Schumann wrote:
| More wild guesses:
| 
| - maybe some Emacs minor mode does it? Any
|   configuration for gtags-mode?

I use it (via elpa).

But I grep'ed and an ag'ed at length for anything related.
 
| - do you happen to use an Emacs package named ggtags
|   [https://github.com/leoliu/ggtags]? I think it
|   automatically updates tag files per default (see
|   'ggtags-update-on-save')

This is the winning entry :)  After adding

  ;; 2021-08-03  turn off ggtags-update-on-save
  (setq ggtags-update-on-save nil)

it no longer does this.  *Well done* so after it "wasn't me" but just my
recollection that I may have done this.

Many *many* thanks Enrico. Nice detective work there :)

Dirk

-- 
https://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

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


Re: [ESS] [OT] Enabled a hook and no longer find which

2021-08-02 Thread Dirk Eddelbuettel via ESS-help


On 2 August 2021 at 21:20, Tyler Smith via ESS-help wrote:
| Can you reproduce the problem after starting Emacs via `emacs -Q`? That would 
confirm the problem is not in your Emacs config. Or confirm that it is, if the 
problem isn't reproduced.

Can confirm. With emacs -Q nothing happens to these tag files.

Idem, if I rename /usr/bin/gtags to /usr/bin/gtagsHIDDEN or alike nothing
happens either.  So I have a trigger somewhere...
 
| If it's not in your config it would have to be in a dir-local or file-local 
variable, or completely outside emacs (can you reproduce by editing files in 
another editor?). 

I looked and looked for dir-local or file-local but nothing either.

| If it is in your config, can you post it somewhere?

I'd rather not. It is a bit of sprawling mess. I guess I have to bite the
bullet, eventually, and re-create on, say, the laptop...

Dirk

-- 
https://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

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


Re: [ESS] [OT] Enabled a hook and no longer find which

2021-08-02 Thread Dirk Eddelbuettel via ESS-help


On 2 August 2021 at 17:20, Dirk Eddelbuettel via ESS-help wrote:
| 
| On 2 August 2021 at 23:56, Stephen Berman wrote:
| | Did you also try the more direct alternative of grepping simply for
| | "GPATH", "GTAGS", "GRTAGS"?  Presumably whatever function updates these
| | files has to refer to them, either directly by name or indirectly by a
| | variable or function that in turn refers to them directly or indirectly.
| | So it should be possible to find the update function by inspecting all
| | code that uses these file names (directly or indirectly).
| 
| They are only written by a tool named gtags which is a binary that comes with
| GNU global. I even tried to be craft and 'shadow' /usr/bin/gtags with a
| (name-name) shell script leaving a timestamp in /tmp before calling
| /usr/bin/gtags but that left no traces either.
| 
| But in one of the instrumented repos, as soon as I updated files src/ the
| files GTAGS and GRTAGS.  It works so magically I feel tempted to use the
| trick for other purposes but I no longer know the trick .

Sorry, missed one part of your question here:  so yes, no trace of either
gtags or GPATH or GTAGS or GRTAGS in any of the few .el files in my ~ (and as
an elisp noob I would not write anywhere else).  So still a puzzle.

Dirk

-- 
https://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

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


Re: [ESS] [OT] Enabled a hook and no longer find which

2021-08-02 Thread Dirk Eddelbuettel via ESS-help


On 2 August 2021 at 23:56, Stephen Berman wrote:
| Did you also try the more direct alternative of grepping simply for
| "GPATH", "GTAGS", "GRTAGS"?  Presumably whatever function updates these
| files has to refer to them, either directly by name or indirectly by a
| variable or function that in turn refers to them directly or indirectly.
| So it should be possible to find the update function by inspecting all
| code that uses these file names (directly or indirectly).

They are only written by a tool named gtags which is a binary that comes with
GNU global. I even tried to be craft and 'shadow' /usr/bin/gtags with a
(name-name) shell script leaving a timestamp in /tmp before calling
/usr/bin/gtags but that left no traces either.

But in one of the instrumented repos, as soon as I updated files src/ the
files GTAGS and GRTAGS.  It works so magically I feel tempted to use the
trick for other purposes but I no longer know the trick .

Dirk

-- 
https://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

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


Re: [ESS] [OT] Enabled a hook and no longer find which

2021-07-30 Thread Dirk Eddelbuettel via ESS-help


On 30 July 2021 at 21:32, Andreas Leha via ESS-help wrote:
| wild guess:  file/dir local variable?

I considered that too esp as I see it only in some repos. But no repo-local
file I can see or tell (and I know repo layout / files well enough).

On 30 July 2021 at 17:27, Tyler Smith via ESS-help wrote:
| Maybe check the values of before-save-hook and after-save-hook while
| visiting one of the files this problem applies to? You might find a function
| name you can grep for in your config.  

Yes hooks had come to mind and I tried 'C-h v' and 'C-h f' for a few
variables and functions. Still no smoking gun.

| If it's only in certain directories, check if there is a `.dir-locals.el`
| file in that directory (or one of its parents).

'locate' shows that I have a few .dir-locals.el on my machine but they all
come from different upstreams.


Good suggestions, though.  Thank you both.  Still poking, mostly in the dark.

Dirk

--
https://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

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


[ESS] [OT] Enabled a hook and no longer find which

2021-07-30 Thread Dirk Eddelbuettel via ESS-help


tl;dr: I enabled an action 'on save' and I no longer find where :-/


Longer story: I settled upon GNU global and ggtags at some point for a
(mostly multilingual) system of tags in R and C++ (and some more). So a few
of source directories have these (ugly names) files GPATH, GTAGS, GRTAGS.
And at one point I became too clever by half and somehow enabled updating of
these files for at least some repos. But I no longer remember _how_ I did
that and can, for the life of me, find any trace in my .emacs (and, older
story, .elisp/*el) file(s). It is definitely active in ~/git/rcpp and
~/git/tiledb-r -- which maybe the two repos in work in the most.

This list has been very kind helpful in the past when I puzzled myself with
this one true editor.  I suspect I used an ESS hook somewhere.  How would I
find or debug this?

The net effect seems to be that as soon I save (C-x s) the files GTAGS and
GRTAGS get updated.  Which I otherwise do via a one-line script setting the
proper options (as GNU global at some point in the past needed a patch, I
think that is no longer needed)
gtags --gtagsconf=/home/edd/.globalrc --gtagslabel=pygments --verbose 
--statistics "$@"

I have been half-amused by this for a few weeks but I am approaching "white
flag" territory here on my own workstation: how do I find out how I enabled
this?  I looked into git commit hooks (nope), GNU global config (nope), and,
by looking more closely at the timestamps, have to suspect that is from
Emacs.  But nothing in the Emacs config gives it away. I have a vague memory
that it went via one of the XDG standard directories
(~/.config/share/SOMETHING ?) but no mas.  

Dirk, only moderately amuzed by now

-- 
https://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

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


[ESS] Announcing ‘Introductions to Emacs Speaks Statistics'

2021-04-15 Thread Dirk Eddelbuettel via ESS-help


(This is a text-only, no-links copy of what I just put onto my blog at 
http://dirk.eddelbuettel.com/blog/2021/04/15#announcing_ess_intros
where you find it with links. The key site is https://ess-intro.github.io.)

Announcing ‘Introductions to Emacs Speaks Statistics’

A new website containing introductory videos and slide decks is now available
for your perusal at ess-intro.github.io. It provides a series of
introductions to the excellent Emacs Speaks Statistics (ESS) mode for the
Emacs editor.

This effort started following my little tips, tricks, tools and toys series
of short videos and slide decks “for the command-line and R,
broadly-speaking”. Which I had mentioned to friends curious about Emacs, and
on the ess-help mailing list. And lo and behold, over the fall and winter
sixteen of us came together in one GitHub org and are now proud to present
the initial batch of videos about first steps, installing, using with
spaceemacs, customizing, and org-mode with ESS. More may hopefully fellow,
the group is open and you too can join: see the main repo and its wiki.

This is in fact the initial announcement post, so it is flattering that we
have already received over 350 views, four comments and twenty-one likes.

We hope it proves to be a useful starting point for some of you. The Emacs
editor is quite uniquely powerful, and coupled with ESS makes for a rather
nice environment for programming with data, or analysing, visualising,
exploring, … data. But we are not zealots: there are many editors and
environments under the sun, and most people are perfectly happy with their
choice, which is wonderful. We also like ours, and sometimes someone asks
‘tell me more’ or ‘how do I start’. We hope this series satisifies this
initial curiousity and takes it from here.

With that, my thanks to Frédéric, Alex, Tyler and Greg for the initial batch,
and for everybody else in the org who chipped in with comments and
suggestion. We hope it grows from here, so happy Emacsing with R from us!


For the group,  Dirk


-- 
https://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

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


Re: [R] /usr/local/lib/R/site-library is not writable

2021-04-07 Thread Dirk Eddelbuettel


Hi Gene,

"It's complicated". (Not really, but listen for a sec...)

We need to ship a default policy that makes sense for all / most
situations.  So

- users cannot write into /usr/local/lib/R/site-library -- unless they are
  set up to, but adding them to the 'group' that owns that directory

- root can (but ideally one should not run as root as one generally does not
  now what code you might get slipped in a tar.gz); but root can enable users

- so we recommend letting (some or all) users write there by explicitly
  adding them to an appropriate group.

Personally, I do not think personal libraries are a good idea on shared
machines because you can end up with a different set of package (versions)
than your colleague on the same machine.  And or you running shiny from $HOME
have different packages than shiny running as server. And on and on. Other
people differ, and that is fine. If one wants personal libraries one can.

I must have explained the reasoning and fixes a dozen times each on
r-sig-debian (where you could have asked this too) and StackOverflow. At
least the latter can be searched so look at this set:
https://stackoverflow.com/search?q=user%3Ame+is%3Aanser+%2Fusr%2Flocal%2Flib%2FR%2Fsite-library

Happy to take it offline too, and who knows, we even get to meet for a coffee
one of these days.

Hope this helps, Dirk

-- 
https://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
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] unexpected behavior for Emacs-27.1-1-modified-1 for two MacBooks.

2021-01-27 Thread Dirk Eddelbuettel via ESS-help


On 26 January 2021 at 18:59, Dirk Eddelbuettel via ESS-help wrote:
| 
| On 26 January 2021 at 22:07, Stephen Berman via ESS-help wrote:
| | > I. Both machines report in *Messages*
| | >Package cl is deprecated
| | 
| | The NEWS file in Emacs 27 says:
| | 
| |   ** The 'cl' package is now officially deprecated in favor of 'cl-lib'.
| 
| I know. What I do not know is which of the packages I load tickles this.

This is now solved.

Jeff Mincy was kind enough to email me off-list with the hint about

   (require 'loadhist)
   (file-dependents (feature-file 'cl))

which did not yet "display" a solution leading me to google for 'loadhist
file-depedents' which lead me to

   https://www.emacswiki.org/emacs/LibraryDependencies

where I learned about variable 'load-history.  Which had lots of lines (many
of course with cl-lib) but in particular one pair with

 ("/usr/share/emacs/site-lisp/elpa/ess-18.10.2/julia-mode.elc"
  (require . cl)

and lo and behold that (old) version of julia-mode.el still has a (require
'cl) with a comment that cl-lib could not be used b/c of emacs23.  So I had
edited that and now all is well.

I had of course previously grep'ed by emacs files below ~ and the elpa
directories, but what got me here is that the elpa-* meta packages under
Debian / Ubuntu install under the path above.  I should file a bug with this
fellow named Dirk E. who named looks after the ESS package and get him to
update the Debian package I use on Ubuntu ...

Thanks all for the help. With this I am not fully on Emacs 27.1.

Dirk

-- 
https://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

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


Re: [ESS] unexpected behavior for Emacs-27.1-1-modified-1 for two MacBooks.

2021-01-26 Thread Dirk Eddelbuettel via ESS-help


On 26 January 2021 at 22:07, Stephen Berman via ESS-help wrote:
| > I. Both machines report in *Messages*
| >Package cl is deprecated
| 
| The NEWS file in Emacs 27 says:
| 
|   ** The 'cl' package is now officially deprecated in favor of 'cl-lib'.

I know. What I do not know is which of the packages I load tickles this.
 
Dirk

-- 
https://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

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


Re: [ESS] unexpected behavior for Emacs-27.1-1-modified-1 for two MacBooks.

2021-01-26 Thread Dirk Eddelbuettel via ESS-help


On 26 January 2021 at 18:49, Richard M. Heiberger via ESS-help wrote:
| I. Both machines report in *Messages*
|Package cl is deprecated

I have that too on the 27.1 build I use on Ubuntu (based on the current
Debian source package I rebuilt).

I'd love to get rid of that.

| II. When I search find-dired in
| /Applications.Emacs.app/Contents/Resources/site-lisp with the command
| I have been using for many years
| -name \*.el -exec grep 'cl-' {} ";"

That appears to work for (with a slightly modded search over the Rcpp sources
grepping for 'include' in \*.cpp files).

But that is a poor substitute to what I had been using here many years: M-x ag
from https://github.com/Wilfred/ag.el which I can (very strongly) recommend;
you also need the ag binary from https://github.com/ggreer/the_silver_searcher 
(and I always the Ubuntu packaging for both).


I am otherwise very happy with 27.1.  Rendering and all that feels snappier,
(optional) vterm support is marvelous.  I had issued with the VM mode for
mail but that was a bug and the Debian maintainer kindly fixed it.

Dirk

-- 
https://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

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


Re: [R] seq.Date when date is the last date of the month

2021-01-07 Thread Dirk Eddelbuettel


Jeremie,

As months have irregular number of dates, one needs to use a function that
accounts for that (date libraries and packages have that, one of the earliest
for R was my RcppBDT package using Boost Date_Time), or be otherwise clever.

Here is a one-liner using the latter approach:

   seq(as.Date("2010-02-01"), length=24, by="1 month") - 1

See this old StackOverflow answer where I used this before:

   
https://stackoverflow.com/questions/8333838/generate-a-sequence-of-the-last-day-of-the-month-over-two-years

Dirk

-- 
https://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

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


[ESS] Current Status of [OT] Best Practices Emacs / ESS Mini-Webinars

2021-01-05 Thread Dirk Eddelbuettel via ESS-help


1. There are now fourteen of us in a GitHub organization at
  https://github.com/ess-intro
   with an overall 'top-level' repo
  https://github.com/ess-intro/ess-intro
   Membership defaults to 'private' so unless you're (or a person makes it
   public) in you won't see membership, but it's everybody who had chipped in
   over at collabedit and left a GH handle to indicate the desire to
   join. (And we generally do this in 'visor down' mode: we prefer to have a
   name and repo for a handle not a faceless anonymous entity.)

2. The top-level repo https://github.com/ess-intro/ess-intro has
  - issue tickets (which we should probably use for overall topics,
questions, discussions etc)
  - a wiki with so far two subpages on topics (mostly copied from the old
page) and style; after a snafu every org member should be able to edit
  - the possibility to use GitHub 'projects' etc (which I have never used)

3. It also has three first repos for presentations (with common naming pattern)
  - basic installation of standard emacs
  - spacemacs installation
  - rmarkdown

4. We have a number of other proposals in the topic list and we might want to
   expand to more repos. I am not sure what the best way forward---maybe
   folks should just show initiative and open a repo if there was sufficient
   consensus on a topic idea?

5. The old (and more 'wild west') page at collabedit.com is slowly winding
   down; I have been committing snapshots of it to the ess-intro repo.

6. It would be nice of the 'presentation topic' repos could have not only
   collaborators, but maybe 'reviewers' or 'editors' i.e. if one or two
   people could volunteer to read things over and give feedback.  Opening an
   issue in the repo may be the easiest.

7. It was suggested that I add a page on 'tech' or 'tricks' to detail how I
   recorded videos for the t^4 series I did last spring on shell etc
   tricks. I plan to add a wiki page for that.

That's it so far. Thanks to ess-help for being patient. Let us know when we
become a nuisance; we could always setup a list elsewhere but maybe this can
remain our home for a bit if we promise to keep the volume down :)

Cheers, Dirk



-- 
https://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

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


Re: [ESS] Next steps [OT] Best Practices Emacs / ESS Mini-Webinars

2021-01-02 Thread Dirk Eddelbuettel via ESS-help


Happy New Year to all! Very exciting to see this take shape!

The page at http://collabedit.com/537yq has been serving us really for the
initial discussions and overview but I suggest to move it up a notch:

- create a GitHub organization ess-intro to serve as an umbrella to
  - set up a repository each per presentation / topic / writeup / video
  - allowing us to review / comment / alter / edit each indepedently
  - simple webhosting via GitHub pages which is reliable / free
  - have something more permanent than collabedit.com
  - possibly use the wiki there (and gists and so on)

- assign topic authors and as a suggestion, two reviewers each
  - the email discussion based on Stephen's post is a very good example

- possibly allow for some coherent visuals though that may be tricky
  - we could view "diversity as strength" and end up with a mix of Rmd to
html or pdf, org-mode to either one too and so on as different people
have different preference

- we have the option of putting videos on YouTube! (or elsewhere, and still do
  not know how to create a 'group channel')

- as for overall form, I am still (positively) influenced by the simple videos
  I did under this URL http://dirk.eddelbuettel.com/blog/code/t4/
  - people like videos so 'see' the effect of interaction with the computer
  - slides provide some backing / structure / space for notes and link
  - keeping it *short* is according to many really important

I think I will just go ahead and create that organisation now [Done]. Maybe 
folks
who want to join can add their github 'handle' at the 'who is who' section of
http://collabedit.com/537yq so that invitations can be send.

Ok, live at https://github.com/ess-intro -- let me know via
http://collabedit.com/537yq if you want to join!

Dirk

-- 
https://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

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


Re: [ESS] Next steps [OT] Best Practices Emacs / ESS Mini-Webinars

2020-12-30 Thread Dirk Eddelbuettel via ESS-help


On 30 December 2020 at 17:27, Greg Minshall wrote:
| i've never been involved in a multi-user gitlab/github thing (i'm pretty
| much a loner), so i don't know how collaboration works best.  but, it
| might make sense to start all in the same repo.  in ignorance, maybe
| Dirk would be in charge of creating subdirectories, and delegating
| editing authority to one or more of us for that subdirectory?  (either
| using some git*-provided controls, or by mutual agreement.)

I suggest to bounce the question back to the group as someone a little
involved with a few multi-user / multi-contributor repos:  having an org and
indedependent repos therein may be better.  Also makes it easy for a few of
us to "own" the org and share it.
 
| and, maybe a section at the end of collabedit: name/initials/topic
| volunteering?  i'll start.

Yes please, an excellent suggestion.

Dirk

-- 
https://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

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


Re: [ESS] Next steps [OT] Best Practices Emacs / ESS Mini-Webinars

2020-12-30 Thread Dirk Eddelbuettel via ESS-help


Very nice to see all the energy and interest, so a big thank you to everybody
for chipping in!  The page at

  http://collabedit.com/537yq

is very active. I feel we need now need to take this one level up and pick
actual 'topics' for these 5-minute mini talks, as well as a possible
sequence. I am not quite sure what the best place would be to set that
up. Maybe it is time for a new (free) GitHub "Organization" so that each talk
could be a repo within?  Or maybe we keep it simpler and just create a
overall GitHub repo that will link to the talks?

Thoughts?  I just added a new section at the end:

 ## Next Steps
 
 - GitHub 'organization' to regroup different repos, one each per talk, room 
for experimentation etc
 
 - Or just one GitHub (or GitLab) repo with links to talks repos?
 
 - Other ideas?  Please edit here...
 
Dirk

-- 
https://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

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


Re: [ESS] [OT] Best Practices Emacs / ESS Mini-Webinars

2020-12-28 Thread Dirk Eddelbuettel via ESS-help


Hi Stephen,

On 28 December 2020 at 16:23, Stephen Bond wrote:
| I have been struggling with trying to follow the steps in 
| https://r-pkgs.org/ and the best thing would be to have a similar
| online book showing the steps with ESS. the Hadley book is chained to
| RStudio and they assume everybody uses RStudio, so many examples do not
| work as expected when run inside ESS/emacs. there is also some

Let's step back. Some of us have been building packages for longer than
either the book or RStudio existed. The canonical reference is still WRE.

FWIW I distilled (short) command-line wrappers off it too, so I use
   build.r  # create a tar.gz
   rcc.r# check the tar.gz (using rcmdcheck::rcmdcheck)
   check.r  # check the tar.gz (more like R CMD check)
   install.r# install it
and so on _all the time_ often in a bash shell / tmux session. The command
are also all callable from Emacs/ESS as commands and e.g. I always do
compile-command (i.e. C-x C-c, then calling render.r) to process markdown.
For package building many other people also use devtools; I understand that
is now integrated with ESS and would be new to me too. There are (as always)
many ways to go about this. 

| completely undocumented menus like (Select package for evaluation) not
| mentioned on the official ESS page: 
| https://ess.r-project.org/Manual/ess.html
| I am willing to help and donate time if you can start with such an
| online book.

AFAIK nobody promised a book.  We suggest(ed) and still work on a series of
*short* and *focused* intros to topics. The current list is at
http://collabedit.com/537yq  

Package building is but one topic, but it would be great if you could help
with this.

| Cheers, really happy this may be happening.

Yes. Let's see if we can pull this off.

Dirk

-- 
https://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

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


Re: [ESS] [OT] Best Practices Emacs / ESS Mini-Webinars

2020-12-28 Thread Dirk Eddelbuettel via ESS-help


On 28 December 2020 at 18:48, Greg Minshall wrote:
| i'm a fan.  thanks.  someone already added ESS and orgmode to the
| collwhatever site.  i'd mostly be extracting information, as i'm not an
| expert (but might be able to chip in during a discussion).
| 
| i'd prefer an e-mail list or something else that doesn't require
| real-time observing (i've never used slack).  but, really, whatever
| people come up with.

The use of collabedit.com was a quick shot from the hip. If there is a better
(open, free, ideally without sign-in) hosting site we should switch. If
anybody has suggestions...

We could use a GitHub or GitLab repo instead and edit there (maybe in the
wiki?).  We may need something like issue tickets for topic voting anyway so
if someone wants to charge ahead and open one please go ahead.

Dirk

-- 
https://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

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


Re: [ESS] [OT] Best Practices Emacs / ESS Mini-Webinars

2020-12-28 Thread Dirk Eddelbuettel via ESS-help


On 28 December 2020 at 10:05, Tyler Smith via ESS-help wrote:
| I could reframe my talk as "an overview of Blogdown" to more clearly 
articulate a single goal.

Sorry to be stickler but to keep this focused I would still say no.

_Blogdown per se_ has no relationship with ESS. And I say that as someone who
writes all his pdf or html or ... in RMarkdown, including via Hugo sites.

I am however in favour in showing to use Emacs + ESS + ... your fave here + ...
to create a blog site to overcome the misconception that it only works from
RStudio.  Again, that will work with _any_ one of the various ${FOO}down
packages as you just call `rmarkdown::render()` (or alike) anyway.  So having
alreay put 'R + ESS + Markdown' on the list, maybe we can add '... + blogging'.

Dirk

-- 
https://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

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


Re: [ESS] [OT] Best Practices Emacs / ESS Mini-Webinars

2020-12-28 Thread Dirk Eddelbuettel via ESS-help


On 28 December 2020 at 14:26, Sparapani, Rodney via ESS-help wrote:
| All great ideas.  How about ESS and Roxygen?

Good one, added!

On 28 December 2020 at 09:40, Tyler Smith wrote:
| I'd be happy to demo blogging with Emacs, RMarkdown, Blogdown, Hugo, ESS etc.

Colour me sceptical. That is a *series* of posts each of which will exceed 5
mins. Take a subtopic or two, RMarkdown was already mentioned.


But *great* to see quick responses. To keep it simpler (than a mailing or
what not) I opened a one-off "collaborative editor" (never used this one
before) at

   http://collabedit.com/537yq

Treat it as volatile and disposable and maybe make local copies.  More
content ideas are more than welcome!

Dirk

-- 
https://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

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


[ESS] [OT] Best Practices Emacs / ESS Mini-Webinars

2020-12-28 Thread Dirk Eddelbuettel via ESS-help


A few weeks ago a few of riffed about all the "known unknown" in using ESS
and that teaching each other a few tricks would be cool.  We really should do
this. To kick it off, maybe we should spawn a quick one-off mailing list (I
have used groups.io before) or Slack instance (if someone wants to spawn one)
to discuss.

>From the top of my head I can think of possible topics such as

 - installing ESS (possibly special mention to the bundles by VG for Windows
   and macOS, or KH for social science, or ...) -- no difficulty installing 

 - basic editing, highlighting etc maybe up to easily running multiple
   buffers and renaming them

 - other relevant Emacs tricks ?

 - ESS and RMarkdown happily co-existing and examples / demos

 - package building with ESS (I tend to do it outside myself)

 - debugging with ESS
 
 - other Emacs voodoo like tramp use with ESS ?

 - object browsers

 - your most favourite trick here!

 - your second most favourite trick here too!

I have found that 'one topic' in a few slides and very few minutes works so
we could easily split this across different interest and skills and
environments used and whatever other factor.  Not everybody will know all
topics to gaps are normal -- let's fill them.

Dirk

-- 
https://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

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


Re: [ESS] Running R over tramp

2020-12-19 Thread Dirk Eddelbuettel via ESS-help


On 19 December 2020 at 15:04, Chris Wallace via ESS-help wrote:
| Dear Jeremie,
| 
| short answer:
| - ess version 18.10.3snapshot
| - R version 3.6.1 (2019-07-05) -- "Action of the Toes"
| - local system: Ubuntu 20.04.1 LTS

I use it too, and the R binary I look after for Debian is easily available
via an apt-get'able repo on each CRAN mirror. See the README.html there; many
(many !!) people use this happily.

| - remote system: Scientific Linux release 7.9 (Nitrogen)

If I had to guess, I would maybe suspect issue between ssh (protocol)
versions. To sort that out, try to get hold of a matching distro on the other
side (laptop, Docker, borrow one, ...).

It is ssh that controls the processes. R itself should be fairly unaffected
by how it is called.
 
| long answer (sorry):
| I do not believe this is a problem with ess. It is a long standing
| issue for me that has persisted across multiple versions of emacs, ess,
| R and (local) Ubuntu.  It does not occur when I have run R via tramp on
| other remote systems. I believe it is a problem particular to this
| remote system, and am seeking a workaround.

Yes it is plausible that the ssh versions between Ubuntu and SL are out of
sync.

Dirk
 
| Chris
| 
| 
| 
| On Fri, 2020-12-18 at 22:42 +0100, Jeremie Juste wrote:
| > Hello,
| > 
| > I'm running R over tramp without any issues you described.
| > Could you please specify versions of the ESS package you are using?
| > 
| > 
| > Please, keep it straight to the point and keep in mind that someone
| > is
| > reading your mail trying to help.
| > 
| > Best regards,
| > Jeremie
| > 
| > - ess-version: 18.10.3snapshot [elpa: 20200825.829] 
| > - R version 4.0.3 (2020-10-10) -- "Bunny-Wunnies Freak Out"  
| > - GNU/Linux Debian 10
| > 
| > 
| > On Friday, 18 Dec 2020 at 10:48, Chris Wallace via ESS-help wrote:
| > > Dear ESS-help,
| > > 
| > > it is frankly still magic to me that I can run R over tramp, and
| > > this
| > > is my main mode of working.  When starting a new R session, I open
| > > a .R
| > > file on the remote machine via tramp, and then M-x R. About 20% of
| > > the
| > > time this just works, and I have all the nice ESS help etc.  The
| > > result
| > > of the time, either the R prompt hangs, and I have to C-c C-c out
| > > of
| > > the hang, or the code that is being silently sourced appears at the
| > > prompt (I have pasted an example of this below). After this the
| > > session
| > > still works, but I might not have completion, and help doesn't
| > > work.
| > >  Eg writing ?ls at the prompt gives an error "Error in
| > > .ess.command(.ess.help("ls")) : object 'withVisib' not found".
| > > 
| > > The remote server does have relatively slow IO, and I suspect this
| > > may
| > > be the cause of the issue.
| > > 
| > > My question (finally) is: how can I find out the code that is being
| > > sourced and sent to the remote process, and can I source this code
| > > manually myself to "fix" these cases when it has failed itself?
| > > 
| > > Thanks for a wonderful package,
| > > 
| > > Chris
| > > 
| > > R version 3.6.1 (2019-07-05) -- "Action of the Toes"
| > > Copyright (C) 2019 The R Foundation for Statistical Computing
| > > Platform: x86_64-pc-linux-gnu (64-bit)
| > > 
| > > R is free software and comes with ABSOLUTELY NO WARRANTY.
| > > You are welcome to redistribute it under certain conditions.
| > > Type 'license()' or 'licence()' for distribution details.
| > > 
| > >   Natural language support but running in an English locale
| > > 
| > > R is a collaborative project with many contributors.
| > > Type 'contributors()' for more information and
| > > 'citation()' on how to cite R or R packages in publications.
| > > 
| > > Type 'demo()' for some demos, 'help()' for on-line help, or
| > > 'help.start()' for an HTML browser interface to help.
| > > Type 'q()' to quit R.
| > > 
| > > > Error: unexpected '}' in "}"
| > > > Error: unexpected '}' in "}"
| > > > > . + > Error: unexpected 'else' in:
| > > "
| > > else"
| > > > Error: object 'name' not found
| > > > Error: unexpected '}' in "}"
| > > > Error: object '.ess.' not found
| > > > + + > Error: unexpected symbol in:
| > > "nsenv <- asNamespace(n
| > > stopifnot"
| > > > + > Error in identical(nsenv, .BaseNamespaceEnv) : object 'nsenv'
| > > > not
| > > found
| > > > Error: object 'spr' not found
| > > > > + > Error: unexpected symbol in:
| > > "if (enviro
| > > return"
| > > > Error: unexpected '}' in "}"
| > > > > Error in essenv[[".__ESSENV__."]] <- TRUE : object 'essenv' not
| > > found
| > > > Error: object 'at' not found
| > > > > . + > Error: unexpected symbol in:
| > > "
| > > on.exit"
| > > > + + > Error: unexpected '}' in:
| > > "lockBinding(ns
| > > }"
| > > > > Error: object 'essenv' not found
| > > > Error: unexpected '}' in "}"
| > > > > . + > Error: unexpected symbol in:
| > > ".ess_devtools_functions <- function() {
| > >   if (!requireNamespace("devtools"
| > > > 

[ESS] Emacs27 and options("prompt") interaction ?

2020-11-26 Thread Dirk Eddelbuettel via ESS-help


Following Zeileis and Kleiber in their 'AER' book, I have had

prompt="R> ",   # AER page vii

as an value to options() in .Rprofile for a number of years.

Emacs27 is still not mainstreamed in Debian and Ubuntu, but on one machine I
installed it from PPAs as I was curious about the new rendering engine.
Looks like it behaves well, font rendering is nice -- but the above creates a
'jumpy' cursor that settles if I revert to "> ".

Now, as we all do, I have a lot of other settings in my dot profile that
_could_ be causing this. But has anybody else seen this?

Dirk

-- 
https://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

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


Re: [ESS] Best Practice for building R packages

2020-10-08 Thread Dirk Eddelbuettel via ESS-help


On 8 October 2020 at 13:17, Ahmadou Dicko wrote:
| I do agree with your suggestion. There is much more to ESS than I
| know and it would be great if we could pool our resources to improve
| further. 

On 8 October 2020 at 09:38, Tyler Smith via ESS-help wrote:
| I would also be interested in a webinar.

Three, as they say, is a club -- so let's do this!!

I am currently in a teaching term so a little tied up until year-end but just
before I did about eight weeks with weekly short videos on 'tools, toys, tips
and tricks' (mostly around the command-line). [1]

Emacs is natural follow-up to this but there is _so much_ I wanted to cover
there that I am effectively overwhelmed and hence inactive.  So let's turn
this upsite down and maybe _just_ focus on ESS. Shall we?  We could / should
just start with a wiki and hash out, say, half a dozen high-level topics and
then take turns.  Deal?

Dirk

[1] Blog posts under this tag: https://dirk.eddelbuettel.com/blog/code/t4/
First post was http://dirk.eddelbuettel.com/blog/2020/05/03#000_introducing_t4
and YouTube content is here:  https://www.youtube.com/c/DirkEddelbuettel/videos

-- 
https://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

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


Re: [ESS] Best Practice for building R packages

2020-10-08 Thread Dirk Eddelbuettel via ESS-help


On 8 October 2020 at 13:39, Jeremie Juste via ESS-help wrote:
| Is anyone using ESS to build R packages? Could you share your workflow please?

We all may be a little different here.

ESS now wraps around devtools, but my practices predate devtools.  So I still
build, test, install, ... on the command-line for which I use wrappers (from
my littler package, just updated yesterday) named
  build.r
  check.r
  rcc.r  # a nicer checker around rmdcheck
  roxy.r # run roxygen, I use a 'cached' 6.1.1 version that does not force 
recompile...
  install.r  # plus various install* variants for BioC, or GitHub, or 
binaries...
  kitten.r   # using a wrapper around package.skeleton()
  render.r   # run rmarkdown::render()
  ...
all of which are soft-linked into ~/bin or /usr/local/bin so that
TAB-complete gets to them too.

I use ESS to insert roxygen chunks though. And I regularly render Markdown
from ESS (well, Emacs) via C-x c and (once) replacing 'make -k' with
'render.r filename.Rmd'

It may actually make sense for _all of use_ to maybe pool for two or three
hours and a webinar over Zoom for 'favourite ESS' tricks.  I keep forgetting
how there is -- just yesterday I once again forgot C-c C-e w and looked for
the cheat sheet pdf and there are a bootload of options I never used ...
 
| I read the doc of ESS about using roxygen to document the functions.
| By the way it looks like the link to [1] roxygen is broken and that
| roxygen2 has taken its place.

Yes but that happened maybe a decade ago. Most docs you find online should be
newer, hopefully.

| I initially thought that I could use the workflow of the [2] Roxygen
| manual. 
| 
| [1]:  
| [2]: https://web.archive.org/web/20170324200536/http://roxygen.org/roxygen.pdf
| 
| For convenience I reproduce it here
| hello-roxygen.R-
| #' A package to check Roxygen's sanity
| #' @name helloRoxygen-package
| #' @docType package
| NA
| 
| ---console
| $ package.skeleton('helloRoxygen',
| code_files="hello-roxygen.R",force=TRUE)
| 
| $ roxygen2::roxygenize("helloRoxygen")
| 
| But I get the following warning message :
| Warning: The existing 'helloRoxygen-package.Rd' file was not generated by 
roxygen2, and will not be overwritten.

Delete or renamed, then try again. It should be written and roxygenize should
then be quiet.

Dirk

| And the file helloRoxygen-package.Rd is not updated.
| 
| I'll appreciate any lead on this.
| 
| Best Regards,
| --
| Jeremie Juste
| 
| __
| ESS-help@r-project.org mailing list
| https://stat.ethz.ch/mailman/listinfo/ess-help

-- 
https://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

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


Re: [R] Rstudio does not run on ubuntu 20

2020-06-15 Thread Dirk Eddelbuettel


On 15 June 2020 at 14:46, Luigi Marongiu wrote:
| Hello,
| all of a sudden rstudio stopped working on ubuntu 20.04. I
| re-installed from `rstudio-1.3.959-amd64.deb` but it does not launch
| even if there is an icon. On terminal I got:
| ```
| $ rstudio
| rstudio: error while loading shared libraries: libssl.so.1.0.0: cannot
| open shared object file: No such file or directory
| $ sudo apt-get install libssl1.0.0 libssl-dev
| Reading package lists... Done
| Building dependency tree
| Reading state information... Done
| Package libssl1.0.0 is not available, but is referred to by another package.
| This may mean that the package is missing, has been obsoleted, or
| is only available from another source
| 
| E: Package 'libssl1.0.0' has no installation candidate
| 
| ```
| On internet, it is said that this library was discontinued
| (https://askubuntu.com/questions/897444/libssl-so-1-0-0-is-missing)
| R is up and running instead:
| ```
| $ R
| R version 4.0.1 (2020-06-06) -- "See Things Now"
| Copyright (C) 2020 The R Foundation for Statistical Computing
| Platform: x86_64-pc-linux-gnu (64-bit)
| 
| ```
| How can I launch studio then?

You appear to have asked the wrong part of the internet. If you go to

  packages.ubuntu.com

and search for 'libssl1.0.0', selecting "all" distributions, and "search
package name", you get the page

  
https://packages.ubuntu.com/search?keywords=libssl1.0.0=names=all=all

suggesting downloads of the package from two LTS releases (and two updates
within). Download the file eg

  cd /tmp
  wget 
http://mirrors.kernel.org/ubuntu/pool/main/o/openssl1.0/libssl1.0.0_1.0.2n-1ubuntu5.3_amd64.deb
  sudo dpkg -i libssl1.0.0_1.0.2n-1ubuntu5.3_amd64.deb

Lastly, you asked _on the wrong mailing list_. Questions for R use on Debian
or Ubuntu (or derived) systems should got to r-sig-debian instead. It is a
friendly place.

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
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: [R] solve() function freezes CLI in GNU R 3.6.3

2020-05-09 Thread Dirk Eddelbuettel


On 9 May 2020 at 10:30, Dirk Eddelbuettel wrote:
| 
| We can see that you use Linux.
| 
| Are you by chance
| 
|  - on a Debian or Ubuntu system, and 
|  - have the libopenblas package installed ?
| 
| If so then it is a known bug with the libopenblas0-pthread package.
| 
| Installing libopen0-openmp (and also removing libopenblas0-pthread) should
| fix it.

That was imprecise. It should read "installing libopenblas-openmp-dev" and
removing both "libopenblas-pthread-dev libopenblas0-pthread".

I cannot reproduce the bug on the hardware I have access to (i5, i7, xeon)
though I was able to a few weeks ago. Maybe something changed already...

There was also a brief thread on the debian-science list (within Debian)
starting with https://lists.debian.org/debian-science/2020/04/msg00081.html
and leading to https://lists.debian.org/debian-science/2020/05/msg3.html
(and this cross from April to May)

We would need some more information on hardware to chase this.

Dirk
 
| This is likely CPU dependent. But we need more info. Can you maybe come to the
| r-sig-debian list (subscription needed to reduce spam) and we continue there?
| 
| Dirk
| 
| 
| -- 
| http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org
| 
| __
| 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.

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
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: [R] solve() function freezes CLI in GNU R 3.6.3

2020-05-09 Thread Dirk Eddelbuettel


We can see that you use Linux.

Are you by chance

 - on a Debian or Ubuntu system, and 
 - have the libopenblas package installed ?

If so then it is a known bug with the libopenblas0-pthread package.

Installing libopen0-openmp (and also removing libopenblas0-pthread) should
fix it.

This is likely CPU dependent. But we need more info. Can you maybe come to the
r-sig-debian list (subscription needed to reduce spam) and we continue there?

Dirk


-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
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] R 4.0

2020-04-18 Thread Dirk Eddelbuettel via ESS-help


On 18 April 2020 at 13:57, Martin Maechler via ESS-help wrote:
| But on that most-used (non-)operating system,  lowercase and
| uppercase are mostly equivalent in file names *and* executables
| are file names, no?

No:

  edd@rob:~$ r --version | head -1
  r ('littler') version 0.3.9
  edd@rob:~$ R --version | head -1
  R version 3.6.3 (2020-02-29) -- "Holding the Windsock"
  edd@rob:~$ 

Also, remember that R CMD calls for 25 years into i.e. INSTALL to avoid
/usr/bin/install from GNU?  Same reason.

The only "famous" and very braindead exception is macOS where I recommend
littler users build it as 'lr' because there (and only there) r == R. 

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

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


Re: [ESS] TWITTER API environment variables

2020-04-09 Thread Dirk Eddelbuettel via ESS-help


On 9 April 2020 at 10:32, Ista Zahn via ESS-help wrote:
| Are you sure you've diagnosed the issue correctly? From what I can see
| the name of the environment variable is always TWITTER_PAT, at least
| in the current rtweet release (0.7.0). get_tokens calls twitter_pat
| (https://github.com/ropensci/rtweet/blob/v0.7.0/R/tokens.R#L120) and
| twitter_pat hard-codes TWITTER_PAT
| (https://github.com/ropensci/rtweet/blob/v0.7.0/R/tokens.R#L371). In
| short I don't see anything suggesting that the name of the environment
| variable includes a user name at all.

Seconded. AFAICT ESS does nothing all that special to R (apart from its
little integration bits, but that is orthogonal).

What I have done for years is a part of ~/.Rprofile being conditioned by
  if (interactive()) ...
which R-called-from-ESS runs as it should---and I see it as it also calls
fortunes::fortune() is part of it. More recently within that section I added

if (dir.exists("~/.R/profile.d")) {
files <- list.files("~/.R/profile.d", pattern=".*\\.R$", 
full.names=TRUE)
for (f in files) {
source(f)
}
}

and that is a simple way to set _context-specific_ options and env.vars one
may need for various web services. That allows me to git-commit the .Rprofile
without risking to commit tokens and env vars anywhere public (as profile.d/
gets added to .gitignore).

Lastly, for batch / automated twitter (as done e.g. by my CRANberriesFeed and
CRAN Policy Watch cron jobs) I rely on a very small and simple _external_
command called bti. Served me well during the years when rtweet and its
predecessor "matured".

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

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


Re: [ESS] ESS process on Docker containers and enabing Flymake

2020-02-20 Thread Dirk Eddelbuettel via ESS-help


On 20 February 2020 at 17:51, Alex Branham via ESS-help wrote:
| On Wed 19 Feb 2020 at 18:20, Shreyas Ragavan  wrote:
| 
| >> You need to install the lintr package.
| >
| > So ESS actually needs the R package lintr installed to enable linting.
| > It seems strange to me that I have to open R and install a package to
| > get an 'IDE' functionality. Perhaps I am mistaken in my thinking.
| 
| This is pretty standard behavior, I think. You'll find the same thing
| with Rstudio, IIRC.

There are many shades of grey possible between pitch black and white.

One could just use the package if found installed. Demanding it to be present
is quite a bit more strict, and I don't think I'd that.  But hey, your
project, not mine.

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

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


Re: [ESS] Prevent new buffer for help from point

2020-02-10 Thread Dirk Eddelbuettel via ESS-help


On 10 February 2020 at 17:10, Alex Branham wrote:
| I think the auto-complete package is no longer developed. I think most
| people who use that functionality switched to company, FWIW.

Yes, I tend to mark the date when I added something to my .emacs file, and
sometimes also a source link -- but didn't here for auto-complete. And I do
run company as well.

Also,   C-u -1 M-x global-auto-complete-mode RET   turns it off everywhere in
the running Emacs. I tend to use daemon mode and long running session so this
was preferable over restarting.

Thanks everybody for the help.

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

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


Re: [ESS] Prevent new buffer for help from point

2020-02-10 Thread Dirk Eddelbuettel via ESS-help


On 10 February 2020 at 15:47, Dirk Eddelbuettel wrote:
| 
| Hi Julian and Pavel,
| 
| On 10 February 2020 at 10:55, Julian M. Burgos wrote:
| | I am having the same issue.  Could you figure out what was causing this 
behaviour?  It is driving me crazy.
| 
| Ah, good news in the sense that it is not just me, and yes, it is annoying as 
hell.
| 
| I have not had time to decompose my ~/.emacs (and the other files it sources)
| so no news from here -- sorry.
| 
| On 10 February 2020 at 19:37, Panko, Pavel wrote:
| | I had the same problem some months back; I switched from auto-complete to 
company-mode, and the problem stopped. Would be interested in a more 
full-fledged solution to this though.
| 
| Hm. Very interesting.  I seem to have Auto-Complete (per C-h m) as well as
| Company.  I will give that shot and report back.

Commenting out these lines

  ;; auto-complete -- uses Ubuntu package 'auto-complete-el'
  ;; edd 2020-02-10 possible interaction with ESS
  ;(require 'auto-complete-config)
  ;(ac-config-default)

and launching a fresh Emacs, I do *not* see the bad behavior. This is a very
promising lead--thanks again Pavel!

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

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


Re: [ESS] Prevent new buffer for help from point

2020-02-10 Thread Dirk Eddelbuettel via ESS-help


Hi Julian and Pavel,

On 10 February 2020 at 10:55, Julian M. Burgos wrote:
| I am having the same issue.  Could you figure out what was causing this 
behaviour?  It is driving me crazy.

Ah, good news in the sense that it is not just me, and yes, it is annoying as 
hell.

I have not had time to decompose my ~/.emacs (and the other files it sources)
so no news from here -- sorry.

On 10 February 2020 at 19:37, Panko, Pavel wrote:
| I had the same problem some months back; I switched from auto-complete to 
company-mode, and the problem stopped. Would be interested in a more 
full-fledged solution to this though.

Hm. Very interesting.  I seem to have Auto-Complete (per C-h m) as well as
Company.  I will give that shot and report back.

Thanks,  Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

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


Re: [ESS] Prevent new buffer for help from point

2020-02-07 Thread Dirk Eddelbuettel via ESS-help


On 7 February 2020 at 09:06, Alex Branham wrote:
| Can you reproduce this without your .emacs file?

But ESS would not be turned on without it.
 
| Does that buffer's name match any entry in display-buffer-alist or all the
| similar variables?

The buffer my focus is stolen from is any off buffer in R mode, call it R/foo.R

The buffer the focus is moved is called *ess-command-output*

Per C-h v, the value of display-buffer-alist is nil.

Dirk

| On Fri, Feb 7, 2020, 3:39 AM Dirk Eddelbuettel via ESS-help <
| ess-help@r-project.org> wrote:
| 
| >
| > On 6 February 2020 at 10:19, James W. MacDonald wrote:
| > | It's not clear from your question exactly what the behaviour is, but it
| > | sounds like auto complete?
| >
| > No, I like autocomplete.
| >
| > As I wrote in what is still below, I have irony-mode and other helpers.
| > But what is annoying as hell is that ESS decided to
| >   - move focus away from where I am (writing R code)
| >   - move to a completely new buffer (showing help I did not ask for)
| >   - require me to kill the new buffer to get back to where I was
| > which happens *each and every time* I type a token it knows and could
| > complete to a help page it then takes me to.
| >
| > Anyone have an idea what I need to turn on to suppress this?
| >
| > Dirk
| >
| > | On Thu, Feb 6, 2020 at 2:15 AM Dirk Eddelbuettel via ESS-help <
| > | ess-help@r-project.org> wrote:
| > |
| > | >
| > | > When I have e.g. a local variable arr (for array) and start typing
| > | >
| > | >   print(arr
| > | >
| > | > in an ESS buffer, I first (briefly) get a helpful and uninstrusive
| > dropdown
| > | > starting with arrows, array and more.
| > | >
| > | > But annoyingly, a split second later it flips to a new help buffer
| > | > (entitled
| > | > *ess-command-output*) which the help text for arrows. I absolutely do
| > not
| > | > want that.  I have been unable to turn it off though.
| > | >
| > | > I am running the last release, and I have a somewhat muddled .emacs
| > also
| > | > enabled irony and a few more modes helpful for programming in different
| > | > languages, but this behaviour seems to be ESS specific. How do I stop
| > it?
| > | >
| > | > Sorry to be asking such a noob question after what must now be a
| > quarter
| > | > century of Emacs, R and ESS...
| > | >
| > | > Dirk
| > | >
| > | > --
| > | > http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org
| > | >
| > | > __
| > | > ESS-help@r-project.org mailing list
| > | > https://stat.ethz.ch/mailman/listinfo/ess-help
| > | >
| > |
| > |
| > | --
| > | James W. MacDonald, M.S.
| > | Biostatistician
| > | University of Washington
| > | Environmental and Occupational Health Sciences
| > | 4225 Roosevelt Way NE, # 100
| > | Seattle WA 98105-6099
| >
| > --
| > http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org
| >
| > __
| > ESS-help@r-project.org mailing list
| > https://stat.ethz.ch/mailman/listinfo/ess-help
| >

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

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


Re: [ESS] Prevent new buffer for help from point

2020-02-07 Thread Dirk Eddelbuettel via ESS-help


On 6 February 2020 at 10:19, James W. MacDonald wrote:
| It's not clear from your question exactly what the behaviour is, but it
| sounds like auto complete?

No, I like autocomplete.

As I wrote in what is still below, I have irony-mode and other helpers.
But what is annoying as hell is that ESS decided to
  - move focus away from where I am (writing R code)
  - move to a completely new buffer (showing help I did not ask for)
  - require me to kill the new buffer to get back to where I was
which happens *each and every time* I type a token it knows and could
complete to a help page it then takes me to.

Anyone have an idea what I need to turn on to suppress this?

Dirk
 
| On Thu, Feb 6, 2020 at 2:15 AM Dirk Eddelbuettel via ESS-help <
| ess-help@r-project.org> wrote:
| 
| >
| > When I have e.g. a local variable arr (for array) and start typing
| >
| >   print(arr
| >
| > in an ESS buffer, I first (briefly) get a helpful and uninstrusive dropdown
| > starting with arrows, array and more.
| >
| > But annoyingly, a split second later it flips to a new help buffer
| > (entitled
| > *ess-command-output*) which the help text for arrows. I absolutely do not
| > want that.  I have been unable to turn it off though.
| >
| > I am running the last release, and I have a somewhat muddled .emacs also
| > enabled irony and a few more modes helpful for programming in different
| > languages, but this behaviour seems to be ESS specific. How do I stop it?
| >
| > Sorry to be asking such a noob question after what must now be a quarter
| > century of Emacs, R and ESS...
| >
| > Dirk
| >
| > --
| > http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org
| >
| > __
| > ESS-help@r-project.org mailing list
| > https://stat.ethz.ch/mailman/listinfo/ess-help
| >
| 
| 
| -- 
| James W. MacDonald, M.S.
| Biostatistician
| University of Washington
| Environmental and Occupational Health Sciences
| 4225 Roosevelt Way NE, # 100
| Seattle WA 98105-6099

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

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


Re: [R] Identifying presence of Java

2019-11-09 Thread Dirk Eddelbuettel


Dennis,

On 9 November 2019 at 10:53, Dennis Fisher wrote:
| Dirk
| 
| I am now more confused (and I appreciate your help in sorting this out).  
| 
| I executed
|   require(“rJava”)
| and received the following error:
| 
| > Error: package or namespace load failed for ‘rJava’:
| >  .onLoad failed in loadNamespace() for 'rJava', details:
| >   call: dyn.load(file, DLLpath = DLLpath, ...)
| >   error: unable to load shared object 
'/Library/Frameworks/R.framework/Versions/3.6/Resources/library/rJava/libs/rJava.so':
| >   
dlopen(/Library/Frameworks/R.framework/Versions/3.6/Resources/library/rJava/libs/rJava.so,
 6): Library not loaded: 
/Library/Java/JavaVirtualMachines/jdk-11.0.1.jdk/Contents/Home/lib/server/libjvm.dylib
| >   Referenced from: 
/Library/Frameworks/R.framework/Versions/3.6/Resources/library/rJava/libs/rJava.so
| >   Reason: image not found
| > 
| Java is definitely installed on this machine — from a terminal:
|   PET513> Java -version
|   java version "13.0.1" 2019-10-15
|   Java(TM) SE Runtime Environment (build 13.0.1+9)
|   Java HotSpot(TM) 64-Bit Server VM (build 13.0.1+9, mixed mode, sharing)
| 
| It appears that the problem relates to version # — I have 13.03.1 installed 
whereas R is looking for 11.0.1
| 
| Any idea how to fix this?

I have seen this happen when the Java settings changed from a different
version which can happen.  The common fix is to

   R CMD javareconf

to updated R's settings about Java. (This step also happens when you rebuild
R; but rebuilding R is typically not required; we just want updated Java
settings).

If that is done, and your Java installation is otherwise sufficient then

   R CMD INSTALL rJava_*tar.gz

(or equally from within R)  should do the trick.

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
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: [R] Identifying presence of Java

2019-11-09 Thread Dirk Eddelbuettel


Dennis,

R does that for you already as it needs to know it for rJava too.

On my (Linux) box:

  edd@rob:~$ R CMD config JAVA
  /usr/lib/jvm/default-java/bin/java
  edd@rob:~$ R CMD config JAVA_HOME
  /usr/lib/jvm/default-java
  edd@rob:~$ 

You could also do the equivalent of `which` or `type -p` from R:

  R> Sys.which("javac")
 javac 
  "/usr/bin/javac" 
  R> Sys.which("javacdoesnotexist")
  javacdoesnotexist 
   "" 
  R> 

Hope this helps, Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
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: [R] Installing dyplr on Linux requires a ton of chasing down dependencies

2019-10-14 Thread Dirk Eddelbuettel


Adam,

You may find this blog post and the video instructive:

  http://dirk.eddelbuettel.com/blog/2019/06/09#022_rocker_and_ppas

It illustrates how 'installing tidyverse' (or rstan) can be a single and done
in under two minutes == on Linux, with the appropriate distribution and
settings.  In short:  some have binaries prebuilt, some don't.

My blog has a few post in the 'r4' section on that as well as on other
approaches to this.

  http://dirk.eddelbuettel.com/blog/code/r4/

Now, you choose a somewhat non-standard distro. The price of that choice may
indeed be that you have to install everything (R/CRAN-related) from source. 

Hope this helps, Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
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: [R] g++ error causes non-zero exit status for package installation

2019-01-05 Thread Dirk Eddelbuettel


On 5 January 2019 at 13:13, Henrik Bengtsson wrote:
| On Sat, Jan 5, 2019 at 9:41 AM Dirk Eddelbuettel  wrote:
| >
| >
| > On 5 January 2019 at 09:14, William Dunlap via R-help wrote:
| > | You would get these errors ("R: file or directory not found, version: file
| > | or directory not found...") if you had a ~/.Rprofile file containing the
| > | line 'cat(version$version.string, sep="\n").
| >
| > Well spotted -- very much so. That is bound to break use within src/Makevars
| > and alike. If you must do something in ~/.Rprofile either make it silent, or
| > make it conditional based on if (interactive()) { ...that_code_here... }
| 
| Interesting problem.  One way to workaround this startup issue with:
| 
|   PKG_LIBS = `$(R_HOME)/bin/Rscript -e "Rcpp:::LdFlags()"`
| 
| used by minqa:src/Makevars
| 
(https://r-forge.r-project.org/scm/viewvc.php/pkg/minqa/src/Makevars?view=markup=optimizer),

Nothing like 'Read the source, Luke!' :)

The *real* problem here is that command has been *obsolete* since early 2014
or for almost five years -- Rcpp does NOT require linking!

Hence the command is a null-op now, provided for backwards-compatibility:

 R> Rcpp:::LdFlags()
 R> 

Then again minqa has not been updated since 2014 either so there...

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
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: [R] g++ error causes non-zero exit status for package installation

2019-01-05 Thread Dirk Eddelbuettel


On 5 January 2019 at 20:40, Winfried Moser wrote:
| dirk & bill, you guys are incredible! the non-silent .Rprofile was the
| problem!
| making the code interactive didn't help either, only silenceing it helped!

Good to know you have it fixed.
 
| thanks so much! i assume moving to r-sig-debian is now obsolete.
| 
| ps, @dirk: adding michael rutters ppa also helped, but the packages get
| installed to R_LIBS_SITE, and not (as i am used to) to R_LIBS-USER.
| but this was only a minor inconvinience (i like to keep the packages in one
| directory).

No, it is even more fine grained:

 - r-cran-* packages always install in /usr/lib/R/site-library

 - (One exception: Base R and recommended packages go to /usr/lib/R/library )

 - local "from source" installation goes by default to 
/usr/local/lib/R/site-library
   
and the third part is much better for multi-user setting.  See the comments
in the file /etc/R/Renviron.site if you want to change this.

This has been our default since about 2003 or 2004 when Kurt Hornik and Fritz
Leisch convinced me of that approach in a Vienna bar. It is better.

And this discussion too belonged on r-sig-debian so let's stop here.

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
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: [R] g++ error causes non-zero exit status for package installation

2019-01-05 Thread Dirk Eddelbuettel


On 5 January 2019 at 09:14, William Dunlap via R-help wrote:
| You would get these errors ("R: file or directory not found, version: file
| or directory not found...") if you had a ~/.Rprofile file containing the
| line 'cat(version$version.string, sep="\n").

Well spotted -- very much so. That is bound to break use within src/Makevars
and alike. If you must do something in ~/.Rprofile either make it silent, or
make it conditional based on if (interactive()) { ...that_code_here... }

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
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: [R] g++ error causes non-zero exit status for package installation

2019-01-05 Thread Dirk Eddelbuettel


On 4 January 2019 at 23:23, Winfried Moser wrote:
| dear community,
| 
| i get a *non-zero exit status* installing the survey-package in R version
| 3.5.2 on ubuntu 18.04. the problem seems to be related to *g++* and/or the
| package *minqa*. in the output of the installation procedure i found the
| following g++ related lines:
| 
| g++ -I"/usr/share/R/include" -DNDEBUG -I"/home/winfried/rlibs/Rcpp/include"
| -f
| [...]
| g++ -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o
| minqa.so altm
| [...]
| g++: error: R: Datei oder Verzeichnis nicht gefunden
| g++: error: version: Datei oder Verzeichnis nicht gefunden
| g++: error: 3.5.2: Datei oder Verzeichnis nicht gefunden
| g++: error: (2018-12-20): Datei oder Verzeichnis nicht gefunden
| 
| can someone help or point me in a direction? several packages, that i use
| frequently, are conserned (survey, lme4, effects)

Wrong mailing list. Please subscribe to r-sig-debian and post there.

Someone posted a similar looking error recently (in a GitHub issue I can't
find now) but we did not solve it.  Somehow the call goes funky meaning that
the values in /etc/R/Makeconf got altted or affected or corrupted. No idea
why -- thousands of people use R on Ubuntu daily, myself included.

The good new is that you can (and maybe should !) consider prebuilt
binaries. These packages are all in Ubuntu as r-cran-survey, r-cran-lme4,
r-cran-effects -- and the Rutter PPAs give you even newer version. Read the
first four paragraphs, and particularly the fourth, of

   https://cloud.r-project.org/bin/linux/ubuntu/README.html

and enjoy the availability of 4000+ r-cran-* binary packages.

I am still interested in understanding the bug report but please bring it to
r-sig-debian.

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
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: [R] Failed to install RQuantLib in Ubuntu machine

2019-01-05 Thread Dirk Eddelbuettel


On 3 January 2019 at 03:16, Christofer Bogaso wrote:
| I was trying to install RQuantLib in my Ubuntu machine which failed with
| below information :

Try this on the shell instead:

sudo apt-get install r-cran-rquantlib

Otherwise maybe rebuild Rcpp from inside R, or also install it from source,
or  You have a linking error which can happen when the C++ libraries
change.  Maybe you have an older Rcpp binary package.  We can't tell from
what you posted.  In any event, easiest to use a binary as I suggest here.

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
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: [R] CRAN updates

2019-01-05 Thread Dirk Eddelbuettel


On 5 January 2019 at 05:46, Rich Shepard wrote:
|Is there a file where I can specify the repository to use when upgrading
| packages rather than having R ask each time?

Many ways. You want to set options(repos) -- see eg help(download.packages)
and see help(Startup) for the many ways where you can do that.

The Debian packages do it for you as the question is i) silly and ii) we now
a globally valid and "best" (as in: fast, local network mirror) solution. You
can add these six lines to Rprofile.site (as Debian does) or your ~/.Rprofile
or ...

  ## We set the cloud mirror, which is 'network-close' to everybody, as default
  local({
  r <- getOption("repos")
  r["CRAN"] <- "https://cloud.r-project.org;
  options(repos = r)
  })

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
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: [R] R shared library (/usr/lib64/R/lib/libR.so) not found.

2018-08-25 Thread Dirk Eddelbuettel


Rolf,

I noticed this thread started by you as well as a few of the excellent
follow-ups. While it conclcuded, allow me a few quick comments:

 - Some of us go through some effort to provide R on Ubuntu (and Debian) in a
   reliable and reproducible manner. And it works and is used by many people.

 - The basic r-base (and r-base-core etc) packages work in the distribution,
   but may be older as the distribution is taken as snapshots in time.  Hence
   the Ubuntu mirror via CRAN. That way you get a choice between eg R 3.4.4
   (not that old) and R 3.5.1. (brand new) in the current Ubuntu 18.04.

 - The (short) instructions at CRAN work: add a repo, install from it.
   Neither they nor the longer (more recent) blog post you found (which says
   the same, with more pictures) suggest to link or move libraries around.

 - We even have "proof" in the sense of fully automated build and use
   systems. Docker is just one example.  Eg this Dockerfile build the r-base
   container available as rocker/r-base (as well as the official r-base)
  https://github.com/rocker-org/rocker/blob/master/r-base/Dockerfile
   and eg this one use it and builds on top to generated an RStudio container
  
https://github.com/rocker-org/rocker/blob/master/rstudio/testing/Dockerfile 
   Nowhere in either of these "recipes" are library files moved, renamed, or
   otherwise altered.

 - Nobody ever suggested for _any_ Linux distribution to mix its files below
   /usr with your own compilation.  There lies madness, and it may be the
   root cause of the behaviour local to your machine.  Don't do it.

 - Please consider asking Debian and Ubuntu related questions on r-sig-debian.  

Regards, Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
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: [R] Interpret List Label as Date from Quantmod getOptionChain

2018-03-04 Thread Dirk Eddelbuettel

On 5 March 2018 at 03:13, Sparks, John wrote:
| library(quantmod)
| #in fairness, I did not include this last time and my example was therefore 
not reproducible.  Apologies to Bert and everyone else #for not following the 
posting guidelines.
| aapl_total<-getOptionChain("AAPL", NULL)>
| 
| How could I then get the subset of the entire list which only has expiry 
dates in 2019, or more specifically, in Mar or Apr or May of 2019?

Here you go:

R> aapl_total<-getOptionChain("AAPL", NULL) # your query
R> names(aapl_total)# the list element names
 [1] "Mar.09.2018" "Mar.23.2018" "Mar.29.2018" "Apr.06.2018" "Apr.13.2018" 
"Apr.20.2018" "May.18.2018"
 [8] "Jun.15.2018" "Aug.17.2018" "Sep.21.2018" "Oct.19.2018" "Nov.16.2018" 
"Jan.18.2019" "Jun.21.2019"
[15] "Jan.17.2020" "Jun.19.2020"
R> library(anytime)# one of many tools to parse dates, this one is easiest 
in my biased view
R> anydate(names(aapl_total))
 [1] "2018-03-09" "2018-03-23" "2018-03-29" "2018-04-06" "2018-04-13" 
"2018-04-20" "2018-05-18"
 [8] "2018-06-15" "2018-08-17" "2018-09-21" "2018-10-19" "2018-11-16" 
"2019-01-18" "2019-06-21"
[15] "2020-01-17" "2020-06-19"
R> dvec <- anydate(names(aapl_total))   # helper variable
R> ind <- dvec >= anydate("2018-04-01") & dvec <= anydate("2018-04-30") # 
one example
R> ind
 [1] FALSE FALSE FALSE  TRUE  TRUE  TRUE FALSE FALSE FALSE FALSE FALSE FALSE 
FALSE FALSE FALSE FALSE
R> str(aapl_total[ind]) # index return object by 
desired dates
List of 3
 $ Apr.06.2018:List of 2
  ..$ calls:'data.frame':   24 obs. of  7 variables:
  .. ..$ Strike: num [1:24] 145 150 152 155 158 ...
  .. ..$ Last  : num [1:24] 30.4 24 27.1 20.9 22.1 ...
  .. ..$ Chg   : num [1:24] -3.12 0 0 -2.87 0 ...
  .. ..$ Bid   : num [1:24] 31.4 26.6 24.1 21.8 21.9 ...
  .. ..$ Ask   : num [1:24] 31.9 27.1 24.7 22.3 22.5 ...
  .. ..$ Vol   : int [1:24] 2 1 50 2 216 51 50 55 33 109 ...
  .. ..$ OI: int [1:24] 30 1 50 2 0 32 57 101 136 297 ...
  ..$ puts :'data.frame':   21 obs. of  7 variables:
  .. ..$ Strike: num [1:21] 145 147 148 149 150 ...
  .. ..$ Last  : num [1:21] 0.27 0.14 0.17 0.18 0.36 0.49 0.68 0.81 0.96 1.17 
...
  .. ..$ Chg   : num [1:21] 0.13 0 -0.08 0 -0.07 ...
  .. ..$ Bid   : num [1:21] 0.14 0.18 0.13 0.23 0.27 0.35 0.46 0.61 0.81 1.06 
...
  .. ..$ Ask   : num [1:21] 0.24 0.28 0.21 0.35 0.36 0.45 0.56 0.71 0.9 1.17 ...
  .. ..$ Vol   : int [1:21] 12 1 1 3 86 15 31 74 39 213 ...
  .. ..$ OI: int [1:21] 97 1 2 14 177 395 160 368 271 211 ...
 $ Apr.13.2018:List of 2
  ..$ calls:'data.frame':   19 obs. of  7 variables:
  .. ..$ Strike: num [1:19] 155 160 162 165 168 ...
  .. ..$ Last  : num [1:19] 21.2 16.9 14.9 13.1 10.7 ...
  .. ..$ Chg   : int [1:19] 0 0 0 0 0 0 0 0 0 0 ...
  .. ..$ Bid   : num [1:19] 21.6 17.3 15.2 13.3 11.3 ...
  .. ..$ Ask   : num [1:19] 22.9 17.9 15.7 13.6 11.5 ...
  .. ..$ Vol   : int [1:19] 20 1 7 44 46 22 62 313 71 327 ...
  .. ..$ OI: int [1:19] 20 20 6 11 11 0 153 156 19 54 ...
  ..$ puts :'data.frame':   18 obs. of  7 variables:
  .. ..$ Strike: num [1:18] 145 148 149 150 152 ...
  .. ..$ Last  : num [1:18] 0.38 0.48 0.56 0.56 0.69 0.87 1.04 1.05 1.34 1.75 
...
  .. ..$ Chg   : int [1:18] 0 0 0 0 0 0 0 0 0 0 ...
  .. ..$ Bid   : num [1:18] 0.06 0.19 0.22 0.28 0.42 0.54 0.73 0.98 1.28 1.64 
...
  .. ..$ Ask   : num [1:18] 0.6 0.42 0.45 0.47 0.58 0.72 0.9 1.13 1.44 1.8 ...
  .. ..$ Vol   : int [1:18] 25 103 1 50 64 74 24 47 100 324 ...
  .. ..$ OI: int [1:18] 0 6 0 0 7 10 11 19 56 19 ...
 $ Apr.20.2018:List of 2
  ..$ calls:'data.frame':   60 obs. of  7 variables:
  .. ..$ Strike: num [1:60] 2.5 5 7.5 10 12.5 17.5 22.5 40 50 55 ...
  .. ..$ Last  : num [1:60] 171 173 171 158 163 ...
  .. ..$ Chg   : num [1:60] -1 0 0 0 -3.6 ...
  .. ..$ Bid   : num [1:60] 166 166 163 148 164 ...
  .. ..$ Ask   : num [1:60] 168 167 165 152 164 ...
  .. ..$ Vol   : int [1:60] 5 10 10 10 1 10 5 4 300 10 ...
  .. ..$ OI: int [1:60] 5 15 10 5 1 10 5 0 0 0 ...
  ..$ puts :'data.frame':   48 obs. of  7 variables:
  .. ..$ Strike: num [1:48] 2.5 50 55 60 65 70 75 80 85 90 ...
  .. ..$ Last  : num [1:48] 0.01 0.01 0.01 0.02 0.02 0.01 0.01 0.02 0.07 0.02 
...
  .. ..$ Chg   : num [1:48] 0 0 -0.01 0 -0.01 -0.02 0 0 0 0 ...
  .. ..$ Bid   : num [1:48] 0 0 0 0 0 0 0 0 0 0 ...
  .. ..$ Ask   : num [1:48] 0.02 0.02 0.02 0.03 0.07 0.02 0.02 0.03 0.04 0.04 
...
  .. ..$ Vol   : int [1:48] 1 2 1 212 2 5 3 32 385 11 ...
  .. ..$ OI: int [1:48] 1 0 1 212 621 473 3529 362 1823 1164 ...
R> 

You probably want such questions on the r-sig-finance list.

Cheers from across town,  Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
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, 

Re: [R] Interpret List Label as Date from Quantmod getOptionChain

2018-03-04 Thread Dirk Eddelbuettel

On 5 March 2018 at 02:46, Sparks, John wrote:
| I agree that they look like dates, I don't know how to determine if they are 
actually dates.

You know options but you are confused about maturity dates, i.e. expiry?

In information in that list (ie along the date dimension) is the expiry; at
each date you have another list for both puts and calls, and inside each of
those a grid given by the active strikes (ie where bids/asks/trades happen).

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
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: [R] Rcpp, dyn.load and C++ problems

2017-12-03 Thread Dirk Eddelbuettel

On 3 December 2017 at 20:30, Martin Møller Skarbiniks Pedersen wrote:
| On 3 December 2017 at 20:19, Dirk Eddelbuettel <e...@debian.org> wrote:
|   Thanks for your answers. I got a few more questions.
| 
| >
| > 0) Wrong list. Rcpp has its down, rcpp-devel, and I basically do not read
| > this and would have missed this were it not for luck.
| 
| OK. I did found the rcpp-devel mailing-list.
| But I though it was a developers of the rcpp-package.
| So it is ok to post beginners questions to rcpp-devel?

Very much so. Just peruse the archive. We have a non-public and very quiet
list Rcpp-core for development of Rcpp -- as opposed 'developing with Rcpp'.

| Basically I was searching for ways to compile to C++ code a single time and
| not everything the R code runs.

A package does that for you. Just how Rcpp itself contains compiled code. Or
any of the ~ 1250 packages on CRAN. Each compiled once, running as often as
you want thereafter.
 
On 3 December 2017 at 20:42, Martin Møller Skarbiniks Pedersen wrote:
| >
| > > edd@bud:~$ r -lRcpp -e'sourceCpp("/tmp/mmsp.cpp")'
| 
| 
| ???
| 
| What is r in this case ? A alias for something ?

Littler, another (CRAN) package of mine. I explained that a few lines
lower. If it still confuses you imagine you saw

$ Rscript -e 'Rcpp::sourceCpp("/tmp/mmsp.cpp")'

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
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: [R] Rcpp, dyn.load and C++ problems

2017-12-03 Thread Dirk Eddelbuettel

On 3 December 2017 at 11:08, Peter Langfelder wrote:
| I would go to the source, in this case Dirk Eddelbuettel's (I hope I
| spelled it correctly)

You did. Take a point :)

| documentation for Rcpp:
| 
| http://dirk.eddelbuettel.com/code/rcpp/Rcpp-attributes.pdf

Yup.  And

RShowDoc("Rcpp-attributes", package="Rcpp")

in R is even easier.

On 3 December 2017 at 13:19, Dirk Eddelbuettel wrote:
| 0) Wrong list. Rcpp has its down, rcpp-devel, and I basically do not read
| this and would have missed this were it not for luck.

"R has its own list, rcpp-devel" is what I meant to write.  For completeness,
we can also test on the command-line as Martin and what I do a lot myself:

edd@bud:~$ r -lRcpp -e'sourceCpp("/tmp/mmsp.cpp")'

R> res <- compute_values_cpp()

R> str(res)

Attaching package: ‘utils’

The following objects are masked from ‘package:Rcpp’:

.DollarNames, prompt

List of 2
 $ x: num [1:10] 199 362 118 302 262 ...
 $ y: num [1:10] 20 40 14.3 39.5 36.9 ...
You have mail in /var/mail/edd
edd@bud:~$


That uses littler which I like, Rscript is almost the same (but has no -l
switch for libraries and fails to load the methods package which we sometimes
need).

Dirk


-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
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: [R] Rcpp, dyn.load and C++ problems

2017-12-03 Thread Dirk Eddelbuettel

Martin,

You are making your life way too complicated.

There are a number of things I would do differently:

0) Wrong list. Rcpp has its down, rcpp-devel, and I basically do not read
this and would have missed this were it not for luck.

On 3 December 2017 at 02:06, Martin Møller Skarbiniks Pedersen wrote:
|   I have read some web-pages about Rcpp and C++ but it is a bit confusion
| for me.

1) Keep reading.

| And I compile it like this:
| PKG_CXXFLAGS=$(Rscript -e 'Rcpp:::CxxFlags()') \
| PKG_LIBS=$(Rscript -e 'Rcpp:::LdFlags()')  \
| R CMD SHLIB logistic_map.cpp
| without problems and I get a logistic_map.so file as expected.

2) Possible but too complicated. Read on.
 
| However in R:
| R> dyn.load("logistic_map.so")

3) You never ever need that with Rcpp and its tool, unless you insist on
redoing thing by hand in which case you _must_ use SEXP .Call(SEXP a, ...)

| Please advise,
|   What piece of the puzzle is missing?

4) Keep reading. I will pivot to you other mails. Solution below.

On 3 December 2017 at 20:00, Martin Møller Skarbiniks Pedersen wrote:
| Hi,
|   It is still not working.
|   $ ./compile.sh

5) Still wrong.

On 3 December 2017 at 20:04, Martin Møller Skarbiniks Pedersen wrote:
| Thanks. However search for "Rcpp calling C++ functions from R" gives a lot
| of result but I think
| some of them are outdated and others don't agree with each other.
| 
| Can you point to a specific good on-line guide for me?

6) Call me crazy but maybe the nine vignettes included with the package?

In essence you _complitely_ missed what Rcpp Attributes does and shows, as
does the (newer) Rcpp Introduction vignette.

More crazy, your file was actually 100% correct. I just added three lines to
_also_ execute R code (and I indented just for clarity)

/*** R
res <- compute_values_cpp()
str(res)
*/

Then in R:

R> library(Rcpp)
R> sourceCpp("/tmp/mmsp.cpp")

R> res <- compute_values_cpp()

R> str(res)
List of 2
 $ x: num [1:10] 199 362 118 302 262 ...
 $ y: num [1:10] 20 40 14.3 39.5 36.9 ...

R> 

_One call_ of sourceCpp() compiles AND links AND loads AND runs the example R
code (which is optional).

For reference, the current mmsp.cpp follows.

Dirk


#include 
using namespace Rcpp;

// [[Rcpp::export]]
List compute_values_cpp(int totalPoints = 1e5, double angle_increment =
0.01, int radius = 400, double grow = 3.64) {
  double xn = 0.5;
  double angle = 0.1;
  double xn_plus_one, yn_plus_one;
  NumericVector x(totalPoints);
  NumericVector y(totalPoints);

  for (int i=0; i

Re: [R] installing "rgl" package

2017-11-24 Thread Dirk Eddelbuettel

On 24 November 2017 at 11:30, Santosh wrote:
| Hi All, Duncan, Rolf, Ista, DIrk,
| 
| Thanks for the suggestions and I tried all of them (as suggested by Duncan,
| Rolf, Ista and Dirk)... I still get similar error as before while
| installing 'rgl' package.. I also tried to manually configure "rgl" and got
| an error message (please see below for the verbatim output).  Would highly
| any further ideas/suggestions!
| 
| *In my system, "GL" library is present under "/usr/include/GL"*
| 
| Here are the libraries available (as suggested by Rolf)
| 
| After installing some of them, I continue to get the same error message,
| please below the output messages in config.log after I ran "./configure")
| 
| 
| "ii  r-cran-rgl0.93.996-1
| amd64GNU R package for three-dimensional visualisation
| using OpenGL"

That means you _have_ the rgl package installed, and can stop everything you
are doing.

You do _not_ need to install it from source via R. You have it from Ubuntu.

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
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: [R] installing "rgl" package

2017-11-24 Thread Dirk Eddelbuettel

On 23 November 2017 at 15:05, Santosh wrote:
| I am trying to install 'rgl' package in Ubuntu.. Would highly appreciate
| your assistance .. I tried several leads available on various discussion
| fora and nothing helped so far.

Install the _pre-built binary package_ via

sudo apt install r-cran-rgl

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
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: [R] tcltk problems

2017-11-19 Thread Dirk Eddelbuettel

On 20 November 2017 at 08:38, Rolf Turner wrote:
| Point of order Mr. Chairman.  It is completely unfair to say that I shot 
| myself in the foot.

You moved files [or, in this case, created symlinks] below /usr.

Most of us repeatedly said you should not have to.

| Well, OK.  What list *should* it be on?  I was asking for help with an R 
| problem.  It seems to me that R-help is appropriate.

r-sig-debian, as my first email here said, and in concordance with all R
mailing list help and information.  

I am removing myself from CCs. The tone of these emails is such that I prefer
to focus on other things. You can do on your systems whatever you want -- but
if it breaks you get to keep the pieces.

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
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: [R] tcltk problems

2017-11-19 Thread Dirk Eddelbuettel

On 19 November 2017 at 12:17, peter dalgaard wrote:
| Dirk may want to dig in here:

I respectfully decline.

R builds fine on every Ubuntu system, and always has.  No bug in R, or
Ubuntu, or Debian (which would be cup of tea). There is the distro package
(which may be older if an older distro like 16.04 is used) and there always
is a current package at CRAN based on Michael's build of my packages. Always.

Of course a lot of people also locally build R, or maybe R-devel. There is no
general issue here as best as I can tell.

| [...] if one user has shot himself in the foot somehow.

My brief reading suggests that this is the case.

Nothing good comes off moving files around in /usr as was done.  It creates
local non-standard circumstances. You cannot expect standardized build to
anticipate each and every possible non-standard modification.

This discussion is still on the wrong list too.

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
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: [R] tcltk problems

2017-11-18 Thread Dirk Eddelbuettel

Rolf,

A few quick points as I just noticed this thread (as I don't regularly dip
into r-help any more):

 1)  You really do not need to builds R locally on Ubuntu. I update the
 Debian package hours after Peter cuts a release. Michael rolls Ubuntu
 releases off these typically the same or next day, which arrive at CRAN
 in less than 72 hours after a release.

 See https://cloud.r-project.org/bin/linux/ubuntu/README.html

 I run these binaries myself on several personal machines and dozens more
 at work.  They. Just. Work.  Why not take advantage of a freebie?

 2)  If you still want to build locally, simply copy what we do. Our sources
 are public.  The debian/control for r-base (for Debian, albeit, don't
 have Michael's here but tcl/tk has not changed in year) has

Build-Depends: gcc (>= 4:4.1.0), [...], tcl8.6-dev, tk8.6-dev, [...]

 so make sure you install those two package, and the debian/rules does

./configure --prefix=/usr   \
[]
--with-tcltk\
[]

[...]

$(MAKE) [...]

 ie nothing special for configure or make.

 My most recent build then logged

checking for tclConfig.sh... no
checking for tclConfig.sh in library (sub)directories... 
/usr/lib/tcl8.6/tclConfig.sh
checking for tkConfig.sh... no
checking for tkConfig.sh in library (sub)directories... 
/usr/lib/tk8.6/tkConfig.sh
checking tcl.h usability... yes
checking tcl.h presence... yes
checking for tcl.h... yes
checking tk.h usability... yes
checking tk.h presence... yes
checking for tk.h... yes
checking whether compiling/linking Tcl/Tk code works... yes

 which echos what Peter already said. Its final state report for
 configure was

R is now configured for x86_64-pc-linux-gnu

  Source directory:  .
  Installation directory:/usr

  C compiler:gcc -std=gnu99  -g -O2 
-fdebug-prefix-map=/build/r-base-3.4.2=. -fstack-protector-strong -Wformat 
-Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g
  Fortran 77 compiler:   gfortran  -g -O2 
-fdebug-prefix-map=/build/r-base-3.4.2=. -fstack-protector-strong

  Default C++ compiler:  g++   -g -O2 
-fdebug-prefix-map=/build/r-base-3.4.2=. -fstack-protector-strong -Wformat 
-Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g
  C++98 compiler:g++ -std=gnu++98 -g -O2 
-fdebug-prefix-map=/build/r-base-3.4.2=. -fstack-protector-strong -Wformat 
-Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g
  C++11 compiler:g++ -std=gnu++11 -g -O2 
-fdebug-prefix-map=/build/r-base-3.4.2=. -fstack-protector-strong -Wformat 
-Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g
  C++14 compiler:g++  -g -O2 
-fdebug-prefix-map=/build/r-base-3.4.2=. -fstack-protector-strong -Wformat 
-Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g
  C++17 compiler:g++ -std=gnu++17 -g -O2 
-fdebug-prefix-map=/build/r-base-3.4.2=. -fstack-protector-strong -Wformat 
-Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g
  Fortran 90/95 compiler:gfortran -g -O2 
-fdebug-prefix-map=/build/r-base-3.4.2=. -fstack-protector-strong
  Obj-C compiler: 

  Interfaces supported:  X11, tcltk
  External libraries:readline, BLAS(generic), LAPACK(generic), 
curl
  Additional capabilities:   PNG, JPEG, TIFF, NLS, cairo, ICU
  Options enabled:   shared R library, R profiling, memory 
profiling

  Capabilities skipped:  
  Options not enabled:   shared BLAS

  Recommended packages:  no

 which looks pretty good to me. No capabilities. All batteries
 included. (And rec'd packages is no as we package them individually).

 3)  r-help is the wrong list for these questions. Come to r-sig-debian
 which covers R on .deb based systems.  We don't bite, and it is low volume

Cheers, Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
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: [R] R Date Time

2017-04-25 Thread Dirk Eddelbuettel

On 25 April 2017 at 18:05, Duncan Murdoch wrote:
| On 25/04/2017 5:41 PM, Dirk Eddelbuettel wrote:
| >
| > On 25 April 2017 at 16:04, Jeff Reichman wrote:
| > | R Users
| > |
| > | Having problems converting the following DTG into an R recognized 
date/time
| > | field
| > |
| > | 01-01-2016T14:02:23.325
| > |
| > | Would I separate it into a date field and time filed then put it back
| > | together???
| >
| > The anytime package (on CRAN) does this (and other date or datetime input
| > variants) without requiring a format:
| >
| >   R> library(anytime)
| >   R> anytime("01-01-2016T14:02:23.325")
| >   [1] "2016-01-01 14:02:23.325 CST"
| 
| How does it decide between MDY and DMY orderings in dates?  Doesn't 
| matter for this example, but it would for "01-02-2016T14:02:23.325"

See 

http://dirk.eddelbuettel.com/code/anytime.html

https://github.com/eddelbuettel/anytime

https://github.com/eddelbuettel/anytime/blob/master/src/anytime.cpp#L43-L106

for overview(s), some comments, notes and in particular the set of formats.

It has a strong preference for sane (ie ISO formats) but in the case of
ambiguity it (grudingly) prefers the (silly) US way:

R> anytime("01-02-2003")
[1] "2003-01-02 CST"
R>

But I try not to miss an opportunity that the format should really not be used.

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
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: [R] R Date Time

2017-04-25 Thread Dirk Eddelbuettel

On 25 April 2017 at 16:04, Jeff Reichman wrote:
| R Users
| 
| Having problems converting the following DTG into an R recognized date/time
| field
| 
| 01-01-2016T14:02:23.325
| 
| Would I separate it into a date field and time filed then put it back
| together???

The anytime package (on CRAN) does this (and other date or datetime input
variants) without requiring a format:

  R> library(anytime)
  R> anytime("01-01-2016T14:02:23.325")
  [1] "2016-01-01 14:02:23.325 CST"
  R>

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
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: [R] Earth Mover's Distance

2017-03-07 Thread Dirk Eddelbuettel

The earthmovdist repo on R-Forge is alive and well.  Rainer and I simply
stopped doing work on it as the authors of the Emd-L1 library we use could
not get a liberal license for this.  Note the language in the source code
(src/emdL1.cpp) and please make sure YOUR use is in compliance.

But as I use R-Forge less than GitHub, I just brought the repo over to

https://github.com/eddelbuettel/earthmovdist

and may make an update or two in the coming days to make it compliant with R
CMD check on R release and R devel, and in process may make the Rcpp use a
little more current...

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
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: [R] Any reason not to use RUnit any longer?

2017-03-07 Thread Dirk Eddelbuettel

On 6 March 2017 at 19:04, Hans-Peter Suter wrote:
| I see that quite some packages nowadays use testthat and that RUnit doesn't
| have recent updates. On the other hand Rccp, fTrading and others (still)
| test with RUnit.

RUnit is alive and well, look at

  https://cran.r-project.org/package=RUnit
  https://cran.r-project.org/web/checks/check_results_RUnit.html

which shows all its checks are clean.  It also has a new maintainer in Roman
Zenka (who too has code that uses it) so I would not be worried.
 
| My old code uses RUnit and I would prefer to keep it that way unless there
| is an important reason to switch to testthat. If it makes a difference, I
| do _not_ use roxygen and stay close to R-exts standards (ok, a testing
| framework I'd like to have).

There is no offically sanctioned package in WRE for this as far as I know.

If you run 'make check' on R itself, all the package in base R check via
.Rout.save files -- which makes sense as we want no / few external
dependencies at this level.

In short, you are free to use what you prefer.  I still use RUnit too.

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
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: [R] xvfb? cron job updates R packages, fails on some requiring X11

2017-01-19 Thread Dirk Eddelbuettel

Paul,

Just prefix the command as you would with, say, /usr/bin/time.  An example is 
here:

  
https://github.com/RcppCore/rcpp-logs/blob/master/scripts/runRcppDepends.r#L140L-L142

from the script I use to test all Rcpp dependencies -- now over 900 -- 
unattended.

Some packages also need OpenGL which the default does not give you. But the
r-cran.mk script building several hundred r-cran-* package for the Debian and
Ubuntu distros -- as well as several _thousand_ r-cran-* packages via Michael
Rutter's repos for Ubuntu, and included in every installation, does this:


  ## xvfb-run with GL extension and default resolution
  xvfbSrvArgs   = -screen 0 1024x768x24 -ac +extension GLX +render -noreset

  [...]

if test -f /usr/bin/xvfb-run; then  \
$(makeFlagsCall) xvfb-run -a -n 20  \
  -s "${xvfbSrvArgs}"   \
R CMD INSTALL -l $(debRlib) --clean \
$(extraInstallFlags) .  \
$(builttimeStamp)   \
;   \


I guess you can piece the rest together.  Now, if you just used Ubuntu LTS
instead of insisting on CentOS you wouldn't even have to compile them
locally.  Might be worth a consideration or test deployment.

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
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: [R] Rbbg usurped ?

2016-12-28 Thread Dirk Eddelbuettel

On 28 December 2016 at 13:46, John Laing wrote:
| I've cleaned up the findata repository, you should now be able to install
| Rbbg as expected.
| 
| But that said, the package is no longer being actively developed. Recent
| efforts have been taking place in the Rblpapi package. The interface is
| similar, though not strictly compatible. If you're doing much work with
| Bloomberg data I recommend you check it out.

Also, Rblpapi is on CRAN and installs like other packages via

install.packages("Rblpapi")

and update.packages() relieving you from the need to go to findata.org.

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
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: [R] Using C library in R

2016-07-23 Thread Dirk Eddelbuettel
Jeff Newmiller  dcn.davis.ca.us> writes:
> You are entitled to your opinion,  but apparently you have not read the 
Posting Guide either.

Where as you chose to ignore it (cf paragraph about Good Manners). That 
is clearly superior.

The Posting Guide is not specific about this and does NOT say that all 
questions related to compiled code should go to r-devel.  

Dirk

__
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: [R] Using C library in R

2016-07-22 Thread Dirk Eddelbuettel
Jeff Newmiller  dcn.davis.ca.us> writes:
> 2) Interfacing R with other languages is off-topic on this list. There are 
other lists where such issues are
> on-topic. Your post is a bit like walking into a bowling alley and asking if 
anyone there can solve your
> chess problem... someone might be able to, but it isn't very efficient and 
disturbs the bowlers unnecessarily.

Not sure I agree. It is an advanced topic, but it is not off-list.

Dirk

__
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: [R] detect computer drives

2015-11-27 Thread Dirk Eddelbuettel

On 27 November 2015 at 15:43, Adrian Dușa wrote:
| Is there a method to detect the computer's drives?
| That would include USB sticks, when they are recognised by the operating
| system.

That is very obviously OS-dependent amd would need to be wrapped conditional
on the OS.  In R you can test for _explicitly named_ directories and files,
but not more.

As such, the question is not appropriate for this forum.

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
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: [R] QuantMod and XML

2015-11-07 Thread Dirk Eddelbuettel

On 7 November 2015 at 19:37, Robert Sherry wrote:
|  Warning message: package ‘XML’ is not available (for R version 3.1.2)

That is your problem.

You are running R 3.1.2.  That is old and outdated.  CRAN has packages --
which may on occassion impose a '>=' relation. That is the case here.

You can see at the CRAN package page https://cran.rstudio.com/package=XML
that the package is fine.

In short, either update R to 3.2.2 (good, more work) or pick an older XML
from the Archive section at https://cran.rstudio.com/src/contrib/Archive/XML/

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

__
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: [R] how to add 1 + 1 with the interface between R and C

2015-09-21 Thread Dirk Eddelbuettel
peter dalgaard  gmail.com> writes:
> C is call by value and k and res are pointers. You need a dereferencing 
step or nothing with happen. Try
> 
> *res = *k + 1;

Or you use Rcpp which writes the glue code. Save the following into a file:


#include 

// [[Rcpp::export]]
int adder(int x, int y) {
  return x + y;
}

/*** R
adder(40, 2)
*/




Running this is as simple as sourcing it:

  R> Rcpp::sourceCpp("/tmp/adder.cpp")

  R> adder(40, 2)
  [1] 42
  R> 

and it even runs the R snippet at the bottom.

Dirk

__
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: [R] Rcpp, function signature

2015-08-28 Thread Dirk Eddelbuettel
peter dalgaard pdalgd at gmail.com writes:
 But for the benefit of the rest of us: A NumericVector is a pointer, right?

Effectively even though it is not treated as one by the users.  But you 
know what P in SEXP stands for, and Rcpp objects really are what we call
proxy objects for the respective underlying SEXP objects.

Searching the rcpp-devel list archives for the clone() function will bring
a number of preceding discussions.  As I said in the previous email, this
list is not the best place to discuss Rcpp matters --- rcpp-devel is. 
Please feel free to bring follow-up questions there.

Dirk

__
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: [R] Rcpp, function signature

2015-08-27 Thread Dirk Eddelbuettel
Michael Meyer via R-help r-help at r-project.org writes:

 I am an  (very) grateful user of Rcpp.

Glad to hear that!

But you are on the wrong mailing list. Please ask on rcpp-devel.

Dirk

__
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: [R] Rcpp cpp11 and R CMD build

2015-06-24 Thread Dirk Eddelbuettel
Edwin van Leeuwen edwinvanl at gmail.com writes:

 
 Thank you! I was missing the SystemRequirements. I guess it could be useful
 to add this to the example given here:
 http://gallery.rcpp.org/articles/simple-lambda-func-c++11/

No. 

If you actually read the Rcpp documentation--eg the Rcpp Attributes vignette-
--then you'd know the difference between plugin use via sourceCpp() and 
proper package development. 

Which is what we recommend.  We also ask that Rcpp-related questions be asked 
on the rcpp-devel list as they are mostly out-of-context here.

Thanks,  Dirk

__
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: [R] QMLE of MGARCH

2015-05-01 Thread Dirk Eddelbuettel
Masher Masher masher at gmail.com writes:
 So my question is: is the function garchFit the best one to estimate
 parameters using the QML or should I better use other packages for
 convenience.

You may want to look at the rmgarch package.

Dirk

__
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: [R] Where is the R Graph Gallery?

2015-04-18 Thread Dirk Eddelbuettel

On 18 April 2015 at 05:29, John Kane wrote:
| I think it moved to http://rgraphgallery.blogspot.com/ with a different 
interface.

I don't think so. Something I contributed years ago to the original Graph
Gallery is not on this site. 

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

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


  1   2   3   4   5   >