[R] Error in file.exists(swf.file) : invalid 'file' argument

David Winsemius dwinsemius at comcast.net
Wed Jul 9 05:07:00 CEST 2014


On Jul 8, 2014, at 5:49 PM, Jeff Newmiller wrote:

> Code is corrupted. Please post in plain text as the Posting Guide indicates is expected of you.

To explain a bit further.... Making text BOLD in formatted email adds extraneous asterisks in what some of us see in a plain text mail client. We could conceivably do some sort of global replacement of the '*'  ... but why should we? You are expected to post in plain text.  

Furthermore I'm guessing that saveSWF is a function from some non-base package. I do not see a library(,) or require(.) call that loads the package.

-- 
David,
> ---------------------------------------------------------------------------
> 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.
> 
> On July 8, 2014 2:28:04 PM PDT, Cheryl Johnson <johnson.cheryl625 at gmail.com> wrote:
>> *I am receiving the error message ���*Error in file.exists(swf.file) :
>> invalid 'file' argument*��� from my swf2html command. In addition,
>> there is a
>> command that says the Flash file was created: ���*Flash has been
>> created at:
>> C:\Users\CHERYL\AppData\Local\Temp\Rtmp6n6FXw\file2.swf*���*
>> 
>> *Below is the R code. Thanks in advance for any guidance.*
>> 
>> 
>> 
>> *g<-c(0.1,0.2,0.3)*
>> 
>> *#This function produces the swf file.*
>> 
>> *myanimation<-function(v){*
>> 
>> *output1=saveSWF({*
>> 
>> *<code>*
>> 
>> *}, img.name <http://img.name/> = "file",swf.name <http://swf.name/> =
>> "file2.swf" , single.opts = "'utf8': false", autoplay = FALSE , *
>> 
>> *interval = 0.1, imgdir = "directory", htmlfile = "random.html",
>> ani.height
>> = 500, *
>> 
>> *ani.width = 500, title = "groups", *
>> 
>> *description = c("group1", "group2"))*
>> 
>> *return(output1)*
>> 
>> }
>> 
>> #These commands create the html page.
>> 
>> dir.create(file.path(tempdir(),"R2HTML"))
>> 
>> target <-
>> HTMLInitFile(file.path(tempdir(),"R2HTML"),filename="sample2",
>> BackGroundColor="#BBBBEE")
>> 
>> HTMLInsertGraph("<br>Title",file=target)
>> 
>> #This for loop calls the animation function with each value of g.
>> 
>> for(v in g){
>> 
>> output2=myanimation(v)
>> 
>> HTML(swf2html(output2),file=target)
>> 
>> }
>> 
>> 	[[alternative HTML version deleted]]


David Winsemius
Alameda, CA, USA



More information about the R-help mailing list