Skip to content

create.project() failing to create .Rproj in the intended directory #321

@3styleJam

Description

@3styleJam

Steps to reproduce:

  1. Open RStudio. Ensure you are NOT in an RStudio project.
  2. Run install.packages("ProjectTemplate") in the console.
  3. Create a new script "letters_script.R" within the directory "C:/Users/your/working/directory/letters"
  4. Insert the following code into the script, save and run:
library("ProjectTemplate")

create.project(
  project.name = "C:/Users/your/working/directory/letters",
  rstudio.project = TRUE,
  merge.strategy = "allow.non.conflict"
)
  1. The console returns:
#> Error in file(con, "w") : cannot open the connection
#> In addition: Warning message:
#> In file(con, "w") :
#>  cannot open file 
#>'C:/Users/your/working/directory/letters/C:/Users/your/working/directory/letters.Rproj': Invalid argument

Viewing the directory in File Explorer shows folders have been created: cache, config, data e.t.c. , and the "letters_script.R" is still there. The problem is the .Rproj file isn't created and from the error message, the function duplicates the "project.name" argument and concatenates onto itself when generating the file path for the .Rproj file. A fix for this would be much appreciated, thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions