LoslegenKostenlos loslegen

Factor summary

As any good bond investor would do, you would like to keep track of how many bonds you are holding of each credit rating. A way to present a table of the counts of each bond credit rating would be great! Luckily for you, the summary() function for factors can help you with that.

The character vector credit_rating and the factor credit_factor are both in your workspace.

Diese Übung ist Teil des Kurses

Introduction to R for Finance

Kurs anzeigen

Anleitung zur Übung

  • First call summary() on credit_rating. Does this seem useful?
  • Now try summary() again, but this time on credit_factor.

Interaktive Übung

Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.

# Summarize the character vector, credit_rating


# Summarize the factor, credit_factor
Code bearbeiten und ausführen