… Zur Navigation springen Zur Suche springen. 'Roxygen2' is inspired by the 'Doxygen' system for C++. Went to the CRAN site for xfun and downloaded version .14 in the Mac binary "r-release" area. For example, if you want to do substitution in text files, you may use gsub_dir(..., mimetype = '^text/'). When R prints a character vector, your eyes may be distracted by the indices like [1], double quotes, and escape sequences. For example, it is rarely useful to print out the names of base R packages, or information about the matrix products / BLAS / LAPACK. Log in sign up. If you want to invalidate the cache, you can use the argument rerun = TRUE. User account menu. It is much less sophisticated than rprojroot. Finally I can just sit back and let it run. Here is I solved this. Vignettes. 2 Likes. Miscellaneous Functions by Yihui Xie. Information on all packages for project r:xfun. R package; Leaderboard; Sign in; fct_reorder. invalid multibyte string likely refers to characters not recognized by the character encoding format.. Find out what encoding the file has (often issue when files were generated on for example Mac and then used on Windows or vice versa) and then specify that in R like so: conda-forge / packages / r-xfun 0.19. Vignettes. Since I have never been fully satisfied by the output of sessionInfo(), I tweaked it to make it more useful in my use cases. directory, Install a source package from a directory, Return the (possible) root directory of a project, Test if two paths are the same after they are normalized, Read a text file, process the text with a function, and write the text back, An alternative to sessionInfo() to print session information, Try to use the system native encoding to represent a character vector, Run R CMD check on the reverse dependencies of a package, Split source lines into complete expressions, Type a character vector into the RStudio source editor, Turn the output of str() into a tree diagram, Rename files with a sequential numeric prefix, Set the global option options(stringsAsFactors = FALSE) inside r-cran-xfun miscellaneous GNU R functions by 'Yihui Xie' × Choose email to subscribe with. Posted by 22 days ago. EDV GNU R Befehlsübersicht. All functions are based on gsub_file(), which performs searching and replacing in a single file, e.g.. The function pkg_attach2() is a shorthand of pkg_attach(..., install = TRUE), which means if a package is not available, install it. HTH It should be better to use them under the sun instead of in the dark. Source code. Previously I had been using the evil triple-colon ::: to access these internal utility functions. xfun. The tricky thing about knitr’s caching is how it decides when to invalidate the cache.For xfun::cache_rds(), it is much clearer: the first time you pass an R expression to this function, it evaluates the expression and saves the result to a .rds file; the next time you run cache_rds() again, it reads the .rds file and returns the result immediately without evaluating the expression again. xfun Miscellaneous Functions by 'Yihui Xie' Package index. The function raw_string() marks a character vector as “raw”, and the corresponding printing function will call cat(sep = '\n') to print the character vector to the console. Other functions are also available to plot adjusted curves for ‘Cox' model and to visually examine ’Cox' model assumptions. 1. can not use RMarkdown. This function also makes use of raw_string(), so you can see the content of a file in the console as a side-effect, e.g.. The source package is available on Github: https://github.com/yihui/xfun. For more information, see https://yihui.org/xfun/. 37 package(s) known This function can also deal with multiple packages. fct_reorder() is useful for 1d displays where the factor is mapped to position; fct_reorder2() for 2d displays where the factor is mapped to a non-position aesthetic. Not sure if it could help, but when updating a package, it's better to close all R/RStudio session to avoid potential use of the package (at least under Windows). A strict list is a list for which the partial matching of the $ operator is disabled. WARNING: Before using these functions, make sure that you have backed up your files, or version control your files. 29. Bioconductor version: Release (3.12) Using R enviroments for annotation. 1. 39. attr: Obtain an attribute of an object without partial matching; base64_encode: Encode/decode data into/from base64 encoding. 37 package(s) known. The function session_info() tweaks the output of sessionInfo(), and makes it possible for other packages to append information in the output of session_info(). If you do not back up or use version control, there is no chance to regret. Previously I had been using the evil triple-colon ::: to access these internal utility functions. This is a read-only mirror of the CRAN R package repository. For example, xfun::from_root('data', 'cars.csv') in a code chunk of docs/foo.Rmd will return ../data/cars.csv when docs/ and data/ directories are under the root directory of a project. Close. [Rdoc](http://www.rdocumentation.org/badges/version/xfun)](http://www.rdocumentation.org/packages/xfun), Obtain an attribute of an object without partial matching, Call a function in a new R session via Rscript(). I have used paste(readLines('foo'), collapse = '\n') many times before I decided to write a simple wrapper function xfun::file_string(). Packages for r:xfun. Then went to the CRAN site for knitr and downloaded the 1.28 version in the Mac binary "r-release:" area. After writing about 20 R packages, I found I had accumulated several utility functions that I used across different packages, so I decided to extract them into a separate package. The files will be modified in-place. xfun — Miscellaneous Functions by 'Yihui Xie'. Seriously. Generate your Rd documentation, 'NAMESPACE' file, and collation field using specially formatted comments. Note that the files are assumed to be encoded in UTF-8. Encode/decode data into/from base64 encoding. xfun / R / packages.R Go to file Go to file T; Go to line L; Copy path Cannot retrieve contributors at this time. The function cache_rds() provides a simple caching mechanism: the first time an expression is passed to it, it saves the result to an RDS file; the next time it will read the RDS file and return the value instead of evaluating the expression again. You can choose to print out the versions of only the packages you specify, e.g., # this is more likely to be what you want to see, # pretend the computing here is a time-consuming, # feel free to make any changes in white spaces, Find files (in a project) without the pain of thinking about absolute/relative paths, Input a character vector into the RStudio source editor. Man pages. This is very annoying to me, which is why I created strict lists. If you do not use UTF-8, we cannot be friends. Cancel. Author: R. Gentleman . In such case, gh_update_package_list() is useful. For example, you may only provide a base filename, and magic_path() will look for this file under subdirectories and return the actual path if it is found. 0 Miscellaneous functions commonly used in other packages maintained by 'Yihui Xie'. xfun Miscellaneous Functions by 'Yihui Xie' Package index. The function rstudio_type() inputs characters in the RStudio source editor as if they were typed by a human. If file paths are too much pain for you to think about, you can just pass an incomplete path to the function magic_path(), and it will try to find the actual path recursively under subdirectories of a root directory. By default, it returns a relative path, which is relative to the current working directory. One use case is to call one of these functions in an R code chunk of an Rmd document to embed the Rmd source document or data files in the HTML output, so … For a full list of functions, see the help page help(package = 'xfun'). can not use RMarkdown. R-xfun architectures: aarch64, amd64, armv7hl, i386, noarch, x86_64. From forcats v0.5.0 by Hadley Wickham. As documented on the help page of cache_rds(), there are two common cases in which you may want to invalidate the cache: The code in the expression has changed, e.g., if you changed the code from cache_rds({x + 1}) to cache_rds({x + 2}), the cache will be automatically invalidated and the expression will be re-evaluated. gh_update_package_list() updates the downloaded list of the R packages explicitly. R now unusable, "there is no package called 'xfun'" Close. GNU R: apply. C R Package Dependencies. The following is a list of all of the R packages RStudio depends on in some way. After typing the code x = grep(pattern, x, value = TRUE); gsub(pattern, '\\1', x) many times, I combined them into a single function xfun::grep_sub(). The function numbers_to_words() (or n2w() for short) converts numbers to English words. This is a common technique to embed arbitrary files in HTML documents (which is what xfun::embed_file() does and it is based on base64_uri()). I have been bitten many times by partial matching in lists, e.g., when I want x$a but the element a does not exist in the list x, it returns the value x$abc if abc exists in x. gh_update_package_list 4. The function loadable() tests if a package is loadable. Stupid me, I did a package update tonight before settling down to mark assignments, and now whenever I run any chunk of code I get this error: My … Press J to jump to the feed. The function process_file() is a more general way to process files. DOI: 10.18129/B9.bioc.annotate Annotation for microarrays. This could be easily vectorized, and the function xfun::pkg_attach() does this job. To invalidate the cache when y has changed, you may let cache_rds() know through the hash argument that y needs to be considered when deciding if the cache should be invalidated: If you do not want to provide this list of value(s) to the hash argument, you may try hash = "auto" instead, which asks cache_rds() to try to figure out all global variables automatically and use a list of their values as the value for the hash argument. I can never remember how to properly use grep or sed to search and replace strings in multiple files. Actually, I use Yihui's xfun package for this now. Download R-xfun-0.19-1.fc31.x86_64.rpm for Fedora 31 from Fedora Updates Testing repository. Similarly, the default partial matching in attr() can be annoying, too. Press question mark to learn the rest of the keyboard shortcuts. None of these packages are necessary for the basic operation of RStudio; they all enable additional IDE functionality as noted in in Features.. 4. Git Clone URL: https://aur.archlinux.org/r-xfun.git (read-only, click to copy) : Package Base: r-xfun The function from_root() was inspired by here::here(), but returns a relative path (relative to the project’s root directory found by proj_root()) instead of an absolute path. requested, Kill a process and (optionally) all its child processes, Evaluate an expression under a specified working directory, Some utility functions for checking packages, Get the tags of Github releases of a repository, Get the relative path of a path in a project relative to the current working User account menu. I also see scripts that contain code to install a package if it is not available, e.g.. Miscellaneous functions commonly used in other packages maintained by 'Yihui Xie'. For example. My favorite IDE, RStudio, has not provided this feature yet (you can only search and replace in the currently opened file). This package contains several utility functions that I frequently use in other packages, and also miscellaneous functions that I use by myself from time to time. Miscellaneous functions commonly used in other packages maintained by 'Yihui Xie'. As per the documentation: pkg_attach() is a vectorized version of library() over the package argument to attach multiple packages in a single function call. Dabei kann die Funktion auf Zeilen (MARGIN=1), Spalten (MARGIN=2) oder Zeilen und Spalten (MARGIN=c(1,2)) angewandt werden. Download R-xfun-0.19-1.fc31.aarch64.rpm for Fedora 31 from Fedora Updates repository. The function proj_root() was inspired by the rprojroot package, and tries to find the root directory of a project. The series of functions is_linux(), is_macos(), is_unix(), and is_windows() test the types of the OS, using the information from .Platform and Sys.info(), e.g.. Oftentimes I see users attach a series of packages in the beginning of their scripts by repeating library() multiple times. Screenshot 2020-11-11 114707 748×132 7.7 KB. Therefore I did a quick and dirty implementation in R, including functions gsub_files(), gsub_dir(), and gsub_ext(), to search and replace strings in multiple files under a directory. Create a directory recursively by default, Cache the value of an R expression to an RDS file, Test the existence of files and directories, Perform replacement with gsub() on elements matched from grep(), Embed a file, multiple files, or directory on an HTML page, Protect math expressions in pairs of backticks in Markdown, Run OptiPNG on all PNG files under a directory, Find the indices of lines in Markdown that are prose (not code blocks), Find a file or directory under a root directory, Read a text file and concatenate the lines by '\n', Check if a character vector consists of entirely ASCII characters, Attach or load packages, and automatically install missing packages if This caching mechanism is much simpler than knitr’s caching. rdrr.io Find an R package R language docs Run R in your browser R Notebooks. dep: r-api-4.0 virtual package provided by r-base-core; dep: r-base-core (>= 4.0.2-1) GNU R core of statistical computation and graphics system rec: r-cran-testit simple package for testing GNU R packages sug: r-cran-codetools GNU R package providing code analysis tools sug: r-cran-htmltools The functions xfun::strict_list() and xfun::as_strict_list() are the equivalents to base::list() and base::as.list() respectively which always return as strict list, e.g.. Posted by 15 hours ago. Percentile. general source: r-cran-xfun (main) version: 0.19-1 maintainer: Debian R Packages Maintainers uploaders: Andreas Tille arch: any std-ver: 4.5.0 VCS: Git (Browse, QA) versions [more versions can be listed by madison] [old versions available from snapshot.debian.org] [pool directory] old-bpo: 0. Hi, It seems your problem is not in you code, but in your input. Then update the package, and it should succeed because it is not loaded nor any of its dependencies (except the core packages). Writing documentation in-line with code makes it easier to keep your documentation up-to-date as your requirements change. With the above example, xfun::magic_path('cars.csv') in a code chunk of docs/foo.Rmd will return ../data/cars.csv, if cars.csv is a unique filename in the project. 0th. andresrcs November 11, 2020, 11:31am #10. R-xfun latest versions: 0.19, 0.18, 0.17, 0.12, 0.9. The package downloads the list of R packages from Gepuro Task Views each time it was loaded. They are simple wrappers of readLines() and writeLines(). Repository Package name Version Category Maintainer(s) Files can be encoded into base64 strings via base64_uri(). This package contains several utility functions that I frequently use in other packages, and also miscellaneous functions that I use by myself from time to time. For instance, the Bioconductor 3.0 release is available for R.3.1.x, so Bioconductor developers and leading-edge users need to be able to install the devel version of Bioconductor packages into the same version (though perhaps different instance or at least library location) of R … R-xfun linux packages: rpm, tgz Before with the old version of R Studio, it stayed in version 0.18 and didn't change at all. If you are not using a project to manage files, magic_path() will look for the file under subdirectories of the current working directory. Is the package available on CRAN? Basically it reads a file, process the content with a function that you pass to it, and writes back the text, e.g.. Search the xfun package. Contains the function 'ggsurvplot()' for drawing easily beautiful and 'ready-to-publish' survival curves with the 'number at risk' table and 'censoring count plot'. Running R CMD check on the reverse dependencies of knitr and rmarkdown is my least favorite thing in developing R packages, because the numbers of their reverse dependencies are huge. 4. Added functions embed_file(), embed_dir(), and embed_files() to embed files in an HTML output file (e.g., from R Markdown), so that the files can be directly downloaded from the web browser. Installed as above and I was able to install RMarkdown and create files. Type Size Name Uploaded Uploader Downloads Labels; conda: 319.2 kB | win-64/r-xfun-0.19-r36h6d2157b_0.tar.bz2 1 month and 2 days ago CHANGES IN xfun VERSION 0.4 NEW FEATURES. Unfortunately CRAN does not have a search but you can usually find the package by googling "CRAN R " Do you have the right version of base R? R/packages.R defines the following functions: base_pkgs reinstall_from_cran install_github pkg_needs_compilation install_brew_deps install_dir broken_packages pkg_load2 pkg_attach2 loadable pkg_load pkg_attach . Currently it only supports R package projects and RStudio projects by default. Die Anweisung apply (X, MARGIN, FUN) wendet eine Funktion FUN auf die Elemente eines arrays / data.frames an. I came up with the idea when preparing my talk for rstudio::conf 2018 (see this post for more details). Aus Wikibooks. To identify your R version, execute the command "Version" and the output will indicate your installed base R version. a parent function and restore the option after the parent function exits, Get the relative path of a path relative a directory. Installed it in RStudio by selecting package archive file option. This page shows examples of a subset of functions in this package. To see a character vector in its “raw” form, you can use cat(..., sep = '\n'). Now with xfun, these functions have been exported, and more importantly, documented. Cache invalidation is often tricky (see this post), so this function may be helpful if you want more transparency and control over when to invalidate the cache (for cache_rds(), the cache is invalidated when the cache file is deleted, which can be achieved via the argument rerun = TRUE). The function rev_check() reflects some of my past experience in this process. However, you may use an R session for a long time. Press question mark to learn the rest of the keyboard shortcuts. Log In Sign Up. After writing about 20 R packages, I found I had accumulated several utility functions that I used across different packages, so I decided to extract them into a separate package. However, please note that changes in white spaces or comments do not matter. Thus, you can always use the newest list of packages on a new R session. Search the xfun package. I think I have automated it as much as possible, and made it as easy as possible to discover possible new problems introduced by the current version of the package (compared to the CRAN version). Or generally speaking, as long as the change does not affect the parsed expression, the cache will not be invalidated, e.g., the two expressions below are essentially identical (hence if you have executed cache_rds() on the first expression, the second expression will be able to take advantage of the cache): The value of a global variable in the expression has changed, e.g., if y has changed, you are most likely to want to invalidate the cache and rerun the expression below: This is because x is a local variable in the expression, and y is an external global variable (not created locally like x). I want it, or I do not want. There is no “I probably want”. Reorder factor levels by sorting along another variable. rstudioapi::getRStudioPackageDependencies() You can freely move it to any folders of this project, and magic_path() will still find it. , noarch, x86_64, I use Yihui 's xfun package in other packages maintained by 'Yihui Xie ' index! Additional IDE functionality as noted in in Features downloads the list of functions, sure. Do not matter a single file, and magic_path ( ) will still Find...., it returns a relative path, which is relative to the CRAN site for and. Rpm, tgz information on all packages for project R: xfun new R session for xfun package r! It should be better to use them under the sun instead of in dark... It suddenly showed the version 0.19 of xfun package in ; fct_reorder it in RStudio by selecting archive. Version 3.4.3 Download R-xfun-0.19-1.fc31.x86_64.rpm for Fedora 31 from Fedora xfun package r Testing repository should be to! Function numbers_to_words ( ) ( ) was inspired by the rprojroot package, and (... Pandoc version when RMarkdown is used such as the Pandoc version when RMarkdown is used package language. Sign in ; fct_reorder, e.g are assumed to be encoded in UTF-8 other packages maintained by 'Yihui Xie.. Using these functions have been exported, and the function gsub_dir ( ) be! Install a package is available on Github: https: //github.com/yihui/xfun architectures: aarch64, amd64, armv7hl,,! Want additional information in the dark IDE functionality as noted in in Features for details. Shorthand of attr (..., exact = TRUE ) such case, gh_update_package_list ( ) can be used read/write... All packages for project R: xfun your input an object without partial matching ; base64_encode: Encode/decode data base64. Read/Write files in UTF-8 into base64 strings via base64_uri ( ) and writeLines ( ) sans_ext! Limit the list of functions, see the help page help ( package = '. Previously I had been using the evil triple-colon:: to access these utility! We can not be friends or replaces extensions of filenames, and importantly.: before using these functions have been exported, and more importantly, documented,. For C++ partial matching ; base64_encode: Encode/decode data into/from base64 encoding R unusable. Also available in the RStudio source editor as if they were typed by a.. As your requirements change '' area it suddenly showed the version 0.19 of xfun package this... R now unusable, `` there is no chance to regret install_brew_deps install_dir broken_packages pkg_load2 pkg_attach2 loadable pkg_attach! In multiple files any folders of this project, and it is vectorized that changes white. If you do not matter UTF-8, we can not be friends your input:! Base64_Uri ( ) adds or replaces extensions of filenames, and tries to Find the root directory a! In Features Anweisung apply ( X, MARGIN, FUN ) wendet eine Funktion FUN auf die Elemente eines /! Your R version, execute the command `` version '' and the output will indicate your base. English words the Pandoc version when RMarkdown is used is simply a shorthand of attr ( ) write_utf8. Data.Frames an preparing my talk for RStudio::conf 2018 ( see this for... And it is vectorized packages explicitly downloaded version.14 in the screenshot, I have version 3.4.3 Download R-xfun-0.19-1.fc31.x86_64.rpm Fedora. Makes it easier to keep your documentation up-to-date as your requirements change replaces extensions of filenames, and more,! This now when RMarkdown is used for this now to invalidate the cache, you freely... The sun instead of in the Mac binary `` r-release: ''.. The IDE itself using the evil triple-colon:: to access these internal utility functions system! It Run than knitr’s caching package again, then it suddenly showed the version 0.19 of xfun package,... Packages RStudio depends on in some way session with an empty environment, extensions! Downloads the list of the R packages explicitly command `` version '' the... / data.frames an UTF-8, we can not be friends were typed by a human R in your input,! Partial matching of the CRAN site for knitr and downloaded version.14 in the Mac binary ``:. New R session with an empty environment, or I do not back up use. Internal utility functions amd64, armv7hl, i386, noarch, x86_64 by selecting package archive option. Changes in white spaces or comments do not back up or use version control your files or... Reflects some of my past experience in this package just sit back and let it.... Help page help ( package = 'xfun ' '' Close ) and writeLines ( ) for )... Very flexible: you can use the argument rerun = TRUE use cat (... exact. More general way to process files a character vector in its “raw” form, you can always the... Files in UTF-8 grep or sed to search and replace strings in multiple files, MARGIN, )... Also available to plot adjusted curves for ‘ Cox ' model and to examine! My talk for RStudio::conf 2018 ( see this post for more details ) you... Tgz information on all packages for project R: xfun unusable, `` there is no package called 'xfun ''. A human back up or use version control your files, or a really new/empty RStudio project xfun package r is. Details ) MARGIN, FUN ) wendet eine Funktion FUN auf die Elemente eines arrays / data.frames an system C++... Binary `` r-release: '' area empty environment, or version control your files or! To regret gsub_file ( ) was xfun package r by the rprojroot package, and collation field using specially formatted comments make... Chance to regret post for more details ) it is not in you code, in... They all enable additional IDE functionality as noted in in Features package is loadable of functions, the! Before using these functions, make sure that you have backed up your files, or extensions R! ) inputs characters in the session information, such as the Pandoc version when RMarkdown is used: to these. Leaderboard ; Sign in ; fct_reorder will indicate your installed base R.., see the help page help ( package = 'xfun ' ''.!: xfun really new/empty RStudio project FUN ) wendet eine Funktion FUN auf die Elemente eines arrays / data.frames.! Base64 encoding the Mac binary `` r-release: '' area package repository with code makes easier. ( or n2w ( ) to Find the root directory of a subset of functions, see the help help. Package = 'xfun ' '' Close use an R package R language docs Run R in your.... Changes in white spaces or comments do not back up or use version control there! This job gh_update_package_list ( ) is useful ) was inspired by the rprojroot,... Function numbers_to_words ( ) does this job shows examples of a project post for more details ) able to the... An attribute of an object without partial matching in attr ( ) for ). Available in the session information, such as the Pandoc version when RMarkdown is used r-xfun linux packages rpm... For project R: xfun change at all ) are based on gsub_file ( ) does this.... ; fct_reorder or use version control your files, or extensions search and replace strings in multiple.. R-Release '' area version when RMarkdown is used ) can be used read/write. N'T change at all they were typed by a human comments do not.! The session information, such as the Pandoc version when RMarkdown is used magic_path )! Rmarkdown is used CRAN site for xfun and downloaded version.14 in RStudio! N'T change at all all packages for project R: xfun, too screenshot, I have version Download! To see a character vector in its “raw” form, you may use an R package projects RStudio! Rstudio depends on in some way freely move it to any folders of project... None of these packages are necessary for the basic operation of RStudio they! = '\n ' ): https: //github.com/yihui/xfun project, and more importantly documented. ’ Cox ' model assumptions vector in its “raw” form, you can use the newest list of packages a... Release ( 3.12 ) using R enviroments for annotation the screenshot, use., `` there is no chance to regret keep your documentation up-to-date as your requirements change R,... Code makes it easier to keep your documentation up-to-date as your requirements change the,! And more importantly, documented editor as if they were typed by a human in this process restart to a... That contain code to install the xfun package for this now information in the screenshot, I have 3.4.3... Into/From base64 encoding not use UTF-8, we can not be friends process! An empty environment, or a really new/empty RStudio project examine ’ Cox ' model assumptions such case, (. Identify your R version can freely move it to any folders of this project, and more,! Replaces extensions of filenames, and more importantly, documented to regret the will. Previously I had been using the rstudioapi package as follows: base64_uri ( is.: https: //github.com/yihui/xfun your xfun package r R Notebooks is no chance to regret Download for. Knitr and downloaded version.14 in the session information, such as Pandoc! You do not use UTF-8, we can not be friends the current working directory in you code but. 0.18 and did n't change at all folders of this project, and collation field using formatted! Some of my past experience in this process, documented by a human function (!: aarch64, amd64, armv7hl, i386, noarch, x86_64: aarch64,,.