加载源脚本时出现R错误

时间:2014-01-25 21:35:02

标签: r

我对R软件脚本有疑问。我是R的新手并且收到了另一位用户的脚本。这个脚本有两个阶段:首先,它加载了许多时间序列库,然后加载了一些源代码。

这是电话:

this.dir <- dirname(parent.frame(2)$ofile); setwd(this.dir);options(warn=-1); Sys.setlocale("LC_TIME", "English");
library(twitteR) 
library(tm) 
library("tseries") 
library("zoo") 
library("xts") 
library("forecast")
library("quantmod")
library("wordcloud")
source("inc/config.r")

“source(”inc / config.r“)”行发生错误。错误是:

文件错误(文件名,“r”,编码=编码):   无法打开连接

对config.r的调用包含以下脚本:

tw_search_usr=c("CNNMoney","TheStreet", "FoxBusiness","SeekingAlpha", "WallstCS","themotleyfool",
"MarketWatch","CNBC","ReutersBiz","WSJ","YahooFinance",
"MicroFundy","chartly","MarketBeat","ReutersTV","BloombergTV","profitly","myrollingstocks",
"BloombergNews","Stockstobuy","tradespoon","stockr","stocktwits",
"FinancialBrand", "Option_Trading","EconomicTimes")

# Set up the list of stock symbols
stocksmbl<-c("AAPL","YHOO", "ORCL","MSFT")

# Set up max number of tweets which can be loaded for each user
n_tw=300;

# Set up time windows for analysis (days)
xts_window=100

min_freq_terms=5;
min_corr_assoc=0.03
filename_fts="loaded_feeds/fin_time_series.txt"
filename="loaded_feeds/users_tweets.txt"
rollmean_period=10
rollmean_period2=20
relative_freq_frsets=TRUE

我的预感是错误随之出现:

filename_fts="loaded_feeds/fin_time_series.txt"

并且可能是由于顶部第一个脚本中的第一行设置了“this.dir”

有关这里出了什么问题的任何建议吗?

0 个答案:

没有答案