You should be able to do this by using relative directory paths. This is what I do for my R projects that I have in Dropbox and that I edit/run on both my Windows and OS X machines where the Dropbox folder is D:/Dropbox
and /Users/robin/Dropbox
respectively.
To do this, you'll need to
Set the current working directory in R (either in the first line of your script, or interactively at the console before running), using
setwd('/Users/robin/Dropbox;)
(see the full docs for that command).Change your paths to relative paths, which mean they just have the bit of the path from the current directory, in this case the
'ProjectA/source1'
bit if you've set your current directory to your Dropbox folder, or just'source1'
if you've set your current directory to the ProjectA folder (which is a better idea).
Then everything should just work!
You may also be interested in an R library that I love called ProjectTemplate - it gives you really nice functionality for making self-contained projects for this sort of work in R, and they're entirely reproducible, moveable between computers and so on. I've written an introductory blog post which may be useful.