search for: mustwork

Displaying 20 results from an estimated 25 matches for "mustwork".

2018 Sep 14
1
Suggestion: use mustWork = TRUE as the default for system.file
...vior for system.file() is to return "" for faulty paths. I've found this behavior to be difficult when debugging, since it passes the empty path onto other functions. I initially wrote in errors myself (with code like `if(path == "") stop(?Path not found?)`), but I now use mustWork=TRUE or fs::path_package(), which errors by default. What are the general thoughts on this issue? I would love to see mustWork=TRUE become the default in future versions of R, but I would be happy to hear any counterarguments (or support!) for this suggestion. Cheers, Irene Steves [[alternativ...
2013 Oct 07
0
[Windows] Behaviour of shell on error
Hi, on my R-3.0.2 windows (32bits) no error is thrown occurs when calling a shell command with intern=TRUE, mustWork=TRUE. Is this a intended/known behaviour? >From the source of base::shell it is clear that mustWork is only used when intern=FALSE. This is not that clear from the help page: " Arguments mustWork a logical; if TRUE failure to run the command will give an R error, if FALSE a warning and if...
2020 Mar 23
2
Inconsistant result for normalizePath on Windows
...nce of the folder. I know both results are valid on Windows but this behavior is different than R3.6, I do not know if the change in the devel version is made on purpose. Here is a minimal example, suppose that the folder `C:/windows1/` does not exist. > normalizePath("C:/windows/", mustWork = FALSE) [1] "C:\\Windows" > normalizePath("C:/windows1/", mustWork = FALSE) [1] "C:\\windows1\\" In R 3.6, the return value always ends with a slash if the input ends with a slash. From the NEWS file, It seems like there are some changes to *normalizePath* but no...
2014 Sep 07
2
normalizePath is sometimes very slow for nonexistent UNC paths
...ows machine. I haven't been able to generate slow runs on my Linux machine, though I've had problems with slow running examples submitted to CRAN that I suspect may be caused by this. library(microbenchmark) (timings <- microbenchmark( normalizePath("\\\\some/network/drive", mustWork = FALSE), times = 1e4, unit = "s" )) boxplot(timings) Please can a few people run this code and see if they can reproduce the issue. It isn't clear to me whether this is a bug in R or an underlying OS or network problem. -- Regards, Richie
2015 Mar 11
1
normalizePath output depends on existence of directory
Dear all, I'm not sure whether this is intended behaviour or a bug. The path returns from normalizePath is different when the directory doesn't exist. I have included a reproducible example. path <- tempfile() missing.dir <- normalizePath(path, winslash = "/", mustWork = FALSE) dir.create(path) existing.dir <- normalizePath(path, winslash = "/", mustWork = FALSE) > all.equal(missing.dir, existing.dir) [1] "1 string mismatch" > missing.dir [1] "C:/Users/THIERR~2/AppData/Local/Temp/RtmpagA8Gx/filed5c2cd03543" > existing.di...
2023 Feb 27
1
Undocumented change of dirname("C:/") on R-devel on Windows
Hi Tomas, There has been an R CMD check error with xfun and r-devel on Windows for a while: https://www.r-project.org/nosvn/R.check/r-devel-windows-x86_64/xfun-00check.html Basically it means that the following would return TRUE before: normalizePath('a/b', mustWork = FALSE) == normalizePath('./a/b', mustWork = FALSE) but it became FALSE at some point in r-devel. I think 'a/b' and './a/b` should be treated as the same path. Does that make sense? Thanks! Regards, Yihui -- https://yihui.org On Thu, Feb 23, 2023 at 11:44 PM Hiroaki Yutani...
2017 May 17
1
problem running test on a system without /etc/localtime
...o be present on >> any platform. And anyway, it is a good idea to first check that file >> exists before calling normalizePath. > Looking at the code > (https://github.com/wch/r-source/blob/R-3-4-branch/src/library/base/R/datetime.R#L26), > could it be that mustWork = FALSE (instead of the default NA) avoids > the warning causes this check error? Good idea. Kirill, could you apply the minimal patch to the sources and report back ? > Index: src/library/base/R/datetime.R > =================================================================...
2017 May 17
3
problem running test on a system without /etc/localtime
Hi all, A problem with tests while building R. I'm packaging R for Sisyphus repository and package build environment, by design, doesn't have /etc/localtime file present. This causes failure with Sys.timeone during test run: [builder at localhost tests]$ ../bin/R --vanilla < reg-tests-1d.R > ## PR#17186 - Sys.timezone() on some Debian-derived platforms > (S.t <-
2020 Mar 23
0
Inconsistant result for normalizePath on Windows
...both results are valid on Windows but this behavior > is different than R3.6, I do not know if the change in the devel version is > made on purpose. Here is a minimal example, suppose that the folder > `C:/windows1/` does not exist. > > > normalizePath("C:/windows/", mustWork = FALSE) > [1] "C:\\Windows" >> normalizePath("C:/windows1/", mustWork = FALSE) > [1] "C:\\windows1\\" > > > In R 3.6, the return value always ends with a slash if the input ends with > a slash. From the NEWS file, It seems like there are some c...
2018 Jul 06
0
NEWS vs. inst/NEWS
...quot;, instFile, " file from the source package's inst directory")) } dir.create(lib <- file.path(tdir, "lib")) install.packages(lib=lib, srcPkg, repos=NULL, type="source") sapply(instFiles, function(instFile) readLines(system.file(package=pkgName, lib.loc=lib, mustWork=TRUE, instFile))) # unlink(recursive=TRUE, tdir) # to clean up The final sapply() gives me > sapply(instFiles, function(instFile) readLines(system.file(package=pkgName, lib.loc=lib, mustWork=TRUE, instFile))) NEWS...
2017 May 17
0
problem running test on a system without /etc/localtime
...clatime is optional and is not guaranteed to be present on > any platform. And anyway, it is a good idea to first check that file > exists before calling normalizePath. Looking at the code (https://github.com/wch/r-source/blob/R-3-4-branch/src/library/base/R/datetime.R#L26), could it be that mustWork = FALSE (instead of the default NA) avoids the warning causes this check error? Index: src/library/base/R/datetime.R =================================================================== --- src/library/base/R/datetime.R (revision 72684) +++ src/library/base/R/datetime.R (working copy) @@ -23,7 +23,...
2013 Apr 27
3
path reference problems in R 3.0.0
...286 bytes (1.3 Mb) opened URL downloaded 1.3 Mb Error in install.packages : path[1]="c:\Docume~1\melissa\R\win-library\3.0": Access is denied At that point, I noticed that a similar error was occurring when R loads: Warning message: In normalizePath(path.expand(path), winslash, mustWork) : path[1]="c:/Docume~1/melissa/R/win-library/3.0": Access is denied The relevant directory does exist, although it keeps getting set to "read-only". I can't imagine that being a big issue if I'm running R as an administrator though C:\Users\melissa\R\win-library...
2011 May 02
1
Problems with Rterm 2.13.0 - but not RGui
Hi all, I have just installed R 2.13.0 and I am experiencing problems with the terminal, but not the with the GUI interface. I am Windows 7. When running "R" or "Rterm" from a commandline I receive the following: Warning message: In normalizePath(path.expand(path), winslash, mustWork) : path[3]="C:/Programmer/R/R-2.13.0/library": Adgang n?gtet R version 2.13.0 (2011-04-13) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i386-pc-mingw32/i386 (32-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome...
2013 Jul 17
1
SweaveParseOptions, quoted commas, and knitr vignettes
I haven't figured it out entirely, but it looks like there are a couple of small glitches with knitr-based vignettes and SweaveParseOptions. I posted the tarball of a package with a knitr vignette with (as far as I can tell) everything properly coded in the DESCRIPTION file (VignetteBuilder: knitr, Suggests: knitr) and the vignette itself (%\VignetteEngine{knitr::knitr}). When Windows
2023 Feb 24
1
Undocumented change of dirname("C:/") on R-devel on Windows
I confirmed the revert fixed my failing test. Thanks! 2023?2?23?(?) 20:12 Hiroaki Yutani <yutani.ini at gmail.com>: > Thanks for the prompt response, I'll confirm it after the new R-devel > binary is available. > Also, thanks for the detailed explanation. I agree with you in general. > > > "/" in "C:/" is a path separator or not, and whether it is
2013 Jul 14
1
Redirect system2 stdout to a file on windows
According to the manual, the `stdout` argument of the `system2` function can redirect output to a file. This seems to work on unix, however I can't get it to work on windows. The toy example below, no `out.txt` or `err.txt` files are created. I tried sending it to an existing file, or expand the full file path, but with no success: setwd(tempdir()) system2("whoami",
2020 Jun 10
4
Possible Bug: file.exists() Function. Due to UTF-8 Encoding differences on Windows between R 4.0.1 and R 3.6.3?
...ies_find_impl, root = root) 9: renv_dependencies_find(path, root) 8: (function (path = getwd(), root = NULL, ..., progress = TRUE, errors = c("reported", "fatal", "ignored"), dev = FALSE) { path <- renv_path_normalize(path, winslash = "/", mustWork = TRUE) root <- root %||% renv_dependencies_root(path) if (exists(path, envir = `_renv_dependencies`)) return(get(path, envir = `_renv_dependencies`)) renv_dependencies_begin(root = root) on.exit(renv_dependencies_end(), add = TRUE) dots <- list(....
2020 Jun 22
2
Possible Bug: file.exists() Function. Due to UTF-8 Encoding differences on Windows between R 4.0.1 and R 3.6.3?
...ncies_find(path, root) > > 8: (function (path = getwd(), root = NULL, ..., progress = TRUE, > > errors = c("reported", "fatal", "ignored"), dev = FALSE) > > { > > path <- renv_path_normalize(path, winslash = "/", mustWork = TRUE) > > root <- root %||% renv_dependencies_root(path) > > if (exists(path, envir = `_renv_dependencies`)) > > return(get(path, envir = `_renv_dependencies`)) > > renv_dependencies_begin(root = root) > > on.exit(renv_d...
2020 Jun 10
0
Possible Bug: file.exists() Function. Due to UTF-8 Encoding differences on Windows between R 4.0.1 and R 3.6.3?
...> 9: renv_dependencies_find(path, root) > 8: (function (path = getwd(), root = NULL, ..., progress = TRUE, > errors = c("reported", "fatal", "ignored"), dev = FALSE) > { > path <- renv_path_normalize(path, winslash = "/", mustWork = TRUE) > root <- root %||% renv_dependencies_root(path) > if (exists(path, envir = `_renv_dependencies`)) > return(get(path, envir = `_renv_dependencies`)) > renv_dependencies_begin(root = root) > on.exit(renv_dependencies_end(), add =...
2020 Jun 22
0
Possible Bug: file.exists() Function. Due to UTF-8 Encoding differences on Windows between R 4.0.1 and R 3.6.3?
..., root) >>> 8: (function (path = getwd(), root = NULL, ..., progress = TRUE, >>> errors = c("reported", "fatal", "ignored"), dev = FALSE) >>> { >>> path <- renv_path_normalize(path, winslash = "/", mustWork = TRUE) >>> root <- root %||% renv_dependencies_root(path) >>> if (exists(path, envir = `_renv_dependencies`)) >>> return(get(path, envir = `_renv_dependencies`)) >>> renv_dependencies_begin(root = root) >>>...