我想使用[R創建數據表與迷你,並用它爲我閃亮的儀表板。 簡化測試數據如下:創建[R highchart表火花
#Create lists for test df
Employee_name <- c('Alice',"Alice", "Alice", 'Brian', "Brian", "Brian","Brian",'Carol', 'Carol', 'Dan', 'Dan','Dan', 'Dan','Dan','Dan', "Lily", "Lily", "Eric", "Eric")
Product_type <- c('A', "A", "A", "A", "L",'L',"L", "A", "L", "A", "A", "A",'L', "L", "L", "R", "A", "I", "I")
Project_status <- c("Closed", "Legacy","Active","Closed", "Active", "Dropped", "Closed","Closed","Closed","Closed","Active","Dropped","Active","Closed","Dropped", "Active", "Closed", "Active", "Closed")
Proj_count_byTypeStatus <- c(2,1,1,4,12,1,4,3,2,10,3,1,3,8,1,8,1, 2,1)
#Test Data Frame
test_df <- data.frame(Employee_name, Product_type, Project_status, Proj_count_byTypeStatus)
我怎樣才能使DF弄成這樣(而不是Java,使用r碼):https://www.highcharts.com/demo/sparkline
更具體地:
- 每個人只需要一行
- Product_Type擴展到列
- Project_Status標記爲顏色「填充」
我用畫面來創建我的預期圖,希望這將有助於更好地理解我的問題:
謝謝大家的任何幫助!
任何提示將不勝感激,你不必完成編碼。謝謝!! – Daisywang