使用R包中的.Fortran()错误提示功能不可用

编程入门 行业动态 更新时间:2024-10-25 15:28:57
本文介绍了使用R包中的.Fortran()错误提示功能不可用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我尝试了以下代码:

library(quantreg) # to load the package library(foreign) # to load the package .Fortran("rqfn", PACKAGE = "quantreg")

但出现以下错误:

Error in .Fortran("rqfn", PACKAGE = "quantreg") : "rqfn" not available for .Fortran() for package "quantreg"

我已经安装了Rtools.但这并不能解决问题. 我还检查了与系统路径有关的问题(例如在此站点中: github/stan-dev/rstan/wiki/Install-Rtools-for-Windows ),但这没有问题. 有人可以帮我吗?非常感谢.

I have installed Rtools. But it does not solve the problem. I also checked the issues concerning system paths (as in this site: github/stan-dev/rstan/wiki/Install-Rtools-for-Windows), but there is no problem about that. Could anyone give me a hand? Thank you very much.

推荐答案

您可以构建自己的库:

  • 下载rqfn.f和rqfnb.f. stepy方法需要后者.
  • 致电R CMD SHLIB rqfn.f rqfnb.f
  • 使用如下函数:

  • Download rqfn.f and rqfnb.f. The latter is needed for stepy method.
  • Call R CMD SHLIB rqfn.f rqfnb.f
  • use the function like this:

data(stackloss) x <- stack.x y <- stack.loss n <- length(y) p <- ncol(x) dyn.load(paste0("rqfn", .Platform$dynlib.ext)) .Fortran("rqfn", as.integer(n), as.integer(p), a = as.double(t(as.matrix(x))), c = as.double(y), rhs = double(p), d = double(n), beta = as.double(0.99995), eps = as.double(1e-6), tau = as.double(0.5), wn = double(10 * n), wp = double((p + 3) * p), aa = double(p * p), it.count = integer(2), info = integer(1))

更多推荐

使用R包中的.Fortran()错误提示功能不可用

本文发布于:2023-06-12 23:59:34,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/670278.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:不可用   错误提示   包中   功能   Fortran

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!