diff --git a/R/reprex-undo.R b/R/reprex-undo.R
index 6e48607b..fea9c295 100644
--- a/R/reprex-undo.R
+++ b/R/reprex-undo.R
@@ -44,7 +44,9 @@ NULL
#' x
#'
#' # clean up
-#' file.remove(list.files(dirname(tmp),pattern = "roundtrip", full.names = TRUE))
+#' file.remove(
+#' list.files(dirname(tmp_in), pattern = "roundtrip", full.names = TRUE)
+#' )
#' }
reprex_invert <- function(input = NULL,
outfile = NULL,
diff --git a/docs/reference/un-reprex.html b/docs/reference/un-reprex.html
index 9379f2c0..6b0397eb 100644
--- a/docs/reference/un-reprex.html
+++ b/docs/reference/un-reprex.html
@@ -198,7 +198,9 @@
Examp
x
# clean up
-file.remove(list.files(dirname(tmp),pattern = "roundtrip", full.names = TRUE))
+file.remove(
+ list.files(dirname(tmp_in), pattern = "roundtrip", full.names = TRUE)
+)
# }# NOT RUN {
## a displayed reprex can be cleaned of commented output
tmp <- file.path(tempdir(), "commented-code")
diff --git a/man/un-reprex.Rd b/man/un-reprex.Rd
index 2b20b16d..432f6e45 100644
--- a/man/un-reprex.Rd
+++ b/man/un-reprex.Rd
@@ -89,7 +89,9 @@ x <- reprex_invert(x, outfile = tmp_out)
x
# clean up
-file.remove(list.files(dirname(tmp),pattern = "roundtrip", full.names = TRUE))
+file.remove(
+ list.files(dirname(tmp_in), pattern = "roundtrip", full.names = TRUE)
+)
}
\dontrun{
## a displayed reprex can be cleaned of commented output