当前位置: 首页 > 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.jsqmd.com/news/727733/

相关文章:

  • 从像素邻居到距离计算:手把手用NumPy实现图像中的欧式、街区与棋盘距离
  • D149 最小生成树 Boruvka 算法
  • 利用 Taotoken 多模型能力为智能客服场景提供备选方案
  • 如何让加密音乐重获自由:Unlock Music一站式解密解决方案
  • NLP整体学习框架路线图
  • 题解:AcWing 6028 表达式括号匹配
  • 避开这些坑!河海大学软件工程复试联系导师的真相与策略(附邮件模板)
  • 情感词典动态校准术,R 4.5中基于领域语料微调AFINN-2.0的5步闭环方法论
  • RobotFrameWork自动化测试环境搭建
  • 告别词库迁移烦恼:深蓝词库转换器让20+输入法格式自由互通
  • Umi-OCR批量处理性能优化:三步解决任务阻塞与资源泄露问题
  • 为什么你的Dify权限总被绕过?——基于eBPF内核级策略拦截与OPA网关协同的终极加固方案
  • 【毕设】党员教育和管理系统的设计与实现
  • 阿克曼结构智能循迹蓝牙小车设计与制作(代码部分)
  • Apache Flink 流式计算:窗口与时间语义
  • 2026年AI大爆发:从“预测下一个词”到重塑我们的物理世界
  • 战略级开源项目管理平台:OpenProject赋能团队协作的智能化解决方案
  • 2026年主流Ai平台GEO引用媒体来源深度解析:从资源适配到效果转化的选型指南 - 发稿平台推荐
  • BM25 + Vectors:为什么真实 RAG 系统通常两者都需要
  • 别再只懂SA和NSA了!一张图看懂5G组网Option 1到Option 7的实战选择
  • SRWE窗口编辑器终极指南:免费突破Windows窗口限制的专业工具
  • 智融SW3526,支持PD的多快充协议充电解决方案。
  • 别再纠结了!给3D新手的PBR材质流程选择指南:金属度 vs. 高光
  • PicTech 妙言小智免费图片翻译3.0升级:排版优化让体验全面飞跃!
  • 为什么92%的AI团队跳过R语言偏见检测?揭秘3个被低估的统计方法+1个开源插件(含GitHub私有仓库邀请码)
  • Claude Code 如何快速接入 Taotoken 实现稳定调用与成本控制
  • 别再死记硬背了!用唐康林老师的NX10工程图教程,我总结了一套高效出图工作流
  • AI 智能操作:Visual Studio Code 中的无提示开发革命
  • 【从知识库到知识图谱的推理之路】第三章 知识抽取与图谱构建(Knowledge Extraction Graph Construction) (二)3.2 半/非结构化文本抽取
  • 2026年3月服务好的数字化服务平台直销厂家推荐,美式箱式变电站/欧式箱式变电站,数字化服务平台实力厂家哪家强 - 品牌推荐师