5
I downloaded a file . dat which is basically an array with data.
However, it seems to me that the only way to work with him is by doing the following command (I’m using the R and I don’t have much experience with the R):
setwd("C:")
load("dat73_1")
After this command "load" this file is "hidden" by R??
The code to read this file is as follows::
mylist<-c("CAN","FRA","DEU","ITA","JPN","GBR","G6")
If I want the information regarding "CAN", just modify "cno in 1:7
" for "cno in 1:1
".
for (cno in 1:7){
init_date<-c(1973,3)
start_date <- init_date+c(6,3)
end_date<-c(2009,10)
country<-mylist[cno]
Cdat<-data.frame(window(ts(get(country),start=init_date,freq=12),start=start_date, end=end_date))}
I did this and managed to recover this file to all countries of mylist
and created a new file in Excel. But I can’t adapt the code to the excel file. There is how to do this?
If I can "find" this file. dat tbm would help a lot.
OBS (Edited): When I use the read.table command the output is this (Rstudio):
To read dat files, you use the read.table(file) function. Only checks if you need to use other arguments, such as header=T, if you want the original column names and Skip=number of rows to avoid. Dat files usually have extra information, so the Skip argument serves to ignore them.
– José
@Jose thanks!. I edited the theme to show the output when I use the read.table. command I can’t pull right.
– Laura
load()
should be used in binary filesR
extended.RDA
or.Rdata
, shouldn’t be what you need.– Tomás Barcellos
Hi, @Laura. You know which program generated this file
.data
? From what I saw of the result after using theread.table()
it seems to me that your file is binary (but not in format.RData
, that could be read by the functionload()
). Files like this usually require a treatment outside the R to be converted into a data table in format.csv
or.txt
, for example. Only then can they be read with the functionread.table()
within the R.– Luís Muniz
put the example file here
– Artur_Indio