Re: [R] quesion about model g1

2013-04-28 Thread Achim Zeileis
On Mon, 29 Apr 2013, meng wrote: Hello Achim: Sorry for another question about the model g1 in the last mail. As to model g2 and g3: g2 <- glm(Freq ~ (age + drug + case)^2, data = df, family = poisson) g3 <- glm(Freq ~ age * drug * case, data = df, family = poisson) anova(g2, g3, test = "Chisq"

Re: [R] Rstudio Error in View : 'wildcard' is missing

2013-04-28 Thread Jeff Newmiller
a) RStudio has its own support forum on its website. If your problem only happens in RStudio, then your question belongs there. If not, demonstrate the sequence of steps it takes to obtain your error using plain R and re-post. b) This kind of thing can happen when you corrupt your workspace. Bew

[R] Rstudio Error in View : 'wildcard' is missing

2013-04-28 Thread Ellen Sebastian
Hello, Whenever I try to view anything (matrix, data frame, etc) using View() in RStudio, I get the error: "Error in View : 'wildcard' is missing". Google hasn't returned any relevant help... Does anyone have an idea as to how I can fix this?? Thanks!! -- Ellen Sebastian B.S. Candidate, Biome

[R] quesion about model g1

2013-04-28 Thread meng
Hello Achim: Sorry for another question about the model g1 in the last mail. As to model g2 and g3: g2 <- glm(Freq ~ (age + drug + case)^2, data = df, family = poisson) g3 <- glm(Freq ~ age * drug * case, data = df, family = poisson) anova(g2, g3, test = "Chisq") I know clearly that the only diff

Re: [R] Hello. PLEASE HELP

2013-04-28 Thread Bert Gunter
No. 1. If this is homework, this list has a no homework policy. 2. If it is not, please read the posting guide (link at bottom) and post a coherent question in a form that can be answered. In particular, you need to provide the code that failed, the error messages, the packages you used, the R ve

Re: [R] Help

2013-04-28 Thread Zilefac Elvis
Thanks so much A.K. It worked so well. The results are perfect. Atem. Cc: R help Sent: Sunday, April 28, 2013 1:00 PM Subject: Re: Re: [R] Help Hi, You can try this: Here, I am exporting to the working directory: temp<- list.files(pattern="*.txt")  temp #[

[R] Hello. PLEASE HELP

2013-04-28 Thread ampemdo
I am a student of NTNU-Norway. I have some issues in fitting an AR-GARCH with seasonal components. My AR model contains the terms AR(1), AR(5), AR(20) and AR(60) and a simple GARCH(1,1) model. I received lot of errors when trying to do this. Can you please provide me the source code of fitt

Re: [R] Stratified Random Sampling Proportional to Size

2013-04-28 Thread Thomas Lumley
It looks as though you can't sample zero observations from a stratum. If you take the example on the help page and change one of the sample sizes to zero you get exactly the same error. >From the fact that there isn't a more explicit error message, I would guess that the author just never conside

Re: [R] Cor2Cov error

2013-04-28 Thread arun
HI, library(MBESS) Cor.mat <- matrix(c(1,0.5,0.5,1),nrow=2)  Sd<- c(0.07,0.05)  Covmat<-cor2cov(Cor.mat,Sd)  Covmat #    [,1]    [,2] #[1,] 0.00490 0.00175 #[2,] 0.00175 0.00250 cov2cor(Covmat) # [,1] [,2] #[1,]  1.0  0.5 #[2,]  0.5  1.0 Cor.mat2<-matrix(c(1,0.2,0.8,0.2,1,0.6,0.8,0.6,1

Re: [R] Help

2013-04-28 Thread arun
Hi, You can try this: Here, I am exporting to the working directory: temp<- list.files(pattern="*.txt")  temp #[1] "dt306A009.txt" "dt306A010.txt" #here added "_new" to distinguish the new files  lapply(seq_along(res),function(i) write.table(res[[i]],paste0(gsub(".txt","",temp[i]),"_new",".txt"),

Re: [R] unsupported url scheme

2013-04-28 Thread Prof Brian Ripley
On 28/04/2013 15:32, jawad hussain wrote: fileUrl <- "https://data.baltimorecity.gov/api/views/dz54-2aru/rows.csv?accessType=DOWNLOAD"download.file(fileUrl,destfile="./data/Cameras.csv",method="curl") I tried it after installing package "RCurl" but it give error message: Error in download.file(

Re: [R] path reference problems in R 3.0.0

2013-04-28 Thread annoporci
When I encounter these problems, I usually fix them with the following: 1. take ownership of the directories where the libraries are stored, here's how I do it on windows: http://www.howtogeek.com/howto/windows-vista/add-take-ownership-to-explorer-right-click-menu-in-vista/ 2. have an Renviro

Re: [R] Multiple assignment to several columns in dataset

2013-04-28 Thread Rui Barradas
Hello, See if the following does what you need. hours <- function(x, format = "%H:%M"){ as.integer(format(strptime(x, format = format), "%H")) } minutes <- function(x, format = "%H:%M"){ as.integer(format(strptime(x, format = format), "%M")) } x <- c("18:10", "19:43") hours(x)

Re: [R] Multiple assignment to several columns in dataset

2013-04-28 Thread Uwe Ligges
See ?strptime on how to handle time formats. If you want to stay playing with strsplit: It actually returns a list, hence you probably want to: dt$hr <- sapply(tstamp, "[", 1) Uwe Ligges On 28.04.2013 13:48, Alexandre Karev wrote: Hello! I've time stamp ('time') field in dataset ('dt

[R] hierarchical confirmatory factor analysis with sem package

2013-04-28 Thread mateo zelug
Hi, I am doing a hierarchical CFA using the sem package. I have 20 items, and I have 2 factors (F3 and F4), and also F1 and F2 are nested within F3. Here is the code that I have, but it is giving me an error message "Warning message: In eval(expr, envir, enclos) : Negative parameter variances. Mode

[R] unsupported url scheme

2013-04-28 Thread jawad hussain
fileUrl <- "https://data.baltimorecity.gov/api/views/dz54-2aru/rows.csv?accessType=DOWNLOAD"download.file(fileUrl,destfile="./data/Cameras.csv",method="curl") I tried it after installing package "RCurl" but it give error message: Error in download.file(fileUrl, destfile = "Cameras.csv") : uns

Re: [R] using metafor for meta-analysis of before-after studies

2013-04-28 Thread Qiang Yue
Hello, Michael. Thanks very much, your suggestion is really helpful, and hopefully will address our issue. I will also read the suggested references to learn more about meta-analysis. With best wishes. Qiang Yue From: Michael Dewey Date: 2013-04-28 06:30 To: qiangmoon; Michael Dewey; wvb

[R] Positive Smoothing in fda package

2013-04-28 Thread Oscar Rueda
Dear all, I'm trying to build some fda objects using smooth.pos() from fda package. Here is what I try: >X <-c(0.4541139, 0.4802537, 0.5091228, 0.3894931, 2.1512258, >7.9301281, 62.3876109, 54.1168247, 67.8769904, 91.0670615, 20.0682440) >basis <- create.bspline.basis(c(-100, 100), 7, 5) >MDA

[R] Multiple assignment to several columns in dataset

2013-04-28 Thread Alexandre Karev
Hello! I've time stamp ('time') field in dataset ('dt') with values like "18:10", "19:43", I need to split time field into hour and minutes and add both as new columns to dataset. We are able to do it in bash+awk, but curious to stay within R codebase as much as possible. For now we are usin

Re: [R] r syntax

2013-04-28 Thread John Kane
Note that Rui used 1L and 2L to give you integers. If he had used 1 and 2 you would have gotten real numbers. John Kane Kingston ON Canada > -Original Message- > From: ruipbarra...@sapo.pt > Sent: Sat, 27 Apr 2013 23:57:30 +0100 > To: inf...@gmail.com > Subject: Re: [R] r syntax > >

Re: [R] using metafor for meta-analysis of before-after studies

2013-04-28 Thread Michael Dewey
At 16:50 27/04/2013, Qiang Yue wrote:  Hello, Michael. Thanks for your kind and rapid reply, and sorry for the inconvenience of characters. Yes, the primary studies reported the n, the mean percentage change and its standard deviation, but some did not report the original value of befo

Re: [R] path reference problems in R 3.0.0

2013-04-28 Thread Melissa Key
On Apr 28, 2013, at 2:15 AM, Jeff Newmiller wrote: > a) You seem to be under the impression that running as Administrator fixes > problems... in my experience, it simply multiplies them. [1] > On a windows machine, I don't have any impressions either way. I find the entire OS to be counter-i

Re: [R] path reference problems in R 3.0.0

2013-04-28 Thread Jan van der Laan
Some colleagues ran into similar problems after migrating to windows 7. They could no longer install packages in certain network locations because the read only bit was set (which could be unset after which windows set it again). Perhaps the following helps: http://itexpertvoice.com/home/fi

Re: [R] Stratified Random Sampling Proportional to Size

2013-04-28 Thread Jeff Newmiller
a) Please post plain text b) Please make reproducible examples (e.g. telling us how you accessed a database that we have no access to is not helpful). See ?head, ?dput and [1] c) I don't know anything about the sampling package or the strata function, but I would recommend eliminating the ro