Skip to content
Prev 392122 / 398502 Next

A humble request

Hi, Richard:  Thanks for the question.


	  "Source the function" means the following.


	  1.  Go to "https://cran.r-project.org/" and download the most recent 
version.  To do that, I found "archived" under "Related Directories".  I 
clicked on that and then searched for "wmtsa".  To the right of that, it 
says it was "Last Modified" "2020-06-09 07:24".  Note that "Last 
Modified", because you can use that to find recent documentation, etc., 
from "archive.org" shortly prior to that date.


	  2.  Click on "wmtsa".  That takes you to "Index of 
/src/contrib/Archive/wmtsa", which includes 11 different versions of the 
source code for that package from "wmtsa_1.0-1.tar.gz 2007-09-23 21:54 
139K" to "wmtsa_2.0-3.tar.gz 2017-12-06 12:14 151K" Click on the last 
one to download it.  This downloaded a file by that name to the 
"Downloads" folder in my computer.


	  3.  Create a directory for that file.  I have a directory called "R" 
on my computer.  I just created a new directory called "wmtsa" within 
that "R" directory.  Then I moved that file into that directory and 
unzip it by double clicking on it.  As a result, I now have a directory 
"~R/wmtsa/wmtsa".


	  4.  To compile that package, I routinely in a Terminal in R (called 
something else in Windows), I "cd" until I get to "~R/wmtsa".  Then I 
run "R CMD check "wmtsa_2.0-3.tar.gz".  I just did that.  It said, 
"ERROR  Packages required but not available: 'splus2R', 'ifultools'". 
In R, I was able to download the first using 
"install.packages('splus2R')".  When I tried 
"install.packages('ifultools')", I got a message, "package ?ifultools? 
is not available for this version of R".


	  5.  However, the inner "wmtsa" directory contains, among other 
things, directories called "man" and "R".  The latter directory contains 
files with names like "wav_boot.R", ..., "wav_xform.R".  I'm assuming 
you have documentation that tells you which function(s) you want to run. 
  Let's say you want to run "wavBestBasis".  If you are lucky, there 
will be a file with a name like "wavBestBasis.R".  That doesn't work in 
this case.  So instead I did a cd into that ~R/wmtsa/wmtsa/R".  Then I 
did "grep 'wavBestBasis' *.R".  I got the following:


wav_xform.R:##    wavBestBasis
wav_xform.R:# wavBestBasis
wav_xform.R:"wavBestBasis" <- function(costs)
Let's say it says you want to start with a f


	  6.  That says that "wavBestBasis" is in file "wav_xform.R".  I opened 
that file in RStudio (I use the free version) then clicked on the 
"Source" button in the upper right.


	  7.  Also, in the directory "~R/wmtsa/wmtsa/man" I found a file called 
"wavBestBasis.Rd".  I opened that in R.  To learn how to read that, you 
can type "help.start()", which will open a menu that includes, "Writing 
R Extensions".  Click that.  That tells you how to write (and read) a 
*.Rd file.  That file "wavBestBasis.Rd" contains and "\examples" 
section.  The first line in that section is "W <- 
wavDWPT(diff(atomclock), n.level=6)".  I ran that, and got:


Error in diff(atomclock) : object 'atomclock' not found


	  I won't discuss how to find "atomclick".  If you need that, you can 
ask again.


	  Hope this helps.
	  Spencer
On 7/3/22 8:15 AM, Richard O'Keefe wrote: