楼主: 耕耘使者
2402 3

[问答] 为何source调不出R脚本文件? [推广有奖]

贵宾

已卖:5006份资源

学术权威

39%

还不是VIP/贵宾

-

威望
4
论坛币
1811021 个
通用积分
171.7911
学术水平
109 点
热心指数
173 点
信用等级
87 点
经验
93428 点
帖子
4549
精华
0
在线时间
2848 小时
注册时间
2006-4-6
最后登录
2025-7-12

楼主
耕耘使者 发表于 2012-3-2 14:46:38 |AI写论文
100论坛币
脚本文件内容见下面附件:
fit1.txt (70 Bytes)
脚本文件取名为fit1.R
调用过程及结果:
TT截图未命名.bmp
为什么没有显示如下内容:
TT截图未命名2.bmp

最佳答案

zhangyangsmith 查看完整内容

Two options: 1. call your scripts withThis will show all the contents of the file 2. change the last line of your script into:Only the output of the summary() function will be shown
关键词:Source Our 如下内容 fit source

沙发
zhangyangsmith 发表于 2012-3-2 14:46:39
Two options:
1. call your scripts with
  1. source("fit1.r", echo = T)
复制代码
This will show all the contents of the file
2. change the last line of your script into:
  1. print(summary(fit1))
复制代码
Only the output of the summary() function will be shown
已有 3 人评分论坛币 学术水平 热心指数 信用等级 收起 理由
耕耘使者 + 3 + 1 + 1 热心帮助其他会员
qoiqpwqr + 20 + 1 热心帮助其他会员
ywh19860616 + 1 + 1 + 1 认同

总评分: 论坛币 + 20  学术水平 + 4  热心指数 + 3  信用等级 + 2   查看全部评分

藤椅
NK 发表于 2012-3-2 22:23:28
source()的内容必须是function,附件里面的不是function,是一堆命令~
ps:没有必要source,不知道你的目的是什么。。。。

板凳
耕耘使者 发表于 2012-3-3 00:21:43
zhangyangsmith 发表于 2012-3-2 14:46
Two options:
1. call your scripts withThis will show all the contents of the file
2. change the la ...
Many thanks!

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2026-1-2 03:57