This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreDid you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now
I have this R script and he run succefully but when i would to load in Power BI, i get that error message:
this is my code:
library(rvest)
> library(httr)
> sess <- html_session("http://www.atb.com.tn/", user_agent("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.39 Safari/537.36"))
> pg <- jump_to(sess, "http://www.atb.com.tn/devise")
> dat <- content(pg$response, as="parsed")
> mydata= html_table(html_nodes(dat, "table")[[2]], header=TRUE)
And that the error message:
Détails : « ADO.NET : Erreur du script R.
Le chargement a nÚcessitÚ le package : xml2
Error in as.vector(x, "list") :
cannot coerce type 'environment' to vector of type 'list'
Calls: html_table ... <Anonymous> -> lapply -> as.list -> as.list.default
ExÚcution arrÛtÚe
Adding library(methods) reference has worked. Since data frame returned has duplicate column names it would again error out so changed header to False (it will return header as first row and you can again change that to headers in power bi) and also fill = True. so end script which works will be as follows,
library(rvest)
library(methods)
library(httr)
sess <- html_session("http://www.atb.com.tn/", user_agent("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.39 Safari/537.36"))
pg <- jump_to(sess, "http://www.atb.com.tn/devise")
dat <- content(pg$response, as="parsed")
mydata= html_table(html_nodes(dat, "table")[[2]], header=FALSE, fill=TRUE)
Many thanks
Hi,
Any news about this issue, as I have the same error message:
Details: "ADO.NET: R script error.
Loading required package: xml2
Warning message:
'html' is deprecated.
Use 'read_html' instead.
See help("Deprecated")
Error in as.vector(x, "list") :
cannot coerce type 'environment' to vector of type 'list'
Calls: %>% ... <Anonymous> -> lapply -> as.list -> as.list.default
Execution halted
"
The installation folder is:
C:\Program Files\R\R-3.3.1
The downloaded binary packages (add-on packages) are in:
C:\Users\dev\AppData\Local\Temp\RtmpCYKMBC\downloaded_packages
The '.libPaths()' will give the following paths:
[1] "C:/Users/dev/Documents/R/win-library/3.3"
[2] "C:/Program Files/R/R-3.3.1/library"
As during installing add-on, I have chosen to have a personal library:
Would you like to use a personal library instead? Yes
BR
Isn't there any reply to his post?
Check out the April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 11 | |
| 9 | |
| 8 | |
| 8 | |
| 8 |
| User | Count |
|---|---|
| 49 | |
| 27 | |
| 25 | |
| 20 | |
| 20 |