您能为提迪尔提出一个解决方案吗?
我尝试使用var params = {
AccessToken: "string"
};
var cognitoidentityserviceprovider = new AWS.CognitoIdentityServiceProvider();
cognitoidentityserviceprovider.getUser(params, function(err, data) {
if (err) {
console.log(err, err.stack);
} // an error occurred
else{
console.log(data);
} // successful response
})
和gather
函数执行相同操作,但没有结果
spread
对不起,我无法发布确切要求。以下是要求。无法使其精确可重复...
# Input data
x = c("a","a","a","b","b","b")
y = c(5.1,5.8,5.3,2.2,2.7,2.4)
z = c("l","m","n","l","m","n")
xy = as.data.frame(cbind(x,y,z))
# output "Is Condition"
x y z
1 a 5.1 l
2 a 5.8 m
3 a 5.3 n
4 b 2.2 l
5 b 2.7 m
6 b 2.4 n
# I need output like this
a b z
1 5.1 2.2 l
2 5.8 2.7 m
3 5.3 2.4 n
答案 0 :(得分:0)
key
参数包含包含新列名称的列的名称value
参数包含包含用于填充值的列的名称。。
library(tidyr)
xy %>% spread(x,y) # or spread(xy, x, y)
# z a b
# 1 l 5.1 2.2
# 2 m 5.8 2.7
# 3 n 5.3 2.4