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

Unclear usage of local_tempfile #229

Closed
MLopez-Ibanez opened this issue Aug 24, 2023 · 2 comments · Fixed by #246
Closed

Unclear usage of local_tempfile #229

MLopez-Ibanez opened this issue Aug 24, 2023 · 2 comments · Fixed by #246

Comments

@MLopez-Ibanez
Copy link
Contributor

Commit 6a33f3b changed the behavior of local_tempfile without adding an example, and the examples of with_tempfile. The new example does not even make sense.

I think the examples here:

#' @examples

should be:

# Check how big iris would be if written as csv vs RDS
with_tempfile("tf", {write.csv(iris, tf); file.size(tf)})
tf <- local_tempfile()
saveRDS(iris, tf)
file.size(tf)
# Example using lines
tf <- local_tempfile(lines = c("TITLE extra line", "2 3 5 7", "", "11 13 17"))
readLines(tf, n = -1)
@MLopez-Ibanez
Copy link
Contributor Author

Would a pull request be welcome?

@hadley
Copy link
Member

hadley commented Jan 9, 2024

Thanks for the offer, but while looking at this, I realised that the example needed bit more of a overhaul.

hadley added a commit that referenced this issue Jan 9, 2024
@hadley hadley closed this as completed in 5546f00 Jan 10, 2024
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.

2 participants