Praveen Kumar P
10th April 2019
EQ020419 <- read.csv("C:/Users/prave/OneDrive/bigdata/R/project/bse/EQ020419_CSV/EQ020419.CSV")
E<-data.frame(EQ020419)
View(E)
# Select required coloumns
EN<- subset(E,select =c(SC_NAME,SC_GROUP, CLOSE,PREVCLOSE))
# Find the % performance
Percent<- round(((EN$CLOSE-EN$PREVCLOSE)/EN$PREVCLOSE)*100,2)
# Bind the two datasets
EN1<- data.frame(EN, Percentage = Percent)
EN2<- EN1[order(-EN1$Percentage),]
View(EN2)
# Selecting the top 3 Rows
H<-head(EN2,n=15L)
View(H)
# Selecting the lower 3 rows
T<-tail(EN2,n=15L)
View(T)
EN3<-rbind(H,T)
View(EN3)
View(T)
EN3<-rbind(H,T)
View(EN3)
library(tidyverse, quietly = TRUE)
EN3 %>%
ggplot(aes(strtrim(EN3$SC_NAME ,3), Percentage, fill = Percentage)) +
geom_point(aes()) +
scale_colour_gradientn(colours = terrain.colors(10))
jubi533155 <- read.csv("C:/Users/prave/OneDrive/bigdata/R/project/bse/jubi533155.csv")
J<-data.frame(jubi533155)
View(J)
# Select required coloumns
JB<- subset(J,select =c(Date,Open.Price,Low.Price,High.Price,Close.Price))
View(JB)
x<-JB
View(x)
# Selecting the top 50 Rows
x<-head(JB,n=20L)
View(x)
library("ggplot2")
candlestickPlot <- function(x){
# x is a data.frame with columns 'date','open','high','low','close'
x$candleLower <- pmin(x$Open.Price,x$Close.Price)
x$candleUpper <- pmax(x$Open.Price,x$Close.Price)
x$candleMiddle <- (x$candleLower + x$candleUpper)/2
x$fill <- "red"
x$fill[x$Open.Price < x$Close.Price] = "green"
# Draw the candlesticks
g <- ggplot(x, aes(x=Date, lower=candleLower, middle=candleMiddle, upper=candleUpper, ymin=x$Low.Price, ymax=x$High.Price))
g <- g + geom_boxplot(stat='identity', aes(group=Date, fill=fill))
g
}