2017-06-29 169 views
1

我一直在努力的代碼上Rstudio:[R編程,導入數據

```{r list tables} 
    library(data.world) 
    # Datasets are referenced by their URL or path 
    dataset_key <- "https://data.world/ryanes/liverpool-english-league-matches" 
    # List tables available for SQL queries 
    tables_qry <- data.world::qry_sql("SELECT * FROM Tables") 
    tables_qry 
    tables_df <- data.world::query(tables_qry,dataset_key) 
    # See what is in it 
    tables_df$tableName 

但是當我運行該塊,它給了我一個錯誤說:

No encoding supplied: defaulting to UTF-8. 
Show Traceback 
Error in dwapi::sql(dataset = dataset, query = qry$query_string, 
query_params = qry$params) : 

請讓我知道如何解決這個問題。

回答

1

我是data.world的工程師之一,可以幫助你。這可能是您的data.world授權令牌(例如過期令牌)的問題。您是否可以嘗試通過https://data.world/settings/advanced獲取新令牌並在您當前的R會話中重新設置它? e.g saved_cfg <- data.world::save_config(<YOUR NEW API TOKEN>) data.world::set_config(saved_cfg)

如果問題仍然存在,請與您的當前d.w庫版本以及一個完整的堆棧跟蹤回覆e.g

packageVersion("data.world")

+0

是的,這就是問題所在。謝謝您的幫助。 – Sneha