当前位置: 首页 > news >正文

勒流网站建设玄幻小说排行榜百度风云榜

勒流网站建设,玄幻小说排行榜百度风云榜,如何建设一个工业品采购网站,R shinny网站开发API的的调用目前来说不限制地区,但是OpenAI的API的申请限制了地区。运行的时候,如果出现了429,意味着你被限流了,需要等一会才行。 前提是,你需要注册一个OpenAI的账户,然后在https://openai.com/api/ 里申…

API的的调用目前来说不限制地区,但是OpenAI的API的申请限制了地区。运行的时候,如果出现了429,意味着你被限流了,需要等一会才行。

前提是,你需要注册一个OpenAI的账户,然后在https://openai.com/api/ 里申请OpenAI的密钥。

在页面左上角,点击头像,选择View API Keys

在这里插入图片描述

然后新建一个密钥,并复制。

接着,我们需要在R语言中设置一个环境变量OPENAI_API_KEY。

这有两种方式,一种是每次启动RStudio后手动运行如下代码

Sys.setenv(OPENAI_API_KEY = "你复制的密钥")

另一种是利用usethis包,通过如下代码在项目目录下创建一个.Renviron文件

library(usethis)
usethis::edit_r_environ(scope = "project")

在该文件中设置OPENAI_API_KEY,并保存该文件。

在这里插入图片描述

之后从github上安装gptstudio

#install.packages("devtools")
devtools::install_github("MichelNivard/gptstudio")

安装完毕后,你的RStudio中的Addins就会出现GPTSTUDIO工具栏

在这里插入图片描述

如我们所见,它的功能主要有7项。

我们可以让它帮我们写代码,例如你写了一段注释,

# write a R code for volcano plot with result from 
# DESeq2

然后选择插件的Write/Code from prompt,过了一会就能生成如下的代码

# install and load the DESeq2 package
install.packages("DESeq2")
library(DESeq2)# read the data
data <- read.csv("data.csv")# create a DESeqDataSet
dds <- DESeqDataSetFromMatrix(countData = data,colData = data$condition,design = ~ condition)# run the DESeq2
dds <- DESeq(dds)# extract the results
res <- results(dds)# create the volcano plot
plot(res$log2FoldChange, -log10(res$padj),xlab = "log2 Fold Change",ylab = "-log10 Adjusted p-value",main = "Volcano Plot")# add points
points(res$log2FoldChange, -log10(res$padj),pch = 20,col = ifelse(res$padj < 0.05, "red", "black"))# add lines
abline(h = -log10(0.05), lty = 2, col = "blue")
abline(v = 0, lty = 2, col = "blue")

此外,可以让它帮我们给代码写注释,比如说你在Rstudio中输入如下内容,

set.seed(1)
mtcars2 <- transform(mtcars, mpg = ifelse(runif(32) < 0.2, NA, mpg))
ggplot(mtcars2, aes(wt, mpg)) +geom_point()

选择代码后,在Addins中选择了 Comment your code,我们就会得到如下的内容。

# load the ggplot2 package
library(ggplot2)
# set the seed for the random number generator
set.seed(1)
# create a new variable called mtcars2, which is a copy of the mtcars dataset
# with 20% of the mpg values replaced with NA
mtcars2 <- transform(mtcars, mpg = ifelse(runif(32) < 0.2, NA, mpg))
# create a scatterplot of mpg vs wt, with mpg on the y-axis and wt on the x-axis
ggplot(mtcars2, aes(wt, mpg)) +geom_point()

其他功能可以通过官方文档进行了解哦https://github.com/MichelNivard/gptstudio

http://www.dt0577.cn/news/32318.html

相关文章:

  • 优化网站有哪些方法爱上链外链购买平台
  • asp.net获取网站的域名北京百度推广优化排名
  • wordpress默认主题下载地址北京知名seo公司精准互联
  • 做商业网站需要注册公司吗百度搜索广告推广
  • 如何用模板建设网站我国的网络营销公司
  • wordpress机械行业模板珠海关键词优化软件
  • 急招一对夫妻门卫6500元seo收费标准多少
  • wordpress 图片名乱码seo需要付费吗
  • 网站建设管理办法seo 是什么
  • 珠海网站建设推广服务免费论坛建站系统
  • 哪个网站是做批发的百度网络营销app下载
  • 做全景的网站百度网址提交
  • 国家信用信息公示系统官网信阳seo
  • 句容建设路幼儿园网站关闭站长工具seo综合查询
  • 优化前网站现状分析百度流量统计
  • 企业公司建设网站品牌营销咨询公司
  • so域名网站友情链接交易购买
  • 网教网站源码平台推广怎么做
  • 浪潮云网站建设搜索引擎站长平台
  • 做游戏装备网站可以吗seo优化范畴
  • 做招聘网站需要多少钱免费网站推广平台
  • 容易被百度收录的网站潮州网站建设
  • 石家庄做手机网站推广电商最好卖的十大产品
  • 哈尔滨网站优化公司网络营销推广方案
  • 做网店网站推广普通话活动方案
  • 制作网站的基本工作流程网站的收录情况怎么查
  • 做电影网站一年赚多少如何在百度发布短视频
  • wordpress静态404杭州seo中心
  • 石家庄公司网站设计网站关键词优化排名外包
  • vs2008 网站消息弹窗怎么做一个新产品策划方案