Re: [R] Running other programs from R

2013-03-16 Thread Jan van der Laan
Have a look at the system command: ?system HTH, Jan On 03/16/2013 10:09 PM, Sedat Sen wrote: Dear list, I want to run a statistical program (using its .exe file) from R by writing a script. I know there are some packages that call WinBUGS, Mplus etc. form R. I just want to call the .exe

Re: [R] Find NA in xts object

2013-03-16 Thread arun
HI, Try this:  Date1<- seq(as.Date("2012-09-10",format="%Y-%m-%d"),length.out=20,by="day") set.seed(25) value<- sample(c(1:5,NA),20,replace=TRUE) library(xts) x1<- xts(value,Date1) colSums(is.na(x1)) #[1] 3  which(is.na(x1)) #[1]  4  6 13 set.seed(38)  value2<- sample(c(5:8,NA),20,replace=TRUE)  x

Re: [R] Find NA in xts object

2013-03-16 Thread Joshua Ulrich
On Sat, Mar 16, 2013 at 2:25 PM, Pete wrote: > Hi to all, i'm new to R > > I have an xts object. > Can i find: > a) how many NA are in my object ? sum(is.na(obj)) > b) eventually where (in which line) they are > which(is.na(obj)) > Thank you > Best, -- Joshua Ulrich | about.me/joshuaulrich F

[R] Find NA in xts object

2013-03-16 Thread Pete
Hi to all, i'm new to R I have an xts object. Can i find: a) how many NA are in my object ? b) eventually where (in which line) they are Thank you __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the pos

[R] Running other programs from R

2013-03-16 Thread Sedat Sen
Dear list, I want to run a statistical program (using its .exe file) from R by writing a script. I know there are some packages that call WinBUGS, Mplus etc. form R. I just want to call the .exe extension of this program and run several times writing a code in R. Thus, I want to have the output

Re: [R] Writing a hyperlink to a csv file

2013-03-16 Thread Marc Girondot
Le 16/03/13 15:42, Jeff Newmiller a écrit : What Excel does or does not recognize as a url in any particular instance is up to Excel. The CSV format itself has no concept of markup that would allow you to convey this idea. HTML does, and I think Excel can import HTML, but I have never tried in

Re: [R] identifying and drawing from T distribution

2013-03-16 Thread ivo welch
actually, I had it right all along. that is, m<- runif(); s<- runif(); df<-runif()*10+1 # get some parameters...any parameters x <- rt( 10, df )*s + m # create random draws library(MASS) fitdistr(x, "t") # confirm properties will work. (josh suggested working with the skewness parameter,

Re: [R] Comparing Cox model with Competing Risk model

2013-03-16 Thread Heinz Tuechler
Dear Terry, as soon as the vignette is ready, I would be very happy, to know about it. Will you send a note to r-help, or will it be announced in some other way? best regards, Heinz On 08.03.2013 15:12, Terry Therneau wrote: -- begin included message -- I have a competing risk data where a

Re: [R] help with PCA

2013-03-16 Thread David L Carlson
?predict.prcomp -- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of David Wins

Re: [R] multiple frequencies per second again

2013-03-16 Thread Rui Barradas
Hello, The answer to your question is no, you don't have to do anything special, except, of course, say how many steps ahead you want to predict. To see this, run the second example in ?predict.Arima. It predicts 6 steps ahead, accounting for the frequency. Hope this helps, Rui Barradas Em

Re: [R] Plotting with basic plot

2013-03-16 Thread David Winsemius
On Mar 16, 2013, at 11:18 AM, Neuwirth Erich wrote: > When I run this code fragment > > x <- (0:100)/100 > y <- x^2 > plot(x,y,type="l",xlab=expression(x),ylab=expression(f(x)==x^2), > main="Quadratfunktion") > > the exponent on the y-axis label is mutilated. > How can the be changed with mini

Re: [R] Plotting with basic plot

2013-03-16 Thread Bretschneider SIG-R
Dear Neuwirth Erich, Re: On 16 Mar 2013, at 19:18 , Neuwirth Erich wrote: > When I run this code fragment > > x <- (0:100)/100 > y <- x^2 > plot(x,y,type="l",xlab=expression(x),ylab=expression(f(x)==x^2), > main="Quadratfunktion") > > the exponent on the y-axis label is mutilated. > How can

Re: [R] help with PCA

2013-03-16 Thread David Winsemius
On Mar 16, 2013, at 8:49 AM, john d wrote: > Dear all, > > If I do a PCA like this: > > dat<-matrix(rnorm(30),ncol=3) > res<-prcomp(dat) > > Now, imagine that I got new data that I want to project onto the > original PC axes. How do I do that? You can either read the help page or for worked e

[R] Plotting with basic plot

2013-03-16 Thread Neuwirth Erich
When I run this code fragment x <- (0:100)/100 y <- x^2 plot(x,y,type="l",xlab=expression(x),ylab=expression(f(x)==x^2), main="Quadratfunktion") the exponent on the y-axis label is mutilated. How can the be changed with minimal effort? ggplot2 does not have this problem: library(ggplot2) x <

[R] help with PCA

2013-03-16 Thread john d
Dear all, If I do a PCA like this: dat<-matrix(rnorm(30),ncol=3) res<-prcomp(dat) Now, imagine that I got new data that I want to project onto the original PC axes. How do I do that? Thanks! John __ R-help@r-project.org mailing list https://stat.eth

Re: [R] latex(test, collabel=) returns wrong latex code?

2013-03-16 Thread David Winsemius
On Mar 15, 2013, at 12:33 PM, Simon Kiss wrote: > Hello: > I'm working with a 2-dimensional table that looks sort of like test below. > I'm trying to produce latex code that will add dimension names for both the > rows and the columns. > In using the following code, latex chokes when I include c

Re: [R] Writing a hyperlink to a csv file

2013-03-16 Thread Jeff Newmiller
What Excel does or does not recognize as a url in any particular instance is up to Excel. The CSV format itself has no concept of markup that would allow you to convey this idea. HTML does, and I think Excel can import HTML, but I have never tried intentionally using HTML as a data exchange form

Re: [R] Question on assignment

2013-03-16 Thread Rui Barradas
Hello, Maybe using ?parent.frame. Something like fn2 <- function(x) { x1 <- function(y = x) { env <- parent.frame() env$y1 <- log(y) y2 <- y^2 return(0) } ### I want the variable 'y1' is available here.

[R] Is it possible to create a html file by using shiny in Windows ?

2013-03-16 Thread Janesh Devkota
Dear R users, I have just started using Shiny in R. I can run the program using R on my local computer but I don't know how can I create the html file on my local server. Can you guys suggest how can I proceed to create a html file on my computer in Windows interface ? Thanks. Janesh [

Re: [R] Writing a hyperlink to a csv file

2013-03-16 Thread Brian Smith
Hi Marc, Thanks for the reply. The question is whether it is possible to write some text (with a hyperlink) to a csv file, such that when you open the file in excel, it shows the text as hyperlinked. I guess it boils down to whether there are any 'tags' that you can put in the csv/txt file so tha

Re: [R] Writing a hyperlink to a csv file

2013-03-16 Thread Marc Girondot
Le 15/03/13 12:53, Brian Smith a écrit : Hi, I was wondering if it is possible to create a hyperlink in a csv file using R code and some package. For example, in the following code: links <- cbind(rep('Click for Google',3),"google search address goes here") ## R Mailing list blocks if I put the

Re: [R] Errors or warnings for non-existent data

2013-03-16 Thread Prof Brian Ripley
On 16/03/2013 07:19, brwin338 wrote: Good Evening Is there a setting that I can change in R so that I get either a warning or an error message if I reference non-existent data in a data frame? For example I get no warning or error message with the following: Use specific methods of indexi

[R] Errors or warnings for non-existent data

2013-03-16 Thread brwin338
Good Evening Is there a setting that I can change in R so that I get either a warning or an error message if I reference non-existent data in a data frame? For example I get no warning or error message with the following: > set.seed(2013) > df0=data.frame(cbind(x=rnorm(1000),y=rnorm(1000)))