Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RStudio Project Template #127

Open
howardbaik opened this issue Apr 26, 2024 · 5 comments · May be fixed by #128
Open

RStudio Project Template #127

howardbaik opened this issue Apr 26, 2024 · 5 comments · May be fixed by #128

Comments

@howardbaik
Copy link
Contributor

The goal is to give user the option to create a Quarto Based OTTR course with RStudio Project Templates.

The plan is to create a function in this repo, create_rstudio_project_template()

create_rstudio_project_template <- function(path, ...) {
  # ensure path exists
  dir.create(path, recursive = TRUE, showWarnings = FALSE)

 # For each file in the ottr repo,
 # Step 1. Collect inputs and paste together as 'Parameter: Value'
  dots <- list(...)
  text <- lapply(seq_along(dots), function(i) {
    key <- names(dots)[[i]]
    val <- dots[[i]]
    paste0(key, ": ", val)
  })

 # Step 2. Collect into single text string
  contents <- paste(
    paste(header, collapse = "\n"),
    paste(text, collapse = "\n"),
    sep = "\n"
  )

  # Step 3. Write to file
  writeLines(contents, con = file.path(path, "FILE_NAME_HERE"))
 
 # Repeat Steps 1~3 for each file
}

This way, we can accept user inputs inside an GUI and automatically setup an OTTR repo without having the user open a config file and manually configure things.

@howardbaik
Copy link
Contributor Author

@howardbaik
Copy link
Contributor Author

I couldn't get this working inside ottrpal, so I've created a separate R package that does this: https://github.com/fhdsl/ottrtemplate

@howardbaik
Copy link
Contributor Author

howardbaik commented May 6, 2024

As a matter of fact, the issue might be with the size of the ottr logo: https://stackoverflow.com/a/78411165/14804653

Let me confirm this. @cansavvy

@howardbaik
Copy link
Contributor Author

howardbaik commented May 6, 2024

Indeed, the issue was with the size of the image file.

Once I transfer over work I've done in ottrtemplate to ottrpal, I'll delete the repo for ottrtemplate to reduce redundancy.

@howardbaik
Copy link
Contributor Author

howardbaik commented May 7, 2024

Work has been transferred to https://github.com/jhudsl/ottrpal/tree/127-rstudio-project-template and ottrtemplate has been deleted.

@howardbaik howardbaik linked a pull request May 10, 2024 that will close this issue
@howardbaik howardbaik linked a pull request May 10, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant