pathtopath | R Documentation |
pathtopath combines two paths, the second of which could include a filename, while taking into account the type of separator. It also prevents a doubling up or missing out of said separator between the two paths being joined. If the separator type differs between the two input paths the functions stops with a warning.
pathtopath(path1, path2)
path1 |
the first path to be added together |
path2 |
the second path which is to be added to the first. This may include a filename is so desired. |
the combined path
in1 <- "c:/users/Malcolm/DropBox"
in2 <- "aMSEUse/scenarios/EG"
pathtopath(in1, in2) # no separator character between the paths
in2 <- "/aMSEUse/scenarios/EG"
pathtopath(in1, in2) # path2 with a separator
in1 <- "c:/users/Malcolm/DropBox/"
pathtopath(in1, in2) # both paths with a separator
in1 <- "c:\\users\\Malcolm\\DropBox"
in2 <- "aMSEUse\\scenarios\\EG"
pathtopath(in1, in2) # a different separator but missing from both
in2 <- "/aMSEUse/scenarios/EG"
pathtopath(in1, in2) # a different separators
in1 <- "c:/users/Malcolm/dropbox/"
in2 <- "aMSEUse\\scenarios\\EG"
pathtopath(in1, in2) # a different separators the other way around
in2 <- "filename.csv"
pathtopath(in1, in2) # join path to filename that has no spearator
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.