เริ่มต้นใช้งานเริ่มต้นใช้งานได้ฟรี

Apply

In this exercise, you will "apply" the function female_residence_prop() to obtain the proportion of female borrowers for both urban and rural areas for all years using the Map() function.

แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร

Scalable Data Processing in R

ดูคอร์ส

คำแนะนำการฝึกหัด

spl from the previous exercise is available in your workspace.

  • Call Map() on each of the row splits of spl.
  • Recall that the function to apply is female_residence_prop(). Assign the result to all_years.
  • View the str()ucture of all_years.

แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ

ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์

# For each of the row splits, find the female residence proportion
all_years <- ___(function(rows) ___(mort, rows), ___)

# Call str on all_years
___
แก้ไขและรันโค้ด