This is my ggplot function and the resultant error
plot1 = ggplot(data= RiskReturn, aes(x = cov_matrix, y = averagereturn))
plot1 = plot1 + geom_point()
plot1 = plot1 + xlab("Risk/Variance") +
ylab("Daily Returns") +
ggtitle("Risk Return Relationship")
plot1
Don't know how to automatically pick scale for object of type data.frame. Defaulting to continuous. Error: Column
x
must be a 1d atomic vector or a list
My output for RiskReturn
, cov_matrix
and averagereturn
is shown below
RiskReturn
1 SASINI KQ NMG BBK
SASINI 4.979369e-04 8.456428e-04 5.445880e-05 1.239006e-04 9.332421e-06
KQ -8.128663e-04 5.445880e-05 2.401885e-03 -6.811349e-04 1.821386e-05
NMG -1.833540e-04 1.239006e-04 -6.811349e-04 4.767065e-03 3.323995e-05
BBK -7.500765e-06 9.332421e-06 1.821386e-05 3.323995e-05 2.224748e-04
CFC 4.311257e-04 1.538035e-05 -4.279245e-07 3.245089e-05 2.275598e-05
cov_matrix
SASINI KQ NMG BBK CFC
SASINI 8.456428e-04 5.445880e-05 1.239006e-04 9.332421e-06 1.538035e-05
KQ 5.445880e-05 2.401885e-03 -6.811349e-04 1.821386e-05 -4.279245e-07
NMG 1.239006e-04 -6.811349e-04 4.767065e-03 3.323995e-05 3.245089e-05
BBK 9.332421e-06 1.821386e-05 3.323995e-05 2.224748e-04 2.275598e-05
CFC 1.538035e-05 -4.279245e-07 3.245089e-05 2.275598e-05 5.273949e-04
averagereturn
SASINI KQ NMG BBK CFC
4.979369e-04 -8.128663e-04 -1.833540e-04 -7.500765e-06 4.311257e-04