← 返回 google 的题目列表R dplyr Application: Sample and Join
类型:online_judge
Given a data frame, randomly select half of the samples to keep the original price, and increase the price of the other half by 10%. Compute the average price for each simulated data. Please provide complete requirements, test cases, and data scale details.
Example
Input
Data frame: [{id: 1, price: 100}, {id: 2, price: 200}, {id: 3, price: 150}, {id: 4, price: 130}]