Пытаясь запустить код R из: https://www.r-bloggers.com/classical-technical-patterns/
Quantmod пакет
load.packages('quantmod')
ticker = 'SPY'
data = getSymbols(ticker, src = 'yahoo', from = '1970-01-01', auto.assign = F)
data = adjustOHLC(data, use.Adjusted=T)
для plot.pattern () я получаю следующую ошибку:
plot.patterns(data, 190, ticker)
Package 'sm', version 2.2-5.6: type help(sm) for summary information
Error in if (type == "Date" || type == "yearmon" || type == "yearqtr")
temp = as.Date(temp) :
missing value where TRUE/FALSE needed
In addition: Warning message:
package ‘sm’ was built under R version 3.6.3
Called from: index.xts(x)
Browse[1]>
Функция отладки:
Debug output:
function
(
x
)
{
temp = attr(x, 'index')
class(temp) = c('POSIXct', 'POSIXt')
type = attr(x, '.indexCLASS')[1]
if( type == 'Date' || type == 'yearmon' || type == 'yearqtr')
temp = as.Date(temp)
return(temp)
}
Нет вывода для функции plot.pattern (). Запуск кода приводит к следующей ошибке:
Error in if (type == "Date" || type == "yearmon" || type == "yearqtr")
temp = as.Date(temp) :
missing value where TRUE/FALSE needed