“错误的还原文件密码" R中的错误 [英] "bad restore file magic number" error in R

查看:374
本文介绍了“错误的还原文件密码" R中的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

R出现幻数ëPNG"错误,我遇到了错误的还原文件幻数错误:

> load("fossilien.dat")
Error: bad restore file magic number (file may be corrupted) -- no data loaded
In addition: Warning message:
file ‘fossilien.dat’ has magic number '"Samp'
   Use of save versions prior to 2 is deprecated 

使用source函数会给我一个不同的错误(类似于意外的字符串常量):

Using the source function gives me a different error (similar to unexpected string constant):

> source("fossilien.dat")
Error in source("fossilien.dat") : 
  fossilien.dat:1:10: unexpected string constant
1: "Sample" "Sname"
            ^

这尤其令人沮丧,因为我相信数据源是合法的-它是针对家庭作业的问题: ftp://stat.ethz.ch/Teaching/Datasets/WBL/fossilien.dat

This is especially frustrating as I'm confident the source of data is legit - its for a homework problem: ftp://stat.ethz.ch/Teaching/Datasets/WBL/fossilien.dat

以上所有SO问题均未得到正确回答,因此我想我会再试一次.

None of the SO questions above were really answered properly so I thought I would try again.

有关我的R安装的一些详细信息:

Some details about my R installation:

> R.Version()
$platform
[1] "x86_64-apple-darwin9.8.0"
$version.string
[1] "R version 2.15.3 (2013-03-01)"

推荐答案

read.table函数最终起作用:

CGW的

load用于.rdata格式的文件,而fossilien.dat显然是ASCII表. source 执行命名的文件或对象.

EDIT by CGW: load is for files in .rdata format, while your fossilien.dat clearly is an ASCII table. source executes the named file or object.

这篇关于“错误的还原文件密码" R中的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆