首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ee$List$repeat的问题

ee$List$repeat的问题
EN

Stack Overflow用户
提问于 2020-11-27 02:27:45
回答 1查看 67关注 0票数 1

我正在尝试使用rgee包在Google Earth引擎中运行以下代码:

代码语言:javascript
复制
# Load rgee
library(rgee)

# Initialise
ee_users()
ee_Initialize()

# The incorrect use of repeat within an rgee context
ee$List$repeat(1,3)

但是我得到了一个错误:

代码语言:javascript
复制
Error: unexpected 'repeat' in "ee$List$repeat"

是不是因为在基数r中与repeat有一些混淆?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-12-01 00:01:27

对于R保留字,使用反引号/引号:

代码语言:javascript
复制
    # Load rgee
    library(rgee)
    
    # Initialise
    ee_users()
    ee_Initialize()
    
    # The incorrect use of repeat within an rgee context
    ee$List$'repeat'(1,3)$map( 
        ee_utils_pyfunc( #ee_utils_pyfunc is necessary to apply a map function to an ee$List
          function(x) {
            ee$Number(x)$add(1)
          }
        )    
    )
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65027506

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档