Re: [Rd] Problem with accessibility in R 4.2.0 and 4.2.1.

2022-12-20 Thread Tomas Kalibera

Dear Andrew, Jonathan,

I had a closer look and tried to improve accessibility in Rgui, please 
see below. I would be grateful for feedback.


Rgui supports three cursor types, which can be selected via Edit/GUI 
preferences/Cursor blink.


The default is "partial", but for screen readers, please use "full". You 
can change the selection in the menu and then "Save..." to save it into 
your Rconsole file. If you already have the file, the corresponding 
selection is "cursor_blink = Full".


The "full" cursor is implemented as the standard Windows "caret" and 
this is what screen readers can see. Once you set this cursor as the 
default in your Rconsole file and re-start Rgui, but before you start 
using the console, please switch focus out and back in (e.g. press 
Alt+TAB twice). This helps NVDA detect the characters under the cursor 
in already released versions of R. Please start the screen reader before 
starting Rgui.


I found that the "full" cursor implementation has a number of problems: 
in some situation it disappears when it shouldn't, in some the other way 
around. I thought this was confusing the screen reader, so I fixed most 
of these cases.


However, the true cause was that Rgui didn't create the cursor right 
when it got focus the first time. Luckily NVDA is open-source, so one 
can read and modify the source code to find out. I've added a 
work-around to Rgui, which is used only with the "full" cursor, because 
the "partial" cursor confuses the screen reader too much to be usable, 
anyway. So, after this fix, one doesn't have to do that focus out+in trick.


The improvements are in R-devel (revision 83482 or newer). I would be 
grateful if you could test it, so that it could be improved further (or 
reverted if it actually turned out worse). Particularly if you find a 
problem reproducible with NVDA, that should be something I could 
diagnose and improve, as I have the sources.


I've been testing with NVDA and I'd be curious about the impact on JAWS.
Rgui doesn't work with Narrator.

Thanks,
Tomas

On 9/22/22 23:15, Andrew Hart via R-devel wrote:

On 22/09/2022 16:42, Toby Hocking wrote:
Another option is to use https://emacspeak.sourceforge.net/ 
 (version of emacs editor/ide 
which can speak letters/words/lines -- has a blind maintainer) with 
https://ess.r-project.org/  (interface 
for editing and running R code from within emacs)


Thanks everyone for all the suggestions. Of course, the optimal 
solution would be to figure out what is going on in Rgui, but, as is 
always the case, the blind user use case is a fairly niche one. I 
appreciate all the suggestions for finding an immediate solution to my 
problem.
I don't use any kind of IDE for working with R since I simply haven't 
found one that is accessible or that i understand how to use. There is 
a plug-in for the Eclipse IDE I installed a few years ago, but I 
didn't understand the first thing about how it was to be used. So I've 
just always worked with an editor open in one Window and R in another,
working interactively in R or bouncing over to the editor for more 
complex things and sourcing code into R as necessary. However, I only 
use the R console in Rgui. I went and had a look at Rterm, which I 
have never used on Windows; I've only ever used it when ssh-ing into 
Linux systems to use R. However, I've just found out that Rterm does a 
number of fairly important things that probably mean I can just use it 
instead of Rgui:

1. You can paste from the clipboard into the Rterm prompt;
2. It has a command history;
3. If you plot something, it opens a Window to draw the plot (I never 
realised it could do this and had always assumed Rgui was needed for 
this); and
4. It opens the HTML help if you ask for help on windows. I only ever 
saw it display text help on Linux, but I was logged in remotely. 
Text-based help is fine when ssh-ing into a machine, but HTML help is 
much nicer to read and navigate.


I think I'll just switch over to Rterm for a while, but I can also 
check out ess, which I wasn't aware of.


Thanks a lot,
Andrew.

__
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


Re: [Rd] Problem with accessibility in R 4.2.0 and 4.2.1.

2022-12-20 Thread Tomas Kalibera



On 9/22/22 23:15, Andrew Hart via R-devel wrote:

On 22/09/2022 16:42, Toby Hocking wrote:
Another option is to use https://emacspeak.sourceforge.net/ 
 (version of emacs editor/ide 
which can speak letters/words/lines -- has a blind maintainer) with 
https://ess.r-project.org/  (interface 
for editing and running R code from within emacs)


Thanks everyone for all the suggestions. Of course, the optimal 
solution would be to figure out what is going on in Rgui, but, as is 
always the case, the blind user use case is a fairly niche one. I 
appreciate all the suggestions for finding an immediate solution to my 
problem.
I don't use any kind of IDE for working with R since I simply haven't 
found one that is accessible or that i understand how to use. There is 
a plug-in for the Eclipse IDE I installed a few years ago, but I 
didn't understand the first thing about how it was to be used. So I've 
just always worked with an editor open in one Window and R in another,
working interactively in R or bouncing over to the editor for more 
complex things and sourcing code into R as necessary. However, I only 
use the R console in Rgui. I went and had a look at Rterm, which I 
have never used on Windows; I've only ever used it when ssh-ing into 
Linux systems to use R. However, I've just found out that Rterm does a 
number of fairly important things that probably mean I can just use it 
instead of Rgui:

1. You can paste from the clipboard into the Rterm prompt;
2. It has a command history;
3. If you plot something, it opens a Window to draw the plot (I never 
realised it could do this and had always assumed Rgui was needed for 
this); and
4. It opens the HTML help if you ask for help on windows. I only ever 
saw it display text help on Linux, but I was logged in remotely. 
Text-based help is fine when ssh-ing into a machine, but HTML help is 
much nicer to read and navigate.


I think I'll just switch over to Rterm for a while, but I can also 
check out ess, which I wasn't aware of.


Thanks a lot,
Andrew.

__
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


Re: [R-pkg-devel] Help with fixing problems for new R package

2022-12-20 Thread Uwe Ligges




On 19.12.2022 22:45, Anna Carolina Resende wrote:

Hello,

I'm running test to check if my package is working properly, and for
Fedora, Windows and Ubuntu I get the following note:

* checking CRAN incoming feasibility ... [5s/25s] NOTE
Maintainer: ‘Anna Carolina Resende ’

I read online that it's a note for CRAN so they can check that the
maintainer made changes, could you confirm that that is the case?



Yes.



However, when testing in Fedora, I get another note saying:

* checking HTML version of manual ... NOTE
Skipping checking HTML validation: no command 'tidy' found

I've tried updating the HTML Tidy on my mac as I read online that should
solve this issue, but nothing changed. Could you help me solve these issues?


Is it in the PATH, i.e. can R find it?

Best,
Uwe Ligges



Thank you in advance!

Best regards

[[alternative HTML version deleted]]

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


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


Re: [R-pkg-devel] Help with fixing problems for new R package

2022-12-20 Thread Ivan Krylov
В Tue, 20 Dec 2022 10:45:38 +1300
Anna Carolina Resende  пишет:

> * checking CRAN incoming feasibility ... [5s/25s] NOTE
> Maintainer: ‘Anna Carolina Resende ’
> 
> I read online that it's a note for CRAN so they can check that the
> maintainer made changes, could you confirm that that is the case?

Yes, that's exactly right.

> However, when testing in Fedora, I get another note saying:
> 
> * checking HTML version of manual ... NOTE
> Skipping checking HTML validation: no command 'tidy' found
> 
> I've tried updating the HTML Tidy on my mac as I read online that
> should solve this issue, but nothing changed.

What do you mean by testing in Fedora? If you're running a Fedora
GNU/Linux virtual machine on your Mac in order to test your package,
you'll need to install HTML Tidy inside that virtual machine. If you're
using someone else's package check service (e.g. R-hub), this may
indicate a problem with their setup (but not your package).

If these are the only two NOTEs you're getting, it looks to me like
your package doesn't have any problems, congratulations!

-- 
Best regards,
Ivan

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


[R-pkg-devel] Help with fixing problems for new R package

2022-12-20 Thread Anna Carolina Resende
Hello,

I'm running test to check if my package is working properly, and for
Fedora, Windows and Ubuntu I get the following note:

* checking CRAN incoming feasibility ... [5s/25s] NOTE
Maintainer: ‘Anna Carolina Resende ’

I read online that it's a note for CRAN so they can check that the
maintainer made changes, could you confirm that that is the case?

However, when testing in Fedora, I get another note saying:

* checking HTML version of manual ... NOTE
Skipping checking HTML validation: no command 'tidy' found

I've tried updating the HTML Tidy on my mac as I read online that should
solve this issue, but nothing changed. Could you help me solve these issues?

Thank you in advance!

Best regards

[[alternative HTML version deleted]]

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


Re: [Rd] F77_CALL(dgetrs) C++ call in R-devel

2022-12-20 Thread Dirk Eddelbuettel


On 20 December 2022 at 12:33, Lars Relund wrote:
| In my package, I have the method:
| 
| /** Solve equations transpose(P)w = r. */
| int LASolveT(MatSimple , MatSimple , const
| MatSimple ) {
| int rows = P.rows;
| int nrhs = 1;
| int lda = rows;
| int ldb = rows;
| int info = -1;
| MatSimple ipivot(1,rows);
| w.Inject(r);// copy r to w;
| F77_CALL(dgetrf)(, , (0,0), , (0,0), );
| if (info!=0) {
| cout << "Error in LASolve (dgetrf). Info=" << info << endl;
| return 1;
| }
| F77_CALL(dgetrs)("T", , , (0,0), , (0,0),
| (0,0), , );("T", , , (0,0), , (0,0),
| (0,0), , );
| if (info!=0) {
| cout << "Error in LASolve (dgetrs). Info=" << info << endl;
| return 1;
| }
| return 0;
| }
| 
| When compiling the package on using R-devel the error for F77_CALL(dgetrs)
| occur:
| 
| matalg.h:67:25: error: too few arguments to function ‘void dgetrs_(const
| char*, const int*, const int*, const double*, const int*, const int*,
| double*, const int*, int*, size_t)’
|67 | F77_CALL(dgetrs)("T", , , (0,0), ,
| (0,0), (0,0), , );
| 
| It works in R-release and I guess it have something to do with
| https://cran.r-project.org/doc/manuals/r-devel/NEWS.html and LAPACK.
| 
| Any hints on how to get it to work for both R-release and R-devel.

I can offer you two answers. The first, and narrower, is in Writing R
Extensions and concerns FC_LEN. R now 'automagically' injects additional
parameters for a better, more stringent, control of character variable
length. See eg

  
https://rstudio.github.io/r-manuals/r-exts/The-R-API.html#fortran-character-strings

and related. (And this isn't new per se, those of use with packages with
Fortran interfaces have been keeping this up.)

The second, more pragmatic answer, is of course 'to not do that' but to rely
on the decade of tuning and bazillion of test and runs a higher-end Linear
Algebra package like (Rcpp)Armadillo offers by wrapping around LAPACK and
BLAS for you.  You already are in C++, so there os essentially no switching
cost. And (Rcpp)Armadillo is header-only and hence free of added
complications.

Dirk

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

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


[Rd] F77_CALL(dgetrs) C++ call in R-devel

2022-12-20 Thread Lars Relund
In my package, I have the method:

/** Solve equations transpose(P)w = r. */
int LASolveT(MatSimple , MatSimple , const
MatSimple ) {
int rows = P.rows;
int nrhs = 1;
int lda = rows;
int ldb = rows;
int info = -1;
MatSimple ipivot(1,rows);
w.Inject(r);// copy r to w;
F77_CALL(dgetrf)(, , (0,0), , (0,0), );
if (info!=0) {
cout << "Error in LASolve (dgetrf). Info=" << info << endl;
return 1;
}
F77_CALL(dgetrs)("T", , , (0,0), , (0,0),
(0,0), , );("T", , , (0,0), , (0,0),
(0,0), , );
if (info!=0) {
cout << "Error in LASolve (dgetrs). Info=" << info << endl;
return 1;
}
return 0;
}

When compiling the package on using R-devel the error for F77_CALL(dgetrs)
occur:

matalg.h:67:25: error: too few arguments to function ‘void dgetrs_(const
char*, const int*, const int*, const double*, const int*, const int*,
double*, const int*, int*, size_t)’
   67 | F77_CALL(dgetrs)("T", , , (0,0), ,
(0,0), (0,0), , );

It works in R-release and I guess it have something to do with
https://cran.r-project.org/doc/manuals/r-devel/NEWS.html and LAPACK.

Any hints on how to get it to work for both R-release and R-devel.

Best
Lars Relund

[[alternative HTML version deleted]]

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


Re: [R-pkg-devel] How do I enable to show data in inst/extdata in data() || lazy load

2022-12-20 Thread Ivan Krylov
В Tue, 20 Dec 2022 05:28:49 +0530
Sanjeev Sariya  пишет:

> I need to provide an external data/file in the R package. This has
> come as a request from F1000 journal editors.

Would the journal editors agree to have this data in the form of an R
object? Is it a strict requirement to have this file in a given format?

> What do you call this step? How do I do this?

See Writing R Extensions, section 1.1.6 "Data in packages":
https://cran.r-project.org/doc/manuals/R-exts.html#Data-in-packages

I don't want to rewrite it all in this e-mail, but if you're having
trouble with a specific step, feel free to ask for guidance.

-- 
Best regards,
Ivan

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


Re: [R-pkg-devel] How do I enable to show data in inst/extdata in data() || lazy load

2022-12-20 Thread Uwe Ligges




On 20.12.2022 00:58, Sanjeev Sariya wrote:

Hi,
thank you for the reply.

Do you need this to be a file? Could it be a pre-parsed R object
instead?


Yes, and that can go into an .RData file.

Best,
Uwe Ligges



I need to provide an external data/file in the R package. This has come as
a request from F1000 journal editors.

One way to solve this could be to write a script that imports the file
from inst/extdata using the facilities provided by your package and put
it in a file under data/, then document the resulting object.


What do you call this step? How do I do this?
I thought to loading the file as lazyload, .onload package something?

Best,
--
Sanjeev M




On Tue, Dec 20, 2022 at 1:55 AM Ivan Krylov  wrote:


On Mon, 19 Dec 2022 20:59:27 +0530
Sanjeev Sariya  wrote:


... I have created a .Rd file.
I'm interested in listing this file in data() ...


My understanding is that data() is for R-level objects, and so is
help(), most likely.

One way to solve this could be to write a script that imports the file
from inst/extdata using the facilities provided by your package and put
it in a file under data/, then document the resulting object. I think
that if you build your package with --no-resave-data, it will remain an
R script that will be run during the data() call. (By default, your R
script will be run during R CMD build and its output will be packaged
into a gzip-compressed RData file.)

This might go against the guidance at
,
which says:


R code should be if possible “self-sufficient” and not make use of
extra functionality provided by the package, so that the data file
can also be used without having to load the package or its namespace


Do you need this to be a file? Could it be a pre-parsed R object
instead?

--
Best regards,
Ivan



[[alternative HTML version deleted]]

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


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