|
- library('RCurl', quietly=TRUE)
- library('plotly', quietly=TRUE)
- library('ggplot2', quietly=TRUE)
- library('png', quietly=TRUE)
- ## Sign up plotly account
- #'@ res <- signup (username = 'englianhu', email= 'englianhu@gmail.com')
- #'@ plotly:::verify('englianhu')
- #'@ plotly:::verify('khyl2apntp')
- py <- plot_ly(username = 'englianhu', key = 'khyl2apntp')
- Sys.setenv('plotly_username'='englianhu')
- Sys.setenv('plotly_api_key'='khyl2apntp')
- myurl <- 'https://m2.behance.net/rendition/pm/3653625/disp/e90f16d73f2c1198d3fd92f70dd3a637.png'
- iron <- readPNG(getURLContent(myurl))
- > ## http://www.r-bloggers.com/3d-surface-plots-with-rstudio-and-plotly/
- > data <- list(iron, type='surface')
- >
- > ## Finally, specify layout information and filename:
- > layout <- list(
- + title = 'Iron Man Model',
- + scene = list(bgcolor='rgb(244, 244, 248)'))
- >
- > res <- py$plot_ly(data, kwargs=list(
- + layout=layout))
- Error: attempt to apply non-function
- > py$plotly(data, kwargs=list(
- + layout=layout,
- + filename='IronMan',
- + fileopt='overwrite'))
- Error: attempt to apply non-function
- > View(iron)
- > write.table(iron,'iron.txt')
复制代码
Data Visualization 根本不就咱的强项,今早大略看了下 animation、plotly 和 rgl (安装不了)。太难了,结果尝试readPNG个网络图片转成array后,再上载到plotly去修改一下基本模型,怎知 ouput 还真吓人!一面墙壁而已... (有空再慢慢玩玩儿data visualization... 日后才能建立只立体的 G 钢弹机器人,再使用animation程序包...)
https://plot.ly/~englianhu/120/i ... 0sH7uHEo8eYUQzERvqK
咱的足球data还没完成,频频打瞌睡... 先搁着... 它日再来认识一下怎么建立立体机器人模型。{:soso_e125:}
|
|