[R] Explanation required for the examples given for the 'curl' function in the 'r' package 'calculus'

2022-11-29 Thread Winod Dhamnekar
Hello sir,

In the Reference manual given by Cran.r-project.org, the following examples
for the function 'curl' are given.

I know how to compute 'curl' in octave. I can use HP 50g calculator to
compute curl of a vector field to compute line integrals using Stokes's
theorem.

I compute curl of a vector field manually as well.

But I don't understand these examples. The results after running the
examples in 'R' are given below:
  curl> ### symbolic curl of a 2-d vector field
curl> f <- c("x^3*y^2","x")

curl> curl(f, var = c("x","y"))
[1] "(1) * 1 + (x^3 * (2 * y)) * -1"

curl> ### numerical curl of a 2-d vector field in (x=1, y=1)
curl> f <- function(x,y) c(x^3*y^2, x)

curl> curl(f, var = c(x=1, y=1))
[1] -1

curl> ### numerical curl of a 3-d vector field in (x=1, y=1, z=1)
curl> f <- function(x,y,z) c(x^3*y^2, x, z)

curl> curl(f, var = c(x=1, y=1, z=1))
[1]  0  0 -1

curl> ### vectorized interface
curl> f <- function(x) c(x[1]^3*x[2]^2, x[1], x[3])

curl> curl(f, var = c(1,1,1))
[1]  0  0 -1

curl> ### symbolic array of vector-valued 3-d functions
curl> f <- array(c("x*y","x","y*z","y","x*z","z"), dim = c(2,3))

curl> curl(f, var = c("x","y","z"))
 [,1]   [,2]   [,3]
[1,] "(y) * -1" "(z) * -1" "(x) * -1"
[2,] "0""0""0"

curl> ### numeric array of vector-valued 3-d functions in (x=1, y=1, z=1)
curl> f <- function(x,y,z) array(c(x*y,x,y*z,y,x*z,z), dim = c(2,3))

curl> curl(f, var = c(x=1, y=1, z=1))
 [,1] [,2] [,3]
[1,]   -1   -1   -1
[2,]000

curl> ### binary operator
curl> c("x*y","y*z","x*z") %curl% c("x","y","z")
[1] "(y) * -1" "(z) * -1" "(x) * -1"

Yours R-help subscriber
Winod Dhamnekar

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] CandlestickCharts of any listed stock and fetching stock prices into R

2021-12-18 Thread Winod Dhamnekar
Hello,
R users community,
 I want to plot candlestickCharts of any stock prices of listed companies
on any stock exchange (Indian or  worldwide) into r by using
candlestickchart command in 'FinCal' r package. But I could not plot
candlestic charts. R showed me errors.


 candlestickChart(ohlc,2020-12-18,2021-12-17,"Google")
Error in as.Date(ohlc$date) : object 'ohlc' not found
> candlestickChart(get.ohlc.google,2020-12-18,2021-12-17,"Google")
Error: object of type 'closure' is not subsettable
> candlestickChart(get.ohlc.google,2020-12-18,2021-12-17,"Google")
Error: object of type 'closure' is not subsettable


What is the suitable syntax to use candlestickchart command from 'FinCal' r
package?

I also tried to fetch stock prices of listed companies on any stock
exchange (wordwide or Indian) But I could not fetch stock prices.
  # google <- get.ohlc.yahoo("GOOG",start="2014-07-01",end="2014-08-01");
candlestickChart(google)
 # google <- get.ohlc.yahoo("GOOG",start="2020-12-18",end="2021-12-17");
candlestickChart(google)
> candlestickChart(ohlc,2020-12-18,2021-12-17,"Google")
Error in as.Date(ohlc$date) : object 'ohlc' not found
> candlestickChart(get.ohlc.google,2020-12-18,2021-12-17,"Google")
Error: object of type 'closure' is not subsettable
> candlestickChart(get.ohlc.google,2020-12-18,2021-12-17,"Google")
Error: object of type 'closure' is not subsettable

 get.ohlc.yahoo("BOM:532504", 18-12-2021,17-12-2021,d)
Error in strsplit(start, "-") : non-character argument
> get.ohlc.yahoo('BOM:532504', 18-12-2021,17-12-2021,d)
Error in strsplit(start, "-") : non-character argument
> get.ohlc.yahoo(BOM:532504, 18-12-2021,17-12-2021,d)
Error in strsplit(start, "-") : non-character argument
 # google <- get.ohlc.yahoo("GOOG",start="2020-12-18",end="2021-12-17");
candlestickChart(google)
> candlestickChart(ohlc,2020-12-18,2021-12-17,"Google")
Error in as.Date(ohlc$date) : object 'ohlc' not found
> candlestickChart(get.ohlc.google,2020-12-18,2021-12-17,"Google")
Error: object of type 'closure' is not subsettable
 candlestickChart(ohlc,2020-12-18,2021-12-17,"Google")
Error in as.Date(ohlc$date) : object 'ohlc' not found

  How can I plot candlestickchart and fetch stock prices of any period with
any frequency of time intervals?

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] 'FinCal' and 'ggplot2' packages are loaded.

2021-12-17 Thread Winod Dhamnekar
Hello,
R-users community,
 Thanks to Bert Gunter for his r-help. 'FinCal' and 'ggplot2' packages are
now loaded after installing 'Fansi  in r.

Winod Dhamnekar (R-user)

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] FinCal and ggplot2 packages in r could not be loaded.

2021-12-17 Thread Winod Dhamnekar
 Hello R users community,
 I installed 'FinCal' and  'ggplot2' packages in r and tried to load
 them, but I couldn't load them. R gave me the following error.

>library(FinCal)
Error: package or namespace load failed for ‘FinCal’ in loadNamespace(j <-
i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
 there is no package called ‘fansi’
> library(ggplot2)
Error: package or namespace load failed for ‘ggplot2’ in loadNamespace(j <-
i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
 there is no package called ‘fansi’

WMD('R' user)

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.