Import Eviews workfile into R - r

I have problem importing an Eviews workfile into R. I use the hexView package and I can get the time series data into R but I do not get the periods responding to the time series imported. (The periods is not stored as a timeseries object.)
I would not like to create an time series objects for the periods in the workfile to solve the problem.
If there is another way than using the hexView package to import the data and the responding periods it would be great.
Right now I use this simple code to read the data into R
d <- readEViews("testData.wf1", as.data.frame = TRUE)
Any and all help will be greatly appreciated.

This question motivated me to create an R package EviewsR, which is available on CRAN.
Please follow the following steps in R:
install.packages("EviewsR")
library(EviewsR)
import("importedDataframe","testData")
eviews$importedDataframe # to access the imported dataframe in R
The package works with base R, R Markdown and Quarto.
I am currently updating the package to provide new features
I look forward to your feedback.

Related

How to reinterpolate the data to same length by package ‘dtwclust’

I'm trying to do a hierarchical cluster dendrogram of time series in R using the dtwclust package. For my test dataset I have 7 columns with unequal lengths. The dtwclust package offers a way to equalize the lengths using a reinterpolate function. However I get this error when I try to use it with the following code
data <- reinterpolate(my_data, new.length = max(lengths(my_data)))
Error in check_consistency(x, "ts") : There are missing values in the series.
I do not know if this means that the data table is not organized properly. Can anyone suggest how to read in the data (I just imported it using RStudio) or any other way to resolve this issue. I tried the analysis using the data provided in the package and it worked as advertised.

How to load a xls or csv data file to work with the rugarch and rmgarch packages in R

I am new to R and have just started to use it. I am currently experimenting with the quantmod, rugarch and rmgarch packages.
In particular, I'm implementing the last package to make a multivariate portfolio analysis for the case of the european markets. In this sense, I need to download the 3-month german treasury bills, in order to use them as risk free rate. However, as far as I known, I can´t download the the mentioned data serie from Yahoo, Google or FDRA databases, so I have already downloaded them from investing.com and I want to load them in R.
The fact here is, my data is different from the ones downloaded by the getsymbols () function of yahoo, because in this case I only have 2 columns, the date column and the closing price column. To sump up, the question arises here is, is there any way to load this type of data in R for rmgarch purposes??
thanks in advance
Not sure if this is the issue, but this is how you might go about getting the data from a csv file.
data <- read.csv(file="file/path/data.csv")
head(data) # Take a look at your data
# Do this if you want the data only replacing ColumnName with the proper name
data_only <- data$ColumnName
It looks like the input data for rugarch needs to be an xts vector. So, you might want to take a look at this. You might also want to take a look at ?read.csv.

using the 'ptw' package in R

I am working on applying the ptw package to my GC-MS wine data. So far I have been able to correctly use this package on the apples example data described in the vignette (MTBLS99). Since I am new to R, I am unable to get my .CDF files into the format they used to start the vignette. They started with three data frames (All.pks, All.tics, All.xset). I assume that this was generated using the xcms package. But I cannot recreate the specific steps used for the data to be formatted in this manner. Has anyone successfully applied 'ptw' to their LC/GC-MS data? can someone share the code used for generating the All.pks, All.tics, All.xset data frames?

How do I organize my data for time series cluster analysis using the dtwclust package?

I'm trying to do a hierarchical cluster dendrogram of time series in R using the dtwclust package. For my test dataset I have 4 columns with unequal lengths. the dtwclust package offers a way to equalize the lengths using a reinterpolate function. However I get this error when I try to use it with the following code
data <- reinterpolate(fshdtw, new.length = max(lengths(fshdtw)))
Error in check_consistency(x, "ts") : There are missing values in the series. This makes me think (I could be wrong) that the data table is not organized properly. Can anyone suggest how to 1. read in the data (I just imported it using RStudio) or any other way to resolve this issue. PS: I tried the analysis using the data provided in the package and it worked as advertised. Thanks in advance!
The data file is here https://www.dropbox.com/s/dih39ji0zop9xa0/fshdtw.txt?dl=0

How can I create a Coincidence Matrix in R using R Studio?

I want to create a conincidence matrix using R Studio for a decision tree that I have generated. I have done the same in SPSS but am not able to figure out how to do the same in R. I am attaching an image of how it looks in SPSS. If you could point me to the right resource or link that can tell me what the quivalent of this in R is, that would be very helpful. Thank you!!
First, please try and ask targeted questions. What have you tried? What packages have you explored? Where are you getting stuck?
Nonetheless, I would start by reading through this, A Short Introduction to the caret Package. Then, do this:
install.packages("caret")
library(caret)
?confusionMatrix

Resources