-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
r2d3 visualization working on Windows, not on Mac #71
Comments
Solution, unfortunately, found. On Macs/Unix-based systems, you can't use the double backslash to refer to file references ("\"). You have to use forward slashes ("/"). So the solution for the above piece of code would be:
Closing this issue (though hopefully some woefully unknowing windows user like me finds this helpful!). |
Use forward slashes are valid on both Windows & Posix systems so is generally how all path references are composed in R. |
If you're on windows, the above double backslashing reference would work (this is easier to add one backslash when copying references from windows). So this isn't well known for people like me, who work almost exclusively in a windows environment. But good to know for me for the future! |
Okay, in order to write code that works on multiple systems (important if
you are developing code that will be used by others or deployed to a
server) it's best practice to use "/". You can also use the R file.path
function to automatically use the right separator on whatever platform you
are running on.
…On Wed, Jul 24, 2019 at 10:39 AM Hannah De los Santos < ***@***.***> wrote:
If you're on windows, the above double backslashing reference would work
(this is easier to add one backslash when copying references from windows).
So this isn't well known for people like me, who work almost exclusively in
a windows environment.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#71?email_source=notifications&email_token=AAAZPRZC6P7NZ3CY3RY7M5DQBCASZA5CNFSM4IFL7WT2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2W5F3A#issuecomment-514708204>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAZPRZUBJTCNO4XYBPK4ZLQBCASZANCNFSM4IFL7WTQ>
.
|
Wow, great to know about the "file.path" command! Thank you for the tip! |
Hi, I've run into an issue that r2d3 seems to be acting quite differently on Windows versus Macs. I am trying to render a specific set of r2d3 visualizations in a Shiny app, one of them being a Sankey diagram (in my example code, attached, this is particularly simple, with 1 link and 2 nodes).
On Windows, this visualization appears perfectly in Shiny in an external window (Firefox/Chrome):
However, when running the same Shiny app on a Mac, nothing appears. Looking at the developer console, the error "TypeError: data.charCodeAt is not a function" appears, which seems to be from the r2d3-render.js script.
Is there any reason why this would be the case, and how would I fix it? The R code can be found below, and supporting JavaScript files can be found here.
r2d3 version: 0.2.3
Windows 10, Firefox v68.0, Chrome v75.0.3770.142
macOS Sierra v10.12.6, Firefox v67.0.2
The text was updated successfully, but these errors were encountered: