Skip to content
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

entre windows e linux #31

Open
temospena opened this issue Nov 11, 2021 · 0 comments
Open

entre windows e linux #31

temospena opened this issue Nov 11, 2021 · 0 comments

Comments

@temospena
Copy link
Owner

Many of us have been writing code for Windows and Linux (and OS X ...) for years. Construct yourself little helper functions
isLinux <- function() unname(Sys.info()["sysname"]) == "Linux"

and likewise for Windows. Then construct your path programmatically:

ourRootDir <- function() ifelse( isLinux(), "/opt/data/someThing", "D:/data")

via

datapath <- file.path( ourRootDir(), "project", "some", "where")

and afterwards all actual analysis commands will most likely be portable without change.

Among the 4200+ CRAN package, very few do not exist on all platforms.

Also, data written via save() on one system can be loaded on another and as this is a binary format with compression, you also save a lot of time.

https://stackoverflow.com/questions/14923800/how-to-run-r-code-written-under-windows-in-linux

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant