stringi

object 'C_stri_join' not found - Using knitr in Rstudio

女生的网名这么多〃 提交于 2019-12-17 21:32:11
问题 When using the knit button in Rstudio I get an error object 'C_stri_join' not found . Here is an example: --- title: "Sample Document" output: html_document: toc: true theme: united --- <!-- %\VignetteEngine{knitr::knitr} %\VignetteIndexEntry{Basic test} --> Here we go ```{r} x <- 1 str(x) ``` The error is as follows: Error in stri_c(..., sep = sep, collapse = collapse, ignore_null = TRUE) : object 'C_stri_join' not found Calls: suppressPackageStartupMessages ... evaluate_call -> handle

Overlapping matches in R

无人久伴 提交于 2019-12-17 09:50:04
问题 I have searched and was able to find this forum discussion for achieving the effect of overlapping matches. I also found the following SO question speaking of finding indexes to perform this task, but was not able to find anything concise about grabbing overlapping matches in the R language. I can perform this task in most any language that supports (PCRE) by using a Positive Lookahead assertion while implementing a capturing group inside of the lookahead to capture the overlapped matches.

Error in R: (Package which is only available in source form, and may need compilation of C/C++/Fortran)

北战南征 提交于 2019-12-17 07:31:22
问题 I'm trying to install the 'yaml' and 'stringi' packages in R-Studio, and it keeps giving me these errors: > install.packages("stringi") Package which is only available in source form, and may need compilation of C/C++/Fortran: ‘stringi’ These will not be installed or > install.packages('yaml') Package which is only available in source form, and may need compilation of C/C++/Fortran: ‘yaml’ These will not be installed How can I get these to install properly? 回答1: The error is due to R being

How to use Regex to strip punctuation without tainting UTF-8 or UTF-16 encoded text like chinese?

牧云@^-^@ 提交于 2019-12-12 04:45:21
问题 How do I strip punctuation from ASCII and UTF-8 encoded strings without messing up the UTF-8 original characters, specifically Chinese, in R. text <- "Longchamp Le Pliage 肩背包 (小)" stri_replace_all_regex(text, '\\p{P}', '') results in: Longchamp Le Pliage ��背�� 小 but the desired result should be: Longchamp Le Pliage 肩背包 小 I'm looking to remove all the CJK Symbols and Punctuation as well ask ASCII punctuations. @akrun, sessionInfo() is as follows locale: [1] LC_COLLATE=English_Singapore.1252 LC

object 'C_stri_join' not found - Using knitr in Rstudio

扶醉桌前 提交于 2019-12-11 10:47:00
问题 When using the knit button in Rstudio I get an error object 'C_stri_join' not found . Here is an example: --- title: "Sample Document" output: html_document: toc: true theme: united --- <!-- %\VignetteEngine{knitr::knitr} %\VignetteIndexEntry{Basic test} --> Here we go ```{r} x <- 1 str(x) ``` The error is as follows: Error in stri_c(..., sep = sep, collapse = collapse, ignore_null = TRUE) : object 'C_stri_join' not found Calls: suppressPackageStartupMessages ... evaluate_call -> handle

Converting accents to ASCII in R

不羁岁月 提交于 2019-12-11 08:04:33
问题 I'm trying to convert special characters to ASCII in R. I tried using Hadley's advice in this question: stringi::stri_trans_general('Jos\xe9', 'latin-ascii') But I get "Jos�". I'm using stringi v1.1.1. I'm running a Mac. My friends who are running Windows machines seem to get the desired result of "Jose". Any idea what is going on? 回答1: The default encoding on Windows is different from the typical default encoding on other operating systems (UTF-8). x ='Jos\xe9' means something in Latin1, but

How to give Backslash as replacement in R string replace [duplicate]

笑着哭i 提交于 2019-12-11 05:52:51
问题 This question already has answers here : R: How to replace space (' ') in string with a *single* backslash and space ('\ ') (2 answers) How do I deal with special characters like \^$.?*|+()[{ in my regex? (2 answers) Closed 2 years ago . I need to ">" with "\". Example : "a>b" should be changed to "a\b" I have tried gsub > test <- "a>b" > gsub(">","\\",test, fixed = TRUE) [1] "a\\b" I have tried StringR str_replace > library(stringr) > str_replace(test,">","\\") [1] "ab" I have tried Stringi

Error in stri_split_boundaries(): argument `str` should be a character vector

大憨熊 提交于 2019-12-11 05:09:24
问题 I've been working through Maëlle Salmon's recommended tools for improving R packages and cannot get pkgdown::build_site() working: > pkgdown::build_site() Initialising site -------------------------------------------------------------------------------------------------------- Copying 'C:/Users/name/Documents/R/win-library/3.3/pkgdown/assets/jquery.sticky-kit.min.js' Copying 'C:/Users/name/Documents/R/win-library/3.3/pkgdown/assets/link.svg' Copying 'C:/Users/name/Documents/R/win-library/3.3

Package dependency error “there is no package called ‘stringi’”

谁都会走 提交于 2019-12-11 05:08:13
问题 I created an R package and loaded it to github (microdadosBrasil). When I try to install the package (as a user would) I get the following error: devtools::install_github("lucasmation/microdadosBrasil") Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : there is no package called ‘stringi’ I tried solving this by adding stringi to the package dependencies In DESCRIPTION in included: Imports: stringi I also included the package import at NAMESPACE import(stringi) But,

How do I extract appearances of a vector of strings in another vector of strings using R?

左心房为你撑大大i 提交于 2019-12-08 11:22:29
I have a vector of strings like this : strings <- tibble(string = c("apple, orange, plum, tomato", "plum, beat, pear, cactus", "centipede, toothpick, pear, fruit")) And I have a vector of fruit: fruits <- tibble(fruit =c("apple", "orange", "plum", "pear")) What I'd like is a data.frame/tibble with the original strings data.frame with a second list or character column of all the fruit contained in that original column. Something like this. strings <- tibble(string = c("apple, orange, plum, tomato", "plum, beat, pear, cactus", "centipede, toothpick, pear, fruit"), match = c("apple, orange, plum"