Learn R Programming

Ecfun

0.4.0

Functions and vignettes to update a few data sets in 'Ecdat' and to create, manipulate, plot, and analyze some of those and similar data sets.

2025-08-24

add grepInTable and update vignette/UpdatingUSGDPpresidents.Rmd

2024-11-09

Added functions readDW_NOMINATE and findCountry

2021-06-29

All read* functions in this package have been removed, because it wasn't clear if anyone was using them. Other functions that called an Ecfun::read* function by default were also deleted, especially UShouse.senate, USsenateClass, and mergeUShouse.senate. These all scraped websites, and the demand for them seemed not to justify the work of maintaining them.

2021-05-20

[![R-CMD-check](https://github.com/sbgraves237/Ecfun/workflows/R-CMD-check/badge.svg)](https://github.com/sbgraves237/Ecfun/actions) [![R-CMD-check](https://github.com/sbgraves237/Ecfun/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/sbgraves237/Ecfun/actions/workflows/R-CMD-check.yaml)

2020-01-23

testURLs and read.testURLs have been removed, because it wasn't clear that anyone was using them, and more modern tools are available from:
http://www.measurementlab.net/

Thanks to Iñaki Ucar, Adam H Sparks, and Roy Mendelssohn for their replies to a question posted to R-Devel helped me understand what I needed to do to fix problems identified in the CRAN Checks.

Copy Link

Version

Install

install.packages('Ecfun')

Monthly Downloads

5,717

Version

0.4.0

License

GPL (>= 2)

Maintainer

Spencer Graves

Last Published

August 25th, 2025

Functions in Ecfun (0.4.0)

asNumericDF

Coerce to numeric dropping commas and info after a blank
Ping

ping a Uniform resource locator (URL)
Newdata

Create a new data.frame for predict
Interp

Interpolate between numbers or numbers of characters
camelParse

Split a character string where a capital letter follows a lowercase letter
Date3to1

Convert three YMD vectors to a Date
Arrows

Draw arrows between pairs of points.
as.Date1970

Date from a number of days since the start of 1970.
Dates3to1

Convert 3-column dates in data to class Date
BoxCox

Box-Cox power transformation and its inverse
confint.var

Confidence interval for sample variance or standard deviation
canbeNumeric

Can a variable reasonably be coerced to numeric?
checkNames

Check and return names
createX2matchY

Create X to match Y
createMessage

Compose a message as a single substring from a character vector
classIndex

Convert class to an integer 1-8 and vice versa
compareLengths

Compare the lengths of two objects
compareOverlap

Compare y between newDat and refDat for shared values of x
countByYear

Allocate a total by year
countsByYear

Allocate totals by year
dateCols

Identify YMD names in a character vector
logVarCor

Log-diagonal representation of a variance matrix
grepInTable

Find a 3-letter country code in rworldmap::countrySynonyms
interpPairs

interpolate between pairs of vectors in a list
interpChar

Interpolate between numbers or numbers of characters
deletedFunctions

Functions deleted from the Ecfun package
match.data.frame

Identify the row of y best matching each row of x
grepNonStandardCharacters

grep for nonstandard characters
getElement2

Extract a named element from an object with a default
matchName

Match surname and givenName in a table
nchar0

Zero characters or NULL
pmatch2

Value matching or partial matching
matchQuote

Match isolated quotes across records
missing0

Missing or length 0
qqnorm2

Normal Probability Plot with Multiple Symbols
parseName

Parse surname and given name
parseDollars

Convert character string with Dollar signs and commas to numerics
pmatchIC

pmatch ignoring case
parseCommas

Convert character string with Dollar signs and commas to numerics
mergeVote

Merge Roll Call Vote
readDates3to1

read.csv with Dates in 3 columns
qqnorm2s

Normal Probability Plot with Multiple Lines and Multiple Symbols
qqnorm2t

Normal Probability Plot with Multiple Lines and Multiple Symbols
readNIPA

Read a National Income and Product Accounts data table
rgrep

Reverse grep
read.transpose

Read a data table in transpose form
recode2

bivariate recode
rasterImageAdj

rasterImage adjusting to zero distortion
sign

Sign function with zero option
readDW_NOMINATE

Read the DW-NOMINATE data from their website.
subNonStandardNames

sub for nonstandard names
strsplit1

Split the first field
whichAeqB

Index of a single match
simulate.glm

A "simulate" method for a glm object
simulate.bic.glm

A "simulate" method for a BMA::bic.glm object
subNonStandardCharacters

sub nonstandard characters with replacement
trimImage

Trim zero rows or columns from an object of class Image.
truncdist

Truncated distribution