Re: [R] ISO recommendations for plot output format from R to MS Word

2021-02-18 Thread Robert Dodier
On Thu, Feb 18, 2021 at 10:12 AM Kevin Thorpe  wrote:

> I would think that it would be more seamless to use Rmarkdown.
> Simply put the plotting code into an Rmarkdown file and send it
> straight to Word. Is there a reason why this is not a viable option?

Hi Kevin, thanks for your reply. Well, I started working with Word
because at least one other person needs to edit it and they want to
use Word. More fundamentally, it's not clear to me that going through
Rmarkdown solves the problem of determining the image format -- at
some point a figure is going to get generated and then pasted into a
Word document. It's not clear that doing that automatically is going
to work better or differently than doing it by hand. Anyway I think I
have a working solution at this point so I leave it to others to
investigate further possibilities.

best,

Robert Dodier

__
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] ISO recommendations for plot output format from R to MS Word

2021-02-18 Thread Robert Dodier
Hi, a quick follow-up about the question about putting R-generated
figures into MS Word.

I have found by experimenting with some figures and documents that if
I import an SVG figure generated by svglite (didn't try other output
functions), I can view it okay in my installation of MS Word (Word for
Mac 16.16.10), and it looks okay in MS Word for Windows (circa 2016 or
2018) on a laptop I have, and two other people can view it okay (one
on Mac and one on Windows). So that seems safe enough to go ahead.
YMMV.

I am informed that MS Word is actually storing a bitmap image of the
SVG figure, which is displayed by non-SVG-aware versions of Word. So
that seems like a good safeguard.

For the record, I converted the SVG to EPS, PNG, PDF, WMF, and EMF via
Imagemagick. EPS and PNG were tolerable, PDF was too fuzzy, and WMF
and EMF, at least as generated, could not be displayed (I was a little
surprised by that). There are, no doubt, many unanswered questions
here, which unfortunately I cannot take the time to explore right now.

In summary I found that importing SVG generated by svglite into MS
Word for Mac seems to work okay to generate a generally-readable file.
Perhaps this experience is useful in some way to others.

best,

Robert Dodier

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


[R] ISO recommendations for plot output format from R to MS Word

2021-02-12 Thread Robert Dodier
I need to export plots (constructed with plot and with ggplot) from R
to be imported into a MS Word document.

I am working with MS Word for Mac version 16.16.10 (copyright 2018)
and R versions 3.6.3 and/or 4.0.3.

I have verified that the version of MS Word which I am working with
can import SVG exported from R via svglite.

What I am mostly worried about is that other people with possibly
different versions of MS Word will not be able to view the document
correctly.

Towards the goal of creating an MS Word document which others with
unspecified versions of MS Word can view correctly, in what format
should I export figures from R?

I am working with a fairly large number of figures so there is some
motivation towards a fully automated process.

I have searched various forums and archives, but much of the
information may be out of date, so I am hoping that you can help me
with some up to date information.

Thank you very much for any light you can shed on this problem.

Robert Dodier

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


[R] Need recommendation for hash table which accepts integer keys

2020-12-15 Thread Robert Dodier
Hi, I'd like to use integers as keys in a hash table. Can someone
recommend a hash table implementation? I would like to avoid doing
something like substituting "123" for 123.

Here's what I know about different implementations so far:

env (built-in) -- integer keys not allowed
Dict (CRAN) -- integer keys not allowed
hash (CRAN) -- integer keys not allowed

nfultz/ht (Github) -- keys can be integers; advertised as being basic
and for teaching
mkuhn/dict (Github) -- keys can be integers; project is dormant
nathan-russell/hashmap (Github) -- keys can be integers; limitations on values

I wonder if anyone can suggest a hash table implementation. Perhaps
one way to get to an answer is to ask, what did you use last time you
needed a hash table which was going beyond what env provides?

Thanks for your time, I appreciate your help.

Robert Dodier

__
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] Options for zooming plots other than zm()

2020-04-26 Thread Robert Dodier
Many thanks to everyone who contributed to this discussion. It looks
like plotly and dygraphs both work well for zooming plots with
thousands of points (and many other things).

Thanks again, I appreciate your help.

best,

Robert Dodier

On Fri, Apr 24, 2020 at 11:11 AM Robert Dodier  wrote:
>
> Hi,
>
> I am making some plots with plot() which have a fair number of points
> (thousands) and I would like to be able to interactively select a
> region of the plot and zoom in on it. I tried the zoom package which
> has the function zm() but I found that it was unworkably slow to
> refresh the display. I guess I can set the x and y range via xlim and
> ylim but I was hoping to do it interactively. Does someone have a
> suggestion for that?
>
> I looked at ggplot2 but I wasn't able to find something about
> interactive zooming, only noninteractive via plot limits. Perhaps I
> have overlooked something there?
>
> I have searched the mailing list archive and web pages in general but
> I haven't found anything other than zm(). Thank you in advance for
> your help, I appreciate it very much.
>
> best,
>
> Robert Dodier

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


[R] Options for zooming plots other than zm()

2020-04-25 Thread Robert Dodier
Hi,

I am making some plots with plot() which have a fair number of points
(thousands) and I would like to be able to interactively select a
region of the plot and zoom in on it. I tried the zoom package which
has the function zm() but I found that it was unworkably slow to
refresh the display. I guess I can set the x and y range via xlim and
ylim but I was hoping to do it interactively. Does someone have a
suggestion for that?

I looked at ggplot2 but I wasn't able to find something about
interactive zooming, only noninteractive via plot limits. Perhaps I
have overlooked something there?

I have searched the mailing list archive and web pages in general but
I haven't found anything other than zm(). Thank you in advance for
your help, I appreciate it very much.

best,

Robert Dodier

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