All,
I have a set up as shown below. Everything works fine but the new serialization
default is 3, I would like it to serialize to version = 2. I've tried a couple of
different ways to set version and googled around but so far I've had no luck. The
package builds fine but then sets dependen
All,
This may not be the proper place to ask as the question is dplyr and removing
white space using mutate. My code is below:
```{r, echo = FALSE, message = FALSE
conn <- myconnection
```{r, echo = FALSE, message=FALSE}
fhlloanbalance <- tbl(conn, "fhlloan_balance_view")
colnames(fhlloa
All,
I am considering creating an S4 class whose slots (2) are both S4 classes.
Since an S4 slot can be an S3 class I figure this can be done. However, the
correct syntax of which I am unsure. Reviewing the docs I have come to the
following conclusion:
SetClass('myfoo',
s
If is specify a spline basis as follows
knots <- c(6, 12, 22, 30, 35)
x <- c(0.0, .25, 1.0, 2.0, 3.0)
SCurve <- bs(x = x, knots = knots, intercept = FALSE, Boundary.knots = c(0,3.5))
I would like to now get the spline value for new values of x. However, when I
use predict the new basis is retu
All,
I am working on structuring a FHLMC credit risk transfer deal. I have the deal
modeled as a list of lists as shown below. I would like to fill in the
CashFlows. The first step is simply to assign the current balance to the first
position in CashFlow$BeginBal. I am using the below func
All,
I have the following files in a directory and I would like only a list of those
starting with “lld" and ending with “dat”. I used the following and it gives
me the lld files
list.files(path = readpath, pattern = "^lld[A-Z0-9]")
to get just .dat files I tried
list.files(path = readpa
All,
I have a zip that was downloaded with HTTR. I had to use HTTR because I need
to login and post to the website. The files download and by double clicking
the file on my MAC the .zip file is inflated and a .txt is appears which I can
then parse as needed. However, when I use unzip either
All,
I have a function that I would like to return 0 or NA on unit root error but I
cannot figure out how to get tryCatch to work. I have followed the examples in
the R documentation as well as some online but I am missing something. If I
added the tryCatch code I only get the error value.
All,
I was getting data swap rate data from the St. Louis Fed FRED database via the
FRED API. ICE stopped reporting to FRED and now I must get the data from the
ICE website. I would like to use httr to get the data but I really don't know
much about website design. I think the form redirect
Hello All,
I have a dataframe of about 1.5 million rows from this dataframe I need to
filter out identifiers. An example would be 07-07099, AD-AD0999, and
AL-AL, FN-FN. I am using grepl to identify those of interest
as follows:
grepl("^[FN]|[AD]{2}", Identifier)
Th
I have a file that for basically carries three datasets of differing lengths.
To make this a single downloadable file the creator of the file as used both
NUL hex00 and space hex20 to normalize the lengths.
Below is the function that I am writing. I am using sed to replace the hex
characters
All,
I have a complex file I would like to parse in R a sample is described below
The header is 1:200 and the detail is 1 to 200. I have written code to parse
the file so far. As follows:
numchar <- nchar(x = data, type = "chars")
start <- c(seq(1, numchar, 398))
end <- c(seq(398, numchar, 3
Here is a sample of the data that I am working with. Dates may go back as far
as 1930’s. When I use as.Date() I noticed that any data < 12/31/68 returns as
the new century. So I wrote this function below to be applied to the data
which I dput below the function. If I use the function DateCen
All,
I need to create a function that listens to a web GUI interface and then
responds by running the needed R function. How can I do that with R? Can
anyone recommend what packages I should consider.
Glenn
__
R-help@r-project.org mailing list -- To
All I have this code
#=== Function Downloads the Factor File
#' A function to download FNMA Pool Factors
#'
#' @importFrom httr GET
#' @importFrom httr write_disk
#' @importFrom httr http_status
#' @importFrom httr progress
#' @export
FNMAPoolFactor <- function(){
All,
Is there a way to assign an API key to a value FREDAPI which is loaded and
available once a R session is has started?
Glenn
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do
All,
I am looking to find the first principal payment date on structured MBS cash
flow. I am testing the below to make into a function the correct index is
returned. I am a little unsure. Is this the correct way to think about this
problem or is there something already in R that can help?
Gl
All,
I am modeling a FNMA credit risk transfer deal. The size of the collateral 250
billion. Naturally, the cashflow is quite large the cash flow is calculated
and stored in a S4 object which is then converted to an array and the result is
character values - converting back to numeric I lose
All,
I have a file named as so 313929BL4FNMA2432.rds the user may pass either the
first 9 character or the last six characters. I need to match the remainder of
the file name using either the first nine or last six. I have read the help
files for Regular Expression as used in R and I think
Hello All,
I would like to be able to convert and S4 class to an array but I seem to be
stuck. Reading the documentation I think I need to use setAs() and then as()
Below is a minimal example but I cannot get it to work. So I am doing
something wrong but I don't know what it is.
Any insight
All,
I have not used SED in the past so I am continuing to read its documentation
but I need some help with R
Here is my SED command which works:
system("sed -i '' '/^[\r#]/d; /AGENCY/d'
/Library/Frameworks/R.framework/Versions/3.2/Resources/library/BondLab/Temp_CashFlow/blx_test.cfm")
Her
All,
I am trying to format a graph using scales and percent format but I am missing
something and all my graphics books on ggplot2 are now quite far behind where
ggplot2 is today. I seem to be missing a trick but the documentation implies
that percent_format() will multiply by 100 and add %
Hi All,
When collating a package - where does the file of constants go?
I have an R package that defines 36 new classes and the AllClasses file is
getting quite long. I would like to re-organize the files the following way -
which is also easier for my personal mental map of what is going on.
Hello All,
I am trying to create an S4 class with a slot that is an array. Below is the
code I tried but I have missed something. Any suggestions are appreciated.
setClass("CashFlow",
representation(
CashFlowArray = "array"))
setMethod("initialize",
signature = "CashFlow",
function(.Object,
Hello all,
Maybe not the right place. I have a project that is under git version control
in R studio. I just updated to recent OSX build and now the git tab in R
studio is not available. It seems I can still use version control with source
tree but it is strange that I lost git version on t
t;- read_xml(txt)
xml_attr(xml_find_all(doc, "//observation"), "value")
doc1 <- xmlParse(txt)
xpathSApply(doc1, "//observation", xmlGetAttr, "value")
On Mon, Sep 21, 2015 at 2:01 PM, Glenn Schultz wrote:
___
Hi All,
I have been trying to extract a value from XML. I have been at it for several
days off and on and I can't seem to get my head around the problem. I
basically understand the examples in R help but I cannot replicate success with
the below
I tried to use xmlValue(doc, "//[[value]]")
All,
I have made it as far as generating an api call which returns the following xml
[1] "\n\n \n\n\n\n\n"
attr(,"Content-Type")
charset
"text/xml" "UTF-8"
following DTL's presentation on the Berkley site and the package help I parsed
the xml
doc = xmlTreeParse(USSW10, asTe
Helllo All,
Need some help understanding parallel processing. I set-up DoParallel and
worked perfectly. I tried to set-up using parallel package following the book
Parallel R but I get the following error:
Error in checkForRemoteErrors(val) :
4 nodes produced errors; first error: 'what' mu
Hello All,
I have finished my first R package, BondLab, and it will be available in Feb
2016. I wrote the book and R package concurrently. Prior, I had very little
programming experience other than VBA and using others R packages.
http://www.amazon.com/Investing-Mortgage-Backed-Securities
Hi All,
I am writing a Vignette with Knitr using devtools ... actually quite awesome.
However, I would like to create a table of contents. I have read the knitr and
r markdown instructions on TOC and I can create a TOC in a markdown document
but I cannot translate the command to a vignette -
Hello All,
The data is as follows below with ggplot command. I would like there to be two
digits to the right of the decimal on the y axis - this would be consistent
with plotting interest rates. I have not had much luck. Any ideas are
appreciated
-glenn
structure(list(Tenor = c(0, 1, 2,
I have the following code which creates a spline function
x <- c(1, 12, 24, 36, 60, 120, 200, 240, 300, 360)
y <- c(.2, 8, 8, 8, 8, 8, 8, 8, 18, 50)
Baseline <- cbind(x,y)
Turnover <- splinefun(Baseline[,1], Baseline[,2], method = "natural")
plot(Turnover(seq(1, 360, 1)), type = "l")
If I chan
All,
I am using gglpot to produce combination density and histogram plots, which are
actually kinda cool, everything works well and the plots look nice. However
after each plot run I receive the following message:
stat_bin: binwidth defaulted to range/30. Use 'bin width = x' to adjust this.
Hello All,
I have two packages Bond Lab and the Companion to Investing in MBS. Bond Lab
clears the check and I am working on the on.load() to copy a needed directory
per Duncan Murdoch's advise to make Bond Lab CRAN-able. The companion passes
with two notes. The output is below:
I get two
Attached is dput of the pass through OAS
__
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
Hello All,
I have a function which outputs graphically the results of a pass-through OAS
analysis. The viewport is 2x2. The idea is to leave a small margin at the top
and enter a title with something like the following.
Bond Lab Pass Through OAS
Bond Id: f...@bond.id
OAS : foo@OAS
I am a
Hello R help,
I am in the process of creating the companion to my book which illustrates how
to call Bond Lab (my R package for MBS and fixed income).
I started with the idea of scripts and then functions calling functions.
Neither seemed very good to me. I checked a couple of packages (Max
I have an R package Bond Lab which actually supports a book Investing in MBS
using R and Open Source Computing. The Bond Lab beta is stable. I have also
created a package companion to investing in MBS. Both are on my Github site
https://github.com/glennmschultz/
I wrote the companion as fun
uot;character")
{standardGeneric("TermStructure")})
On May 11, 2015, at 01:54 AM, Thierry Onkelinx wrote:
Dear Glenn,
We need more details on the function. Please provide a commented, minimal,
self-contained version of the function that reproduces the problem (as the
post
Hello All,
Testing my code on a Windows based machine today. There seems to be an offending line of
code. I have pasted it below. Basically, I check to see if the user passed a fit method
to TermStructure and if not then default to "ns".
The above works fine on my Mac but a windows build
Hello All,
I have set-up the \inst directory and now looking to the .onLoad and .onAttach
for side Effects. The Bond Lab data directories are all in \inst\BondLab.
The connection functions for BondLab are ~\users\BondLab\foo.
I would like to be able to create and copy the \inst\BondLab fo
Hi All,
I have my R package built and it passes the CRAN tests. Now, I have a
question. The file structure is not standard. There are addition data files
as follows outlined below. Each, if you will, represents separation of
concerns with respect to structured securities like MBS and REMIC
Hello All,
I am working on the documentation for my R package and I have a question
regarding the help files. I have noticed in some packages the developer
created an alphabetical list with hyper links. My package is for the analysis
of mortgage backed securities. So I would like to organi
Hello All,
I have finally addressed all the cmd issues with my package build "bondlab." I
would like to thank everyone that took the time to answer my questions. I have the
following question: Currently the package has a non-standard directory/folder structure.
The non-standard folders are
Hello All,
I have a custom color palette as illustrated below. I have more than 8
variables. In the case of more than 8 variables I would simply like to recycle
the color. Has anyone done this or know of a way to have to colors recycle if
there are more than 8 variables.
Best Regards,
Gl
All,
I am doing something wrong but I don't see what. When I plot in ggplot all the
lines are on top of one another but the data is not. Any help is appreciated.
Thanks,
Glenn
# I use this function to generate data
Burnout <- function(beta1 = numeric(),
beta
I can get bigglm working with the following code.
ModelFit <- bigglm(SMM ~
I(1-.88 * exp(-.192 * LoanAge))+
ns(Incentive, df = 5)+
Purpose +
Occupancy +
TPO +
Servicer,
Hello All,
I have to admit that I am not that good when it comes to vectorizing a
function. I need some insight. Is the below a case where vectorization can be
accomplished to improve speed?
Below the function a sample data - as you can see it is not delimited. However, the
record length i
The description file is as follows:
Package: BondLab
Type: Package
Title: A package for the analysis of structured products
Version: 0.0.0
Date: 2013-12-08
Author: Glenn Schultz, CFA
Maintainer: Glenn Schultz
Description: The package provides a suite of software utilities for the
analysis of
Type: Package
Title: A package for the analysis of structured products
Version: 0.0.0
Date: 2013-12-08
Author: Glenn Schultz, CFA
Maintainer: Glenn Schultz
Description: The package provides a suite of software utilities for the
analysis of Mortgage and Asset Backed securities
LazyLoad: yes
License
Hello All,
I am in the final stages of building my first package "BondLab" and the check
throughs the following warning. I think this is namespace thing. I have not done
anything with the namespace at this point. I am turning my attention to the namespace
now. Am I correct this can be a ha
Hello All,
I am nearing the end of the Package BondLab. This package is for the analysis
of structured securities (MBS, REMICs, and Mortgage derivatives). I would like
to submit to CRAN but the folder structure is not standard. Indeed, I plan to
reorganize the folder structure outside the p
Hi All,
I am working on a package BondLab for the analysis of fixed income securities.
Building the package results in the following:
Error in loadNamespace(package, c(which.lib.loc, lib.loc)) :
cyclic namespace dependency detected when loading ‘BondLab’, already loading
‘BondLab’
It occur
Hello All,
I need some help with optimx, mostly due to my apparent lack of imagination
than optimx itself. Below is the pertinent code for which I have a question.
I am fitting to the term structure of swap rates per Cox, Ingersoll, and Ross.
As you can see the objective function is CIRTune.
I have a class Details that contains information needed by FirstSet to do some
calculations then a super class that returns Details and FirstSet. The problem
seems to be in FirstSet where I use the function getAnumber(id).
setClass("Details",
representation(
ID = "charact
56 matches
Mail list logo