Re: [R] how to create model matrix of second order terms

2025-03-25 Thread Stephen Bond via R-help
025, Stephen Bond via R-help escreveu: > > Folks, > > > > I appreciate your effort, but maybe I was not explicit enough, so > > let > > me try again. > > > > The current setup for formulas does not allow for I(x^2) terms as > > explained

Re: [R] how to create model matrix of second order terms

2025-03-24 Thread Stephen Bond via R-help
olving factors (you can change the contrast types using > the 'contrasts.arg' argument of model.matrix()) > > 1. Does this help? > 2. Do check this to make sure I'm correct > > Cheers, > Bert > > "An educated person is one who can entertain new ideas,

[R] how to create model matrix of second order terms

2025-03-24 Thread Stephen Bond via R-help
I am sending to this forum as stackoverflow has devolved into sth pretty bad. Below code shows how to get what I want in a clumsy way. cols <- letters[1:4] a1 <- outer(cols,cols,paste0) b1 <- a1[!lower.tri(a1)] X <- matrix(rnorm(80),ncol=4) colnames(X) <- cols X <- as.data.frame(X) XX <- matrix(0

[R] RBloomberg date error

2008-06-02 Thread stephen bond
__ 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] tkconfigure throws an error

2008-04-01 Thread stephen bond
When I do it with a function I lose the workspace. This is on a regulated matter and I MUST keep record of all commands/output from the source script plus the resulting workspace. Thanks everybody. Original Message From: [EMAIL PROTECTED] Date: 03/31/2008 13:10 To: "stephen

[R] tkconfigure throws an error

2008-03-31 Thread stephen bond
Thanks everybody for looking at this. I am trying to assign a script to a button please help: library(tcltk) tt<- tktoplevel() tktitle(tt)<-"the title" heading<-tklabel(tt,text="Enter date as -MM-DD") l1<-tklabel(tt,text="Reporting date") b1=tkbutton(tt,text="Run") d.val<-tkentry

[R] more help needed Re: communicate from Rterm

2008-01-18 Thread stephen bond
ils. Please, help or refer to tryCatch examples with real handlers. I could not get much out of the examples in the help file. Thanks everybody Original Message From: [EMAIL PROTECTED] Date: 01/11/2008 12:31 To: "Duncan Murdoch"<[EMAIL PROTECTED]> Cc: "stephen bond&q

Re: [R] communicate from Rterm

2008-01-11 Thread stephen bond
uot; ">" "out.txt" > it restores the correct workspace, but then it fails to source the script, which is located in the same dir as the workspace. inside R > source("m.in.R") # does the job, so it is not a finding problem BTW is it possible to get the error

[R] communicate from Rterm

2008-01-11 Thread stephen bond
Please, help with announcing an error from Rterm: I am calling R from an Excel VBA and noticed that if there is an error nothing conspicuous happens. I would like just a popup window when R cannot finish cleanly. The "ret " value returned from Shell is useless in determining what happened. Tha

Re: [R] rcom close Excel problem

2007-12-17 Thread stephen bond
is how to submit a second argument to "Close"? Submitting a second argument to Open works fine as shown by the "0" below, but neither "1" nor "-1" worked for Close. Very strange. Original Message From: [EMAIL PROTECTED] Date: 12/14/2007 18:57 T

[R] rcom close Excel problem

2007-12-14 Thread stephen bond
Hello, I just discovered that I cannot close the Excel application and task manager shows numerous copies of Excel.exe I tried both x$Quit() # shown in the rcom archive and x$Exit() and Excel refuses to die. Thank you very much. S. "You can't kill me, I will not die" Mojo Nixon I also have

[R] using sprintf with dates

2007-10-02 Thread stephen bond
hello, Please help with using sprintf with character variables: The following does not produce what i intended foot=function(){ str1=format(Sys.Date,"%Y%m%d") sprintf("99%-4s%s","nm",str1) } I wanted to have "99nm 20071002" as the output. __ R-he

[R] text formatting

2007-09-21 Thread stephen bond
Dear all, Does R have any functions for C/Fortran style text formatting when a number needs to be output right-justified in a fixed length field? say '%2d %3d %5.3f' or like python .rjust(n) and .zfill(n) I can do it paste(), but it is very clumsy. Thank you very much Stephen _

[R] fCalendar

2007-09-19 Thread stephen bond
is there a straigthforward way to get the holidays for Toronto ? like the function for NYSE e.g. the timeDate class says that setting a finCenter will give the right holidays, but how? thank you very much. stephen __ R-help@r-project.org mailing list