[R] Is it possible to have different animations saved together with the saveSWF command?

2014-09-01 Thread Cheryl Johnson
The way I have programed my code the same animation runs and then starts
over again with Adobe Flash. Each time the animation ends and starts is it
possible to have a different animation start each time? Thanks in advance
for any guidance.

[[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.


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

2014-07-08 Thread Cheryl Johnson
*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({*

**

*}, img.name  = "file",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="#EE")

HTMLInsertGraph("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]]

__
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.


[R] Calling Matrices from a Function

2014-07-04 Thread Cheryl Johnson
When I call matrices from a function, they are called but are not
recognized as matrices. I use the code below. From the main function, when
I use the command is.matrix(), the response is FALSE. Why are the matrices
not recognized as matrices? Thanks in advance for any guidance.

#This function creates matrices and returns them in a list.

my_func <- function() {

  matrix_1 = matrix(c(1,2,3,4), ncol = 2, nrow = 2)

  matrix_2 = matrix(c(5,6,7,8), ncol = 2, nrow = 2)

  my_list <- list(matrix_1,matrix_2)

  return(my_list)

}

#This function calls the myfunc function.

main_func <- function() {

  result <- myfunc()

  result_1 <- (result[1])

  print(result_1)

  print(is.matrix(a))

  result_2 <- (result[2])

  print(result_2)

  print(is.matrix(result_2))

}

main_func()

> #This function creates matrices and returns them in a list.

> my_func <- function() {

+   matrix_1 = matrix(c(1,2,3,4), ncol = 2, nrow = 2)

+   matrix_2 = matrix(c(5,6,7,8), ncol = 2, nrow = 2)

+   my_list <- list(matrix_1,matrix_2)

+   return(my_list)

+ }

> #This function calls the myfunc function.

> main_func <- function() {

+   result <- myfunc()

+   result_1 <- (result[1])

+   print(result_1)

+   print(is.matrix(a))

+   result_2 <- (result[2])

+   print(result_2)

+   print(is.matrix(result_2))

+ }

> main_func()

[[1]]

 [,1] [,2]

[1,]13

[2,]24



[1] FALSE

[[1]]

 [,1] [,2]

[1,]57

[2,]68



[1] FALSE

[[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.


Re: [R] R Console Output

2014-06-30 Thread Cheryl Johnson
ot;
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00058.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00059.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00060.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00061.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00062.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00063.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00064.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00065.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00066.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00067.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00068.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00069.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00070.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00071.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00072.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00073.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00074.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00075.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00076.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00077.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00078.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00079.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00080.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00081.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00082.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00083.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00084.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00085.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00086.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00087.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00088.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00089.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00090.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00091.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00092.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00093.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00094.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00095.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00096.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00097.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00098.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00099.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00100.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00101.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00102.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00103.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00104.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00105.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00106.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00107.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00108.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00109.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00110.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00111.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00112.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00113.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00114.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00115.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00116.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00117.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00118.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00119.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00120.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00121.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00122.png"
"C:\Users\CHERYL\AppData\Local\Temp\RtmpqayKkJ/file00123.png"
"C:\Users\CHERYL>

>

>

>










On Mon, Jun 30, 2014 at 4:33 PM, jim holtman  wrote:

> What do you mean by "stops"?  Can you at least show what was on the
> console.  Can you continue to enter commands?  It is not clear what you are
> talking about.
>
>
> Jim Holtman
> Data Munger Guru
>
> What is the problem that you are trying to solve?
> Tell me what you want to do, not how you want to do it.
>
>
> On Mon, Jun 30, 2014 at 10:56 AM, Cheryl Johnson <
> johnson.cheryl...@gmail.com> wrote:
>
>> When I run code in R, my R console output stops before all the code has
>> complied. There are no error messages, but there must be an error
>> somewhere. Thanks in advance for any guidance.
>>
>> [[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.
>>
>
>

[[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.


[R] R Console Output

2014-06-30 Thread Cheryl Johnson
When I run code in R, my R console output stops before all the code has
complied. There are no error messages, but there must be an error
somewhere. Thanks in advance for any guidance.

[[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.


[R] Run R Code Continuously in the Background of HTML

2014-06-05 Thread Cheryl Johnson
I would like to run R code continuously in the background of a HTML page.
This code will run in a loop that has a random number generator. I would
like the different values from the random number generator to be displayed
on the HTML page as the loop iterates. Thanks in advance for any help.

[[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.


[R] saveSWF Error Message: file association not available or invalid

2014-05-29 Thread Cheryl Johnson
When I run the code below, I receive the following error message. Thanks in
advance for help with fixing this error message.



saveSWF({



}, img.name = "file",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"))

Flash has been created at:
C:\Users\Cheryl\AppData\Local\Temp\RtmpKeQGHu\file2.swf

Error in shell.exec(output.path) :

  file association for
'C:\Users\Cheryl\AppData\Local\Temp\RtmpKeQGHu\file2.swf' not available or
invalid

[[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.


[R] Warning Message: In saveSWF({ : the executablepng2swf.exedoes not exist!

2014-05-17 Thread Cheryl Johnson
By using the animation package, I get the warning message "In saveSWF({ :
the executablepng2swf.exedoes not exist!". Help in understanding why this
message is given will be appreciated.

Thanks

[[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.


[R] Append Data to an Excel File through each Iteration of a For Loop

2012-11-05 Thread Cheryl Johnson
Hi,

I would like to find a way to append data to an excel file through each
iteration of a for loop. Is there a way to use a command such as
write.table and append each iteration to a different sheet?

Thanks

[[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.


[R] How to Write a Model in R that has the Log taken of the Intercept

2012-09-23 Thread Cheryl Johnson
Hi,

I know that +1 is used to specify an intercept in a R model. An example of
this would be: y~x+1

If I want to have a model where the log of the intercept is taken, the
equation y~x+log(1) will not take the log of the intercept.

Any suggestions on how to take the log of the intercept will be appreciated.

Thanks

[[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.


[R] write.table and read.table commands

2012-08-27 Thread Cheryl Johnson
Greetings,

When I try to use the write.table command to save a matrix as a file and
then open the file with read.table, if I try to take the mean of the entire
matrix, instead each column of the matrix has its mean calculated. I have
copied and pasted an example of my code below. When I try to make the
header false with the read.table command, I am given an error message. I
would appreciate any guidance for how to average the entire matrix instead
of just the columns.

Thanks

z=matrix(1:20,4,5)
write.table(z, file="exercise.csv",sep=",",col.names=NA,qmethod="double")
j=read.table("exercise.csv",header=T,sep=",",row.names=1)
mean(j)

  V1   V2   V3   V4   V5
 2.5  6.5 10.5 14.5 18.5
Warning message:
mean() is deprecated.
 Use colMeans() or sapply(*, mean) instead.

[[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.


[R] lmer function bug

2011-12-27 Thread Cheryl Johnson
Hello,

When I make certain values greater with the lmer function, variance
components that I expect to give a certain value are switched from how I
expect them to be. Has anyone else had this problem?

Thanks

[[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.


[R] rnorm command

2011-12-03 Thread Cheryl Johnson
Hello,

I use the command rnorm, and I feed these results into a lmer command.
Since I am using the rnorm command I expect to get different results for
each iteration, yet for each iteration I am getting the same answer. If
someone understands why I am getting the same answer every time with a
random number generator, I would appreciate help in understanding why this
is happening. Is the lmer command causing the answer to be the same each
time?

Thanks

[[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.


[R] How to use IML with R and SAS

2011-10-30 Thread Cheryl Johnson
Hello,

I have a for loop that generates data in R. With the IML program, I would
like to analyze data in SAS from each iteration of the for loop in R. It
would be helpful if someone could explain to me how to analyze data this
way.

Thanks

[[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.


[R] Error in Penalized Command

2011-10-06 Thread Cheryl Johnson
How do I fix this error in the penalized command?

L<-penalized(y,x,lambda1=10)

Error in .checkinput(match.call(), parent.frame()) :
  the length of "response" (20) does not match the row count of
"penalized" (1000)

Thanks!

[[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.


[R] Var-Cov matrix from LMER function

2011-08-08 Thread Cheryl Johnson
Hello,

Is there a way to get the Var-Cov matrix from the LMER function?

Thanks

[[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.


[R] Legend for 2 plots on same screen

2011-07-31 Thread Cheryl Johnson
Hello,

I have two plots on the same screen. I use the command par(mfrow=c(1,2)) in
order to do this. When I try to make a legend for both plots, it only puts
the legend in the plot on the right side. If I would like a legend that is
outside of both of the plots, how would I do this?

Thanks

[[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.


Re: [R] extraction of mean square value from ANOVA

2011-05-19 Thread Cheryl Johnson
Thanks for your help. How would I extract each of the 3 values in the vector
individually?

Thanks again

On Thu, May 19, 2011 at 10:40 PM, Rolf Turner wrote:

> On 20/05/11 13:46, Cheryl Johnson wrote:
>
>> Hello,
>>
>> I am randomly generating values and then using an ANOVA table to find the
>> mean square value. I would like to form a loop that extracts the mean
>> square
>> value from ANOVA in each iteration. Below is an example of what I am
>> doing.
>>
>> a<-rnorm(10)
>> b<-factor(c(1,1,2,2,3,3,4,4,5,5))
>> c<-factor(c(1,2,1,2,1,2,1,2,1,2))
>>
>> mylm<-lm(a~b+c)
>> anova(mylm)
>>
>> Since I would like to use a loop to generate this several times it would
>> be
>> helpful to know how to extract the mean square value from ANOVA.
>>
>
> anova(mylm)[["Mean Sq"]]
>
> strangely enough. :-)
>
> This gives you a *vector* (of length 3 in your setting), the last
> entry of which is the error (or residual) mean square, which is
> probably what you want since you refer the ``mean square value''
> (singular).
>
>cheers,
>
>Rolf Turner
>

[[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.


[R] extraction of mean square value from ANOVA

2011-05-19 Thread Cheryl Johnson
Hello,

I am randomly generating values and then using an ANOVA table to find the
mean square value. I would like to form a loop that extracts the mean square
value from ANOVA in each iteration. Below is an example of what I am doing.

a<-rnorm(10)
b<-factor(c(1,1,2,2,3,3,4,4,5,5))
c<-factor(c(1,2,1,2,1,2,1,2,1,2))

mylm<-lm(a~b+c)
anova(mylm)

Since I would like to use a loop to generate this several times it would be
helpful to know how to extract the mean square value from ANOVA.

Thanks

[[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.