Hello all, I was trying to load a .r file using source() and load() functions. Although I could be able to load the codes (mainly few user defined functions) written in that .r. file correctly, however getting following error:> source("D:/Book Code.r")Error in sys.call(sys.parent()) : node stack overflow> load("D:/Book Code.r")Error: bad restore file magic number (file may be corrupted) -- no data loaded In addition: Warning message: file ?NG Book Code.r? has magic number 'Pos_T' Use of save versions prior to 2 is deprecated What is the possible problem? Thanks and regards,
Christofer Bogaso <bogaso.christofer <at> gmail.com> writes:>[snip]> I was trying to load a .r file using source() and load() functions. > Although I could be able to load the codes (mainly few user defined > functions) written in that .r. file correctly, however getting > following error: > > > source("D:/Book Code.r") > Error in sys.call(sys.parent()) : node stack overflow > > > load("D:/Book Code.r") > Error: bad restore file magic number (file may be corrupted) -- no data loaded > In addition: Warning message: > file ?NG Book Code.r? has magic number 'Pos_T' > Use of save versions prior to 2 is deprecated > > What is the possible problem? >Really hard to say. source() seems to be the right choice (since the file seems to contain R code -- load() is for stored *data*). However, it's almost impossible to diagnose the problem without more information about what's *in* the file. Googling "r 'node stack overflow'" shows unanswered questions at http://stackoverflow.com/questions/13788306/error-in-as-dendrogram http://r.789695.n4.nabble.com/ Error-in-data-frame-srcfile-NA-character-using-R-CMD-check-td4369037.html ...
I think your immediate problem is that you are asking this particular question in the wrong forum. It appears that you are following instructions (in a book? a class?) and you need to direct your questions to the author of those instructions. You may find it helpful to know: a) The load function does not work on R source code files (.R) but on R data files (.rda or .RData). b) You can (and most likely should) open .R files in the text editor of your choice and start reading. c) There is a Posting Guide for this mailing list mentioned at the bottom of this and every other email from this list. d) There is a well-written Introduction to R pdf document supplied with the R software. --------------------------------------------------------------------------- Jeff Newmiller The ..... ..... Go Live... DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (Solar/Batteries O.O#. #.O#. with /Software/Embedded Controllers) .OO#. .OO#. rocks...1k --------------------------------------------------------------------------- Sent from my phone. Please excuse my brevity. Christofer Bogaso <bogaso.christofer at gmail.com> wrote:>Hello all, > >I was trying to load a .r file using source() and load() functions. >Although I could be able to load the codes (mainly few user defined >functions) written in that .r. file correctly, however getting >following error: > >> source("D:/Book Code.r") >Error in sys.call(sys.parent()) : node stack overflow > > >> load("D:/Book Code.r") >Error: bad restore file magic number (file may be corrupted) -- no data >loaded >In addition: Warning message: >file ?NG Book Code.r? has magic number 'Pos_T' > Use of save versions prior to 2 is deprecated > >What is the possible problem? > >Thanks and regards, > >______________________________________________ >R-help at 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.
Bogaso wrote> Hello all, > > I was trying to load a .r file using source() ... functions ... however > getting > following error: > >> source("D:/Book Code.r") > Error in sys.call(sys.parent()) : node stack overflowI realise the above message is quite old, just a quick reply if anyone is encountering the same error and was trying to find a solution (and ending up here). The error is occurring because the line:> source( "filename.r" )is in the file (filename.r) that you're trying to open. Hash this out in the document>#source("filename.r")and then it's there for you to copy-paste in and run the code, but shouldn't cause the error above. I would advise copy-pasting the code you're trying to run in the document first, to make sure that there are no errors in there either! Hope that helps anyone encountering the error. -- View this message in context: http://r.789695.n4.nabble.com/Problem-loading-r-file-tp4653624p4673413.html Sent from the R help mailing list archive at Nabble.com.