EconPapers    
Economics at your fingertips  
 

Derivatives with R

Thomas J. Pfaff ()
Additional contact information
Thomas J. Pfaff: Ithaca College, Department of Mathematics

Chapter Chapter 15 in Applied Calculus with R, 2023, pp 185-197 from Springer

Abstract: Abstract The DerivRDeriv DerivativeR package in R has a function that performs symbolic differentiation. The first line in R Code box 15.1 loads the Deriv package with the library command (this assumes the packages has been installed on your computer with install.packages(“Deriv") as noted in Chapter 1 ). Recall that a package has to be loaded only once per session and so we won’t have library(Deriv) in the examples below after the first example. The second line defines the CO2 function. The third line sets CO2_p to the derivative of CO2 using the Deriv function. We use the convention of adding _p to denote the derivative of a function in R since we don’t have the option of using a prime. In other words, we use f_p for the derivative of f in R because we cannot use $$f'(x)$$ f ′ ( x ) . The last line outputs the derivative function. Note that Deriv(CO2) by itself will produce this output but by assigning CO2_p to Deriv(CO2) we can use the CO2_p function. For example, R Code box 15.2 outputs the derivative of CO2 for 2017 with CO2_p(67), which we estimated in Chapter 4 and calculated in example 11.8 .

Date: 2023
References: Add references at CitEc
Citations:

There are no downloads for this item, see the EconPapers FAQ for hints about obtaining it.

Related works:
This item may be available elsewhere in EconPapers: Search for items with the same title.

Export reference: BibTeX RIS (EndNote, ProCite, RefMan) HTML/Text

Persistent link: https://EconPapers.repec.org/RePEc:spr:sprchp:978-3-031-28571-4_15

Ordering information: This item can be ordered from
http://www.springer.com/9783031285714

DOI: 10.1007/978-3-031-28571-4_15

Access Statistics for this chapter

More chapters in Springer Books from Springer
Bibliographic data for series maintained by Sonal Shukla () and Springer Nature Abstracting and Indexing ().

 
Page updated 2026-06-01
Handle: RePEc:spr:sprchp:978-3-031-28571-4_15