LoslegenKostenlos loslegen

Plotting choice shares

Let's finish this chapter by making a plot of the choice shares we just produced. We stored the choice shares in a column called share within the data frame called shares. We can plot shares$share using barplot(). If you are unfamilar with barplot(), you can type ?barplot to view the documentation.

Diese Übung ist Teil des Kurses

Choice Modeling for Marketing in R

Kurs anzeigen

Anleitung zur Übung

Set the first input for the barplot function to shares$share.

Interaktive Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

# Use barplot to plot predicted market shares
barplot(___, ylab="Predicted Market Share", 
        names.arg=c("Our Car", "Comp 1", "Comp 2", "Comp 3"))
Code bearbeiten und ausführen