首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >找不到函数"textstat_frequency“

找不到函数"textstat_frequency“
EN

Stack Overflow用户
提问于 2022-10-04 12:39:04
回答 1查看 149关注 0票数 0

我正试图为这个错误找到一个解决方案。几年前有过一篇文章,但一直没有找到解决办法。让我尝试提供更多细节:

这是错误

代码语言:javascript
复制
textstat_freq(testing.dfm, n = 10, groups = "ByNmbr")
Error in textstat_freq(testing.dfm, n = 10, groups = "ByNmbr") : 
  could not find function "textstat_freq"

安装quanteda时会出现错误。

我不知道这些是否有关。这是我的例子:

代码语言:javascript
复制
install.packages("quanteda")
also installing the dependency ‘RcppArmadillo’


  There is a binary version available but the source version is later:
                  binary     source needs_compilation
RcppArmadillo 0.11.2.4.0 0.11.4.0.1              TRUE

Do you want to install from sources the package which needs compilation? (Yes/no/cancel) yes
trying URL 'https://cran.rstudio.com/bin/macosx/big-sur-arm64/contrib/4.2/quanteda_3.2.3.tgz'
Content type 'application/x-gzip' length 4191430 bytes (4.0 MB)
==================================================
downloaded 4.0 MB


The downloaded binary packages are in
    /var/folders/w5/hsxqtj6n32qbq0j4409h6kbm0000gn/T//Rtmp6seSBH/downloaded_packages
installing the source package ‘RcppArmadillo’

trying URL 'https://cran.rstudio.com/src/contrib/RcppArmadillo_0.11.4.0.1.tar.gz'
Content type 'application/x-gzip' length 1369973 bytes (1.3 MB)
==================================================
downloaded 1.3 MB

* installing *source* package ‘RcppArmadillo’ ...
** package ‘RcppArmadillo’ successfully unpacked and MD5 sums checked
** using staged installation
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C++... yes
checking whether clang++ -arch arm64 -std=gnu++14 accepts -g... yes
checking for clang++ -arch arm64 -std=gnu++14 option to enable C++11 features... none needed
checking how to run the C++ preprocessor... clang++ -arch arm64 -std=gnu++14 -E
checking whether the compiler supports GNU C++... (cached) yes
checking whether clang++ -arch arm64 -std=gnu++14 accepts -g... (cached) yes
checking for clang++ -arch arm64 -std=gnu++14 option to enable C++11 features... (cached) none needed
checking whether we have a suitable tempdir... /var/folders/w5/hsxqtj6n32qbq0j4409h6kbm0000gn/T
checking whether R CMD SHLIB can already compile programs using OpenMP... no
checking whether g++ version is sufficient... almost
configure: WARNING: Compiler self-identifies as being compliant with GNUC extensions but is not g++.
checking for macOS... found
checking for macOS Apple compiler... not found
checking for clang compiler... found
checking for OpenMP compatible version of clang... not found
configure: WARNING: OpenMP unavailable and turned off.
checking LAPACK_LIBS... R-supplied partial LAPACK found
configure: WARNING: Some complex-valued LAPACK functions may not be available
configure: creating ./config.status
config.status: creating inst/include/RcppArmadilloConfigGenerated.h
config.status: creating src/Makevars
** libs
clang++ -arch arm64 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I'/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/Rcpp/include' -I/opt/R/arm64/include  -I../inst/include  -fPIC  -falign-functions=64 -Wall -g -O2  -c RcppArmadillo.cpp -o RcppArmadillo.o
clang++ -arch arm64 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I'/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/Rcpp/include' -I/opt/R/arm64/include  -I../inst/include  -fPIC  -falign-functions=64 -Wall -g -O2  -c RcppExports.cpp -o RcppExports.o
clang++ -arch arm64 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG  -I'/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/Rcpp/include' -I/opt/R/arm64/include  -I../inst/include  -fPIC  -falign-functions=64 -Wall -g -O2  -c fastLm.cpp -o fastLm.o
clang++ -arch arm64 -std=gnu++11 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/opt/R/arm64/lib -o RcppArmadillo.so RcppArmadillo.o RcppExports.o fastLm.o -L/Library/Frameworks/R.framework/Resources/lib -lRlapack -L/Library/Frameworks/R.framework/Resources/lib -lRblas -L/opt/R/arm64/gfortran/lib/gcc/aarch64-apple-darwin20.6.0/12.0.1 -L/opt/R/arm64/gfortran/lib -lgfortran -lemutls_w -lquadmath -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
ld: warning: directory not found for option '-L/opt/R/arm64/gfortran/lib/gcc/aarch64-apple-darwin20.6.0/12.0.1'
ld: warning: directory not found for option '-L/opt/R/arm64/gfortran/lib'
ld: library not found for -lgfortran
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [RcppArmadillo.so] Error 1
ERROR: compilation failed for package ‘RcppArmadillo’
* removing ‘/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/RcppArmadillo’
Warning in install.packages :
  installation of package ‘RcppArmadillo’ had non-zero exit status

The downloaded source packages are in
    ‘/private/var/folders/w5/hsxqtj6n32qbq0j4409h6kbm0000gn/T/Rtmp6seSBH/downloaded_packages’

quanteda版本检查:

代码语言:javascript
复制
> library(quanteda)
Package version: 3.2.3
Unicode version: 14.0
ICU version: 70.1
Parallel computing: 8 of 8 threads used.
See https://quanteda.io for tutorials and examples.

(这是一个虚拟文本,这是一个虚拟文本,因为堆栈不允许我发布,如果我的帖子主要是代码,我不知道还可以添加什么,这是一个虚拟文本,这是一个虚拟文本)。

EN

回答 1

Stack Overflow用户

发布于 2022-10-04 13:48:24

  1. 只安装二进制版本的quanteda.textstats,quanteda、及其依赖项(例如,如果您无法设置编译源代码包所需的工具,则安装。
  2. 试试这个: 库(“quanteda”)库(“quanteda.textstats”)#验证该函数现在运行示例(“textstat_frequency”)
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73947996

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档