Path differences between Win XP, Win 7 & Linux

0 views
Skip to first unread message

Mark Knecht

unread,
Nov 17, 2010, 6:05:10 PM11/17/10
to Bay Area R Helpers
Hi,
I've worked on Win XP for a long time, and used R-gui over the last
year to learn the language a bit. Typically my R programs start off
with a block of code like this:

require(reshape)
require(TTR)
require(ggplot2)
require(chron)

### Requires MWKFunctions.R be loaded first
source("C:/Users/Mark/Documents/R/MWKFunctions/MWKFunctions.R")

Unfortunately Win XP and Win 7 use different user paths, and Linux
is different again:

source("C:/Users/Mark/Documents/R/MWKFunctions/MWKFunctions.R")
source("C:/Users/Mark/My Documents/R/MWKFunctions/MWKFunctions.R")
source("/home/mark/R/MWKFunctions/MWKFunctions.R")

Is there a better way to write this code so it works on all
platforms without changes?

Thanks,
Mark

Ajay Ohri

unread,
Nov 17, 2010, 10:24:01 PM11/17/10
to Mark Knecht, Bay Area R Helpers
go to amazon ec2

Websites-
http://decisionstats.com
http://dudeofdata.com


Linkedin- www.linkedin.com/in/ajayohri

> --
> You are subscribed to the Google Groups "Bay Area UseRs!" group.
> To post, email to bay-are...@googlegroups.com
> To unsubscribe, email bay-area-use-...@googlegroups.com
> For more info, visit http://groups.google.com/group/bay-area-use-Rs?hl=en

Reply all
Reply to author
Forward
0 new messages