开始使用免费开始使用

使用 relocate() 调整列位置

当您想保留数据中的所有列、只是改变部分列的位置时,relocate() 会很有用。select() 也能做到这一点,但它在只需选择部分列时更合适。试试 relocate() 吧!

本练习是课程的一部分

使用 dplyr 编程

查看课程

交互式实操练习

通过完成这段示例代码来试试这个练习。

# Move consumer_price_index after usd_conversion_rate
relocated_cpi <- imf_data %>% 
  ___(___, 
      ___)

# Glimpse at this data, focusing on the column order
___
编辑并运行代码