gpt4 book ai didi

r - 为什么在调用 rcloud.notebook.by.name() 时需要 [1]?

转载 作者:行者123 更新时间:2023-12-02 01:02:31 24 4
gpt4 key购买 nike

RCloud函数 rcloud.notebook.by.name() ,为什么this example中的函数后面需要[1] :

rcloud.execute.asset(name="mtcars.R",
notebook=rcloud.notebook.by.name(
user="rclouddocs",
name="Basic Functionality/Create Reusable Functions/Notebook With R Function in Assets")[1]
)

最佳答案

此函数不仅返回笔记本 ID。它还返回查询未使用的路径的任何部分。

在 rcloud.social 上也是如此

rcloud.notebook.by.name(
user="rclouddocs",
name="Basic Functionality/Create Reusable Functions/Notebook With R Function in Assets")

返回

     id                                 extra.path
[1,] "6c90abc418dec48ec4e9016ad0187f95" ""

但是如果你在末尾添加更多路径:

rcloud.notebook.by.name(
user="rclouddocs",
name="Basic Functionality/Create Reusable Functions/Notebook With R Function in Assets/blablabla

你得到

     id                                 extra.path  
[1,] "6c90abc418dec48ec4e9016ad0187f95" "/blablabla"

这被 notebook.R 内部使用;它是允许按用户、笔记本路径和 Assets 名称获取 Assets 的代码,例如从具有以下 URL 的同一笔记本中获取 mtcars.R:

https://rcloud.social/notebook.R/rclouddocs/Basic%20Functionality/Create%20Reusable%20Functions/Notebook%20With%20R%20Function%20in%20Assets/mtcars.R

关于r - 为什么在调用 rcloud.notebook.by.name() 时需要 [1]?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49661534/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com