Submitted Answer
CHANGED
@@ -1,3 +1,11 @@
|
|
1 |
-
|
2 |
SELECT 'DataCamp <3SQL'
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Plot the portfolio value and name it "Portfolio Value"
|
2 |
+
plot(data[,"value"], main = "Portfolio Value")
|
3 |
+
|
4 |
+
# Plot the portfolio return name it "Portfolio Return"
|
5 |
+
plot(data[, "return"], main = "Portfolio Return")
|
6 |
+
|
7 |
+
# Plot a histogram of portfolio return
|
8 |
+
hist(data[, "return"], probability = TRUE)
|
9 |
+
|
10 |
+
# Add a density line
|
11 |
+
lines(density(data$return), col = "red", lwd = 2)
|