r
  • powerbi
  • rscript
  • 2017-06-07 9 views 0 likes 
    0

    Ich bin neu bei PowerBI und versuche, mein R-Netzwerkdiagramm in PowerBI anzuzeigen.RScript-Netzwerkkarte in PowerBi

    My Script arbeitet wie in R mit dem folgenden Code gewünscht:

    install.packages("maps", repos='http://cran.us.r-project.org') 
    install.packages("geosphere", repos='http://cran.us.r-project.org') 
    install.packages("readxl", repos='http://cran.us.r-project.org') 
    
    library("maps") 
    library("geosphere") 
    library("readxl") 
    
    
    airports <- read_excel("C:/Users/jeffrey.tackes/Desktop/BASEMAPPING.xlsx", 
    sheet="ASI Solo") 
    flights <- read_excel("C:/Users/jeffrey.tackes/Desktop/BASEMAPPING.xlsx", 
    sheet="edges") 
    
    map("world", col="skyblue", border="gray10", fill=TRUE, bg="black") 
    points(x=airports$long, y=airports$lat, pch=19, 
        cex=1, col="orange") 
    
    # Generate edge colors 
    col.1 <- adjustcolor("orange red", alpha=0.4) 
    col.2 <- adjustcolor("orange", alpha=0.4) 
    edge.pal <- colorRampPalette(c(col.1, col.2), alpha = TRUE) 
    edge.col <- edge.pal(100) 
    
    # For each path, we will generate the coordinates of an arc that connects 
    # its star and end point, using gcIntermediate() from package 'geosphere'. 
    # Then we will plot that arc over the map using lines(). 
    
    for(i in 1:nrow(flights)) { 
        node1 <- airports[airports$ID == flights[i,]$from,] 
        node2 <- airports[airports$ID == flights[i,]$to,] 
    
        arc <- gcIntermediate(c(node1[1,]$long, node1[1,]$lat), 
            c(node2[1,]$long, node2[1,]$lat), 
            n=1000, addStartEnd=TRUE) 
        edge.ind <- round(100) 
    
        lines(arc, col=edge.col[edge.ind], lwd=edge.ind/30) 
    } 
    

    Meine Frage ist, wie dies in PowerBI angezeigt zu bekommen? Wenn ich die RScript importieren, es zeigt meine 4 Tabellen, 2 mit den ursprünglichen Datenquellen und die zwei Datenrahmen im Skript erstellt (Node1 & Node2)

    Wenn ich R Visuals innen PowerBI gehen, das, wo ich hat verloren.
    Ich habe versucht, meine 2 Originaltabellen aus meinem R-Code hinzuzufügen, alle Felder hinzuzufügen und dann meinen R-Code in den R-Editor in PowerBI zu kopieren, aber das funktioniert nicht.

    Irgendwelche Hilfe?

    Antwort

    0
    Verwandte Themen