当前位置: 首页 > news >正文

在aarch64机器上安装使用R语言的季节调整包

下载最新R语言docker镜像,并运行和登录容器

aaa@kylin-pc:~/par$ sudo docker pull docker.1ms.run/r-base:4.6.0 4.6.0: Pulling from r-base bf17e2bd9d2b: Pull complete 507bd1bbf6a5: Pull complete 6700d570bfa1: Pull complete 938b4ad624cd: Pull complete 94100daaba7b: Pull complete 0a3f5c336428: Pull complete 6a991db89cb9: Download complete 46867dbc53f7: Download complete Digest: sha256:9259470c9e14c36181ab55341969b503b5862debabcad732ead17816e3a78d6c Status: Downloaded newer image for docker.1ms.run/r-base:4.6.0 docker.1ms.run/r-base:4.6.0 aaa@kylin-pc:~/par$ sudo docker run -itd -v /home/aaa/par:/par --network host --name rbase docker.1ms.run/r-base:4.6.0 sudo docker exec -it rbase bash root@kylin-pc:/# R R version 4.5.3 (2026-03-11) -- "Reassured Reassurer" Copyright (C) 2026 The R Foundation for Statistical Computing Platform: aarch64-unknown-linux-gnu R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R.

按照R语言X13binary的github存储库, https://github.com/x13org/x13org.github.io 介绍, 一行命令即可,它会联网下载源码,自动编译,

> install.packages("seasonal") Installing package into ‘/usr/local/lib/R/site-library’ (as ‘lib’ is unspecified) also installing the dependency ‘x13binary’ trying URL 'https://cloud.r-project.org/src/contrib/x13binary_1.1.61.2.tar.gz' trying URL 'https://cloud.r-project.org/src/contrib/seasonal_1.10.0.tar.gz' * installing *source* package ‘x13binary’ ... ** this is package ‘x13binary’ version ‘1.1.61.2’ ** package ‘x13binary’ successfully unpacked and MD5 sums checked ** using staged installation ** libs using Fortran compiler: 'GNU Fortran (Debian 15.2.0-16) 15.2.0' (cd ../tools/x13as_html && FC="gfortran" FFLAGS="-O2" LINKER="gfortran" make -f makefile.gf x13ashtml) make[1]: Entering directory '/tmp/Rtmp7ORtXu/R.INSTALL491346021/x13binary/tools/x13as_html' gfortran -O2 -c -o aaamain.o aaamain.f gfortran -O2 -c -o abend.o abend.f gfortran -O2 -c -o testodf.o testodf.f gfortran -o x13ashtml aaamain.o abend.o acf.o acfar.o acfdgn.o make[1]: Leaving directory '/tmp/Rtmp7ORtXu/R.INSTALL491346021/x13binary/tools/x13as_html' mkdir -p ../inst/bin cp -f ../tools/x13as_html/x13ashtml ../inst/bin/ installing via 'install.libs.R' to /usr/local/lib/R/site-library/00LOCK-x13binary/00new/x13binary ** R ** inst ** byte-compile and prepare package for lazy loading ** help *** installing help indices ** building package indices ** testing if installed package can be loaded from temporary location ** testing if installed package can be loaded from final location ** testing if installed package keeps a record of temporary installation path * DONE (x13binary) * installing *source* package ‘seasonal’ ... ** this is package ‘seasonal’ version ‘1.10.0’ ** package ‘seasonal’ successfully unpacked and MD5 sums checked ** using staged installation ** R ** data *** moving datasets to lazyload DB ** demo ** inst ** byte-compile and prepare package for lazy loading ** help *** installing help indices ** building package indices ** installing vignettes ** testing if installed package can be loaded from temporary location ** testing if installed package can be loaded from final location ** testing if installed package keeps a record of temporary installation path * DONE (seasonal) The downloaded source packages are in ‘/tmp/RtmpX74866/downloaded_packages’

再用网页上的例子测试季节调整功能。https://www.quandl.com/api/v3/datasets/FRED/VALEXPCNM052N.csv 这个链接被封锁了,用文件名在网上搜索,得到另一个地址 https://fred.stlouisfed.org/series/VALEXPCNM052N,可以下载,然后再把链接url改为本地目录。注意$列名需要和文件中的一致。使用seas函数前需要引入seasonal库。

> rs <- ts(read.csv("/par/VALEXPCNM052N.csv")$Value/1e3, start = c(1992, 1), frequency = 12) Error in ts(read.csv("/par/VALEXPCNM052N.csv")$Value/1000, start = c(1992, : 'ts' object must have one or more observations > a<-read.csv("/par/VALEXPCNM052N.csv") > a observation_date VALEXPCNM052N 1 2005-01-01 50727 2 2005-02-01 44276 3 2005-03-01 60845 4 2005-04-01 62084 5 2005-05-01 58422 6 2005-06-01 65930 7 2005-07-01 65532 8 2005-08-01 68372 9 2005-09-01 70148 10 2005-10-01 68025 11 2005-11-01 72195 12 2005-12-01 75397 13 2006-01-01 65126 250 2025-10-01 305046 251 2025-11-01 330163 252 2025-12-01 357747 > rs <- ts(a$VALEXPCNM052N/1e3, start = c(1992, 1), frequency = 12) > m1 <- seas(rs) Error in seas(rs) : could not find function "seas" > library(seasonal) > m1 <- seas(rs) > plot(m1, main = "Retail Trade: U.S. Total Sales", ylab = "USD (in Billions)") >

命令行方式的R无法显示图片,查看https://zhuanlan.zhihu.com/p/492829689,可以用如下命令将图片保存到png文件,就能查看了。

# 1. 创建画布 png( filename = "name.png", # 文件名称 width = 10, # 宽 height = 10, # 高 units = "in", # 单位 bg = "white", # 背景颜色 res = 300) # 分辨率 # 2. 绘图 plot(1:5) # 3. 关闭画布 dev.off()
http://www.cnnetsun.cn/news/2165436.html

相关文章:

  • 太强了!这个开源项目让我告别 PowerPoint,36 套主题一键切换,还自带演讲者模式!
  • iTVBoxFast会员版运营指南:从搭建到对接支付、管理卡密和防抓包实战
  • 网盘直链下载助手完整指南:2025年八大网盘高速下载终极解决方案
  • 在多地域部署服务中体验Taotoken的低延迟与路由容灾能力
  • 【2026实测】应对Turnitin更新:英文文本AI率从80%降至10%通关指南
  • 群晖NAS安全升级:告别手动更新,用acme.sh+Docker实现SSL证书全自动续期与部署
  • 互联网大厂 Java 求职面试:从音视频场景看技术栈的深度
  • NumPy数组初始化避坑指南:np.zeros、np.zeros_like和np.full到底该怎么选?
  • 从直连不稳定到通过Taotoken调用体验到的服务可靠性提升
  • Windows热键侦探:3分钟快速定位快捷键冲突的终极方案
  • 倾向评分加权(IPTW)避坑指南:从logistic回归到稳定权重的选择逻辑
  • WindowsCleaner终极指南:5分钟解决C盘爆红,免费开源清理神器
  • Android Studio中文界面配置终极指南:5分钟实现全中文开发环境
  • 3分钟极速汉化!Android Studio中文语言包让你的开发效率飙升200%
  • 创业公司如何借助Taotoken的多模型能力快速进行AI产品原型验证
  • 为 Hermes Agent 配置自定义提供商并接入 Taotoken 多模型服务
  • 告别日志混乱:手把手教你用Syslog Watcher Manager搭建Windows日志中心(附Java客户端配置)
  • 企业如何利用统一API平台管理多个大模型调用与成本
  • 保姆级教程:在RK3588开发板上手动调整CPU/GPU/NPU频率,实现性能与功耗的平衡
  • Maestro:跨平台多智能体开发编排引擎,统一AI开发工作流
  • DELL SCv3020存储风扇狂转,别急着换风扇!一个U盘+串口线搞定密码重置和脑裂诊断
  • Oracle ADG参数调优指南:如何根据你的业务场景配置LOG_ARCHIVE_DEST_n和DB_UNIQUE_NAME?
  • Flink自定义Source/Sink避坑指南:我踩过的性能陷阱和稳定性雷区(附调优参数)
  • 蓝桥杯Java省赛真题解析:从‘特殊时间’到‘青蛙过河’,我是如何一步步优化代码的
  • 【2026年最新600套毕设项目分享】基于微信小程序的校园保修系统(30201)
  • 从合金设计到电池材料:手把手教你用MedeA的MLPG训练自己的机器学习势函数
  • 中兴R5300G4服务器运维日记:如何快速定位硬件信息与RAID配置(含dmidecode与arcconf实战)
  • Windows 11终极优化指南:使用Win11Debloat释放系统性能的完整教程
  • 方言提示词优化AI绘画效果的技术实践
  • BetterNCM安装器完整教程:3分钟解锁网易云音乐插件生态