我想根据https://spark.apache.org/docs/latest/sparkr.html#gapply使用gapply
问题是我返回了一个包含2个数据帧的列表。
return(list(df1,df2))
在这种情况下,我如何声明输出模式?
发布于 2018-01-28 22:16:36
不能使用返回任意列表的函数。As per gapply documentation (我的重点):
函数
的参数是一个关键字分组列和一个数据帧-一个本地R
data.frame。func的输出是一个本地的R data.frame.
只要两个输出data.frame具有相同模式,您就可以通过将每个Row视为与struct<col1:array<typeofcol1>, col2:array<typeofcol2>, ..., coln:array<typeofcoln>>、等同类型的单个data.frames,但仅将其视为来使其工作。
https://stackoverflow.com/questions/48473327
复制相似问题