Skip to content

wd() fails without paramater path #374

Closed

Description

@thomaskern

Function wd() throws an exception when parameter path is left untouched, even inside a package.

setwd("~/ggplot2")
wd()

results in

> wd()
Error in if (!file.exists(path)) { : argument is of length zero
> traceback()
1: wd()

On the other hand, passing an empty character vector works:

wd(path="")
Changing working directory to /Users/bosie/ggplot2/

I would argue that according to the docs, this behavior is not expected. If it is, the default value NULL for parameter path should be removed and path should not be optional but mandatory.

Setup:

> sessionInfo()
R version 3.0.2 (2013-09-25)
Platform: x86_64-apple-darwin10.8.0 (64-bit)

locale:
[1] en_GB.UTF-8/en_GB.UTF-8/en_GB.UTF-8/C/en_GB.UTF-8/en_GB.UTF-8

attached base packages:
[1] graphics  grDevices utils     datasets  stats     methods   base     

other attached packages:
 [1] ggHorizon_0.1      roxygen2_2.2.2     digest_0.6.3       proto_0.3-10       RColorBrewer_1.0-5
 [6] plyr_1.8           maps_2.3-6         devtools_1.3       ggplot2_0.9.3.1.99 vimcom.plus_0.9-9 

loaded via a namespace (and not attached):
 [1] brew_1.0-6       colorspace_1.2-4 dichromat_2.0-0  evaluate_0.5.1   grid_3.0.2       gtable_0.1.2    
 [7] httr_0.2         labeling_0.2     MASS_7.3-29      memoise_0.1      munsell_0.4.2    parallel_3.0.2  
[13] RCurl_1.95-4.1   reshape2_1.2.2   scales_0.2.3     stringr_0.6.2    tools_3.0.2      whisker_0.3-2   

Activity

  1. locked and limited conversation to collaborators on Sep 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions