Re: [Rd] R 4.3.1 scheduled for June 16

2023-05-25 Thread Daniele Medri
In data gioved� 25 maggio 2023 15:44:18 CEST, Peter Dalgaard via R-devel:
> Full schedule available on developer.r-project.org in a short while.

Really good news!

For those who would like to test the next release on Linux:

$ git clone https://github.com/dmedri/roaster
$ cd roaster/
$ ./roaster --set-branch
$ ./roaster --build-virtualenv

It will fetch the source code from SVN R-4-3-branch repository and build 
everything in 
user space.

HTH

Cheers
-- 
DM

[[alternative HTML version deleted]]

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] Adding support for S7 to base R

2023-03-14 Thread Daniele Medri
In data luned� 13 marzo 2023 16:53:56 CET, Ezra Tucker ha scritto:
> R is the only language I know of that has multiple different object
> oriented systems, and that makes it a big barrier to entry for people
> learning the language, and I think the language as a whole would benefit
> greatly from having a single standard.

R is more than just a "language," it is well known. It is an environment, an 
ecosystem of 
packages, many standards and much code written for decades in different 
programming 
languages that can survive and run under a common roof.

IMHO the question should not be about which versions/systems of R oo to use, 
but how 
they integrate with each other, what is the cost of an overall upgrade, whether 
all this is 
really necessary. More than pragmatism, a moral suasion.

hth

-- 
Daniele Medri

[[alternative HTML version deleted]]

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] capturing multiple warnings in tryCatch()

2021-12-03 Thread Daniele Medri
Interesting exchange of ideas.

A feature that should be included soon in the codebase to help in some
use-cases  -- eg. handling thousand database connections on {L,W}AN.



Il Gio 2 Dic 2021, 23:38 Fox, John  ha scritto:

> Dear Henrik, Simon, and Adrian,
>
> As it turns out Adrian's admisc::tryCatchWEM() *almost* does what I want,
> which is both to capture all messages and the result of the expression
> (rather than the visible representation of the result). I was easily able
> to modify tryCatchWEM() to return the result.
>
> Henrik: I was aware that tryCatch() doesn't return the final result of the
> expression, and I was previously re-executing the expression to capture the
> reult, but only getting the first warning message, along with the result.
>
> Thanks for responding to my question and providing viable solutions,
>  John
>
> On 2021-12-02, 5:19 PM, "Henrik Bengtsson" 
> wrote:
>
> Simon's suggestion with withCallingHandlers() is the correct way.
> Also, note that if you use tryCatch() to catch warnings, you're
> *interrupting* the evaluation of the expression of interest, e.g.
>
> > res <- tryCatch({ message("hey"); warning("boom"); message("there");
> 42 }, warning = function(w) { message("Warning caught: ",
> conditionMessage(w)); 3.14 })
> hey
> Warning caught: boom
> > res
> [1] 3.14
>
> Note how it never completes your expression.
>
> /Henrik
>
> On Thu, Dec 2, 2021 at 1:14 PM Simon Urbanek
>  wrote:
> >
> >
> > Adapted from demo(error.catching):
> >
> > > W=list()
> > > withCallingHandlers(foo(), warning=function(w) { W <<- c(W,
> list(w)); invokeRestart("muffleWarning") })
> > > str(W)
> > List of 2
> >  $ :List of 2
> >   ..$ message: chr "warning 1"
> >   ..$ call   : language foo()
> >   ..- attr(*, "class")= chr [1:3] "simpleWarning" "warning"
> "condition"
> >  $ :List of 2
> >   ..$ message: chr "warning 2"
> >   ..$ call   : language foo()
> >   ..- attr(*, "class")= chr [1:3] "simpleWarning" "warning"
> "condition"
> >
> > Cheers,
> > Simon
> >
> >
> > > On Dec 3, 2021, at 10:02 AM, Fox, John  wrote:
> > >
> > > Dear R-devel list members,
> > >
> > > Is it possible to capture more than one warning message using
> tryCatch()? The answer may be in ?conditions, but, if it is, I can't locate
> it.
> > >
> > > For example, in the following only the first warning message is
> captured and reported:
> > >
> > >> foo <- function(){
> > > +   warning("warning 1")
> > > +   warning("warning 2")
> > > + }
> > >
> > >> foo()
> > > Warning messages:
> > > 1: In foo() : warning 1
> > > 2: In foo() : warning 2
> > >
> > >> bar <- function(){
> > > +   tryCatch(foo(), warning=function(w) print(w))
> > > + }
> > >
> > >> bar()
> > > 
> > >
> > > Is there a way to capture "warning 2" as well?
> > >
> > > Any help would be appreciated.
> > >
> > > John
> > >
> > > --
> > > John Fox, Professor Emeritus
> > > McMaster University
> > > Hamilton, Ontario, Canada
> > > Web: http://socserv.mcmaster.ca/jfox/
> > >
> > >
> > >
> > > __
> > > R-devel@r-project.org mailing list
> > > https://stat.ethz.ch/mailman/listinfo/r-devel
> > >
> >
> > __
> > R-devel@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-devel
>
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

[[alternative HTML version deleted]]

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] R - translations status and few notes

2020-11-22 Thread Daniele Medri
Dear R users/devs,

TL;TR

This is a translations status for R. Since I've revisited my own work
in a github repo, I think some notes could be useful to other
maintainers.

## Status

The supported languages for "base": da, de, en, en_GB, es, fa, fr, it,
ja, ko, nn, pl, pt_BR, ru, tr, zh_CN, zh_TW. Any single file is quite
close to be completed (# of translated labels), but some technical
long-standing mistakes (at least ~6+ months) are blocking their
installation or need some love. Just to name few...

1. in "base":

po/R-de.po:863
unrecognised format specification '%'
Package %s version %s cannot be unloaded:\n %s
Paket %s Version %s kann nicht entladen werden\n%s%

po/R-de.po:1271
too few entries
No generic function %s found corresponding to requested imported
methods from package %s when loading %s (malformed exports?)
Keine generische Funktion, die mit der angeforderten Importmethode
fr\n%s aus Paket %s korrespondiert, gefunden (Fehler in
Exports?)
not installing

2. on all packages for .da (easy to fix):

po/R-da.po:2: warning: header field 'Language-Team' still has the
initial default value



## An easy solution to update/test (R and..) translations

# A working translation repo

My reference for this task is a Debian Linux distribution (install the
required packages if not already available).

'''
$ git clone https://github.com/dmedri/R-italian-lang
$ cp -a R-italian-lang R-german-lang
$ cd R-german-lang/
$ vi repo.conf
'''

change the LANG variable to fit your language (eg. "de"), save and
exit. Now copy your .po files in "R-4-0-BRANCH" directory, following
the existing paths.

Now, the scripts.

1. Create archives:

'''
$ ./repo.archives
'''

To help Martin Maechler work -- my reference for the task, the script
create archives ready for commits.

2. Search for a term:

'''
$ ./repo.search "not available"
'''

If you need to search an original label or a translated one.

3. Cleanup all unneeded files:

'''
$ ./repo.clean
'''

Remove spurious files in the repo directory (.mo files, archives
directory, and so on).

4. Test the new translations:

I did a tool, the "roaster", a bash-prototype to build-update R online
(see. the repo infos for more). Since this app have its own directory
for builds, everything goes here and will be propagated build-after-
build.

$ cd ..
$ git clone https://github.com/dmedri/roaster
$ cd roaster/
$ ./roaster --build-standard

If you don't want to overwrite your existing R bin, you could try the
"virtual environments" -- conceptually similar to the Python virtualenv
(see. the repo docs for more infos):

$ ./roaster --build-virtualenv

Now, to install and test your translations:

$ cd ../R-german-lang/
$ ./repo.roaster

The output will be quite similar to the status-report attached.


HTH

Best Wishes
-- 
DM
Library "base"

  R-da:
475 translated messages, 50 fuzzy translations, 33 untranslated messages

  R-de:
po/R-de.po:863
unrecognised format specification '%'
Library %s version %s cannot be unloaded:\n %s
Paket %s Version %s kann nicht entladen werden\n%s%

po/R-de.po:1271
too few entries
No generic function %s found corresponding to requested imported methods from 
package %s when loading %s (malformed exports?)
Keine generische Funktion, die mit der angeforderten Importmethode 
fr\n%s aus Paket %s korrespondiert, gefunden (Fehler in Exports?)

not installing

  R-fa:
1 translated message, 557 untranslated messages

  R-fr:
466 translated messages, 53 fuzzy translations, 39 untranslated messages

  R-it:
558 translated messages

  R-ja:
476 translated messages, 49 fuzzy translations, 33 untranslated messages

  R-ko:
401 translated messages, 18 fuzzy translations, 139 untranslated messages

  R-nn:
369 translated messages, 138 fuzzy translations, 51 untranslated messages

  R-pl:
520 translated messages, 20 fuzzy translations, 18 untranslated messages

  R-pt_BR:
295 translated messages, 189 fuzzy translations, 74 untranslated messages

  R-ru:
520 translated messages, 20 fuzzy translations, 18 untranslated messages

  R-tr:
4 translated messages, 18 fuzzy translations, 536 untranslated messages

  R-zh_CN:
456 translated messages, 61 fuzzy translations, 41 untranslated messages

  da:
510 translated messages, 74 fuzzy translations, 1044 untranslated messages

  de:
1550 translated messages, 57 fuzzy translations, 21 untranslated messages

  en:
1 translated message, 1627 untranslated messages

  en_GB:
3 translated messages, 3 fuzzy translations, 1622 untranslated messages

  es:
1041 translated messages, 502 fuzzy translations, 85 untranslated messages

  fa:
3 translated messages, 1625 untranslated messages

  fr:
1414 translated messages, 155 fuzzy translations, 59 untranslated messages

  it:
1628 translated messages

  ja:
1460 translated messages, 116 fuzzy translations, 52 untranslated messages

  ko:
1289 translated messages, 50 fuzzy translations, 289 untranslated messages

  nn:
1171 translated messages, 344 fuzzy translations, 113 untranslated messages

Re: [Rd] Downsized R configuration for flat deployment

2020-01-06 Thread Daniele Medri
Il giorno sab, 21/12/2019 alle 14.45 +, Gábor Csárdi ha scritto:
> FWIW this recent project of mine has somewhat similar goals:
> https://github.com/r-hub/r-minimal

Thank you Gàbor.

FWIW, I wrote a bash prototype for my needs with some features:
https://github.com/dmedri/roaster

HTH

Regards
-- 
DM

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel