Thursday 15 September 2011

Trouble loading a dataset in R -



Trouble loading a dataset in R -

i have downloaded bundle semipar , have been trying attach dataset fuel.frame, using command data(fuel.frame), without sucess. error have been getting is:

error in read.table(zfile, header = true, as.is = false) : more columns column names in addition: warning messages: 1: in read.table(zfile, header = true, as.is = false) : line 1 appears contain embedded nulls 2: in read.table(zfile, header = true, as.is = false) : line 5 appears contain embedded nulls 3: in read.table(zfile, header = true, as.is = false) : incomplete final line found readtableheader on 'c:/...

could please tell me wrong here? have tried solutions online seems bundle works besides myself.

my sessioninfo()

attached base of operations packages: [1] stats graphics grdevices utils datasets methods base of operations other attached packages: [1] semipar_1.0-4.1 loaded via namespace (and not attached): [1] cluster_1.15.3 grid_3.1.1 lattice_0.20-29 mass_7.3-33 nlme_3.1-117 [6] tools_3.1.1

thank you.

the "fuel.frame" file in ../semipar/data/ directory wherever library is. can utilize .libpaths() function. me returns:

> .libpaths() [1] "/library/frameworks/r.framework/versions/3.1/resources/library"

if in there should see "fuel.frame.txt.gz" tells it's gzipped file expand text file (which data() phone call doing before passing read.table() ). top of looks like:

car.name weight disp. mileage fuel type "eagle summit 4" 2560 97 33 3.030303 little "ford escort 4" 2345 114 33 3.030303 little "ford festiva 4" 1845 81 37 2.702703 little "honda civic 4" 2260 91 32 3.125000 little "mazda protege 4" 2440 113 32 3.125000 little "mercury tracer 4" 2285 97 26 3.846154 little "nissan sentra 4" 2275 97 33 3.030303 little "pontiac lemans 4" 2350 98 28 3.571429 little

as can see error message not right copy. may want utilize unnamed scheme expand .gz file , investigate. (i not getting error r 3.1.1 (snowleopard build) running in osx 10.7.5.) setup succeeds:

data('fuel.frame', lib.loc='/library/frameworks/r.framework/versions/3.1/resources/library/')

r

No comments:

Post a Comment