This is where you start to learn to debug scripts and to use the 'browser' function. Type in the following:
options(warn = 2, error = utils::recover) This will turn warnings into errors and stop on the statement that caused the error and invoke the browser so you can check the values of various objects. On Fri, Mar 25, 2011 at 11:59 AM, armstrwa <william.armstr...@noaa.gov> wrote: > <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 > Transitional//EN"> > > > > > > > Thanks, Philipp. That helped a lot. I have run into another problem > now though. > > I am running the script, and some of it seems to work, but it outputs > all NAs for the data and I get 50+ error warnings saying: > > Warning messages: > 1: unable to compute correlation matrix; maybe change 'h' > 2: unable to compute correlation matrix; maybe change 'h' > 3: unable to compute correlation matrix; maybe change 'h' > 4: unable to compute correlation matrix; maybe change 'h' > > and on and on.. > > Does anyone know what might be causing this error? Or is there a way > for me to see what line in the code results in an error? > > Thanks again. > > Billy > > Philipp Pagel-5 [via R] wrote: > On Fri, > Mar 25, 2011 at 06:42:49AM -0700, armstrwa wrote: > > > > When I attempt to run a script, I keep getting the error message > shown > > > > > load("H:\\Restoration Center\\Climate Change and > > > > Restoration\\MidAtlFloodRisk\\discharge data\\R > files\\ALRT.txt") > > > Error: bad restore file magic number (file may be corrupted) -- no > data > > > loaded > > > In addition: Warning message: > > > file 'ALRT.txt' has magic number '# Coh' > > > Use of save versions prior to 2 is deprecated > > The load() function reads stored DATA into the workspace. As you say > > you want to run a SCRIPT you are probably looking for source(). > > > cu > > Philipp > > > -- > Dr. Philipp Pagel > > Lehrstuhl für Genomorientierte Bioinformatik > > Technische Universität München > > Wissenschaftszentrum Weihenstephan > > Maximus-von-Imhof-Forum 3 > > 85354 Freising, Germany > > http://webclu.bio.wzw.tum.de/~pagel/ > > ______________________________________________ > > [hidden email] > mailing list > > 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. > > > > > > If you reply to this email, your > message will be added to the discussion below: > http://r.789695.n4.nabble.com/Magic-Number-Error-Message-tp3405414p3405445.html > > > To unsubscribe from Magic Number Error Message, click > here . > > > -- > William Armstrong > Hydrology Research Assistant > NOAA Restoration Center > 55 Great Republic Drive > Gloucester, MA 01930 > > email: william.armstr...@noaa.gov > ph: 978-675-2181 > > > > > > -- > View this message in context: > http://r.789695.n4.nabble.com/Magic-Number-Error-Message-tp3405414p3405726.html > Sent from the R help mailing list archive at Nabble.com. > [[alternative HTML version deleted]] > > > ______________________________________________ > R-help@r-project.org mailing list > 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. > > -- Jim Holtman Data Munger Guru What is the problem that you are trying to solve? ______________________________________________ R-help@r-project.org mailing list 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.