Learn R Programming

Latest Version 1.5.2

NOTE

nselive, nseopen nseindex, nsetree, optbanknifty and optnifty obtain data from NSE using python scripts. Thus, you need to install Python modules pandas and requests in R,

Following steps should help you to get started,

  • Install latest version of Python, Ananconda and Miniconda. And add Python as PATH variable.
  • Then in R,
install.packages('reticulate')  # Install package reticulate
library(reticulate) # Load package
# You can also install miniconda in R by,
# install_miniconda()
py_install("requests") # Install python package requests
py_install("pandas") # Install python package pandas
# Helpgul tip: you can also add interpreter in "Tools/Global options/Python/miniconda". 

You should be good to go now...

Introduction

nser helps you to download historical bhavcopy of Equities and F&O segment easily.

Package website nser

Installation

You can install “nser” from CRAN with:

install.packages("nser")

Install it from github by:

install.packages("devtools")
library(devtools)
install_github("nandp1/nser")

Example 1. Downloading Historical Equity Bhavcopy

library(nser)
# Download Bhavcopy of 1st July 2021
report1 = bhav("01072021")

Example 2. Downloading Historical F&O Bhavcopy

library(nser)
# Download Bhavcopy of 1st July 2021
report2 = fobhav("01072021")

Example 3. Downloading today’s Equity and F&O Bhavcopy

library(nser)
report3 = bhavtoday()
report4 = fobhavtoday()

Example 4. Live F&O data.

library(nser)
nselive()

Example 5. Pre market open data of F&O stocks

library(nser)
nseopen("fo")

Example 6. Current and Upcoming IPO’s

library(nser) nseipo()

Example 7. NSE Treemap

library(nser)
# NIFTY 50 stocks
nsetree()

# F&O stocks
nsetree("fo")

Example 8. Daily data to Weelkly data

library(nser)
data(dailydata)
daytoweek(dailydata)

Example 9. Daily data to Monthly data

library(nser)
data(dailydata)
daytomonth(dailydata)

Example 10. Option chain Nifty 50

library(nser)
optnifty()

Example 11. Option chain Banknifty

library(nser)
optbanknifty()

Copy Link

Version

Install

install.packages('nser')

Monthly Downloads

166

Version

1.5.3

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Nandan Patil

Last Published

July 26th, 2024

Functions in nser (1.5.3)

%>%

Pipe operator
bhavpr

Bhavcopy PR from NSE
bhavtoday

Get Bhavcopy for the present day from NSE and BSE
daytoweek

Convert Daily data of a stock to Weekly data
bhav1

Bhavcopy from NSE upto 05 July 2024
fobhav

Futures and Options Bhavcopy from NSE
bhav

Bhavcopy from NSE and BSE
fdii

Latest FII/DII data.
dailydata

Daily data of a stock
optnifty

Option Chain of NSE Nifty 50 (current expiry date).
daytomonth

Convert Daily data of a stock to Monthly data
optbanknifty

Option Chain of NSE BANKNIFTY (current expiry date).
nsetree

Treemap for Nifty50 and F&O Securities
nselive

NSE Live Market data
nseopen

NSE Pre Open Market data
fobhavtoday

Get F&O Bhavcopy for the present day
nseindex

NSE Nifty Indices
nseipo

Current and Upcoming IPO's on NSE.