RPubs will retire in June 2027. Your existing documents will stay accessible through December 31, 2031
and Connect Cloud is the recommended home for new publishing. Read the blog post
gravatar

jfm

童杰

Recently Published

HTML
# 创建示例数据框 grain_yield_data <- data.frame( Time = 2019:2023, # 贵州省近五年预测 grain_yield = c(1051.24, 1057.63,1094.86,1114.64, 1119.68) # 对应的粮食总产量数据 ) # 使用plotly创建动态折线图 plot_ly(grain_yield_data, x = ~Time, y = ~grain_yield, type = 'scatter', mode = 'lines', line = list(color = 'blue', width = 2), name = '粮食总产量', hoverinfo = 'text', text = ~paste('时间:', Time, '<br>粮食产量:', grain_yield, '万吨') ) %>% layout(title = '贵州省近五年粮食总产量的动态折线图', xaxis = list(title = '时间(年)'), yaxis = list(title = '粮食总产量(万吨)') )