Re: [R] Submodel selection using dredge and gam (mgcv)

2014-11-11 Thread Kamil Bartoń
Hi Arnaud, your question has in fact nothing to do with gam or model selection. What you are asking is: what is the logical expression that yields True when AB is False or both A and B are True. Now replace the words with operators (!AB | (A B)) and voilà. See also: help(Logic, base)

[R] Error: (list) object cannot be coerced to type double; on running the following code in R ver 3.1.2

2014-11-11 Thread Aditya Singh
setwd(C:/Documents and Settings/Administrator/Desktop/Coursera/specdata/specdata)temp=list.files(pattern=*.csv)myfiles=lapply(temp,read.delim)summk=0nummk=0for (i in 1:10) {  vb=data.frame(myfiles[i])  vbm=as.double(vb)  summk=sum(vbm[,2])  nummk=length(vbm[,2]) - sum(is.na(vbm[,2]))} Aditya

[R] 1. What function to use to read all the files in a directory to a vector in R code? 2. What function to use to coerce character string into numeric?

2014-11-11 Thread Marc Girondot
Le 10/11/2014 22:15, John McKown a écrit : On Mon, Nov 10, 2014 at 7:12 AM, Aditya Singh aps...@yahoo.com wrote: Hi, I have 2 queries: 1. What function to use to read all the files in a directory to a vector in R code? In the package phenology, a function read_folder can be used to read all

[R] sweave package for R version 3.02

2014-11-11 Thread Frederic Ntirenganya
Hi All, I would like to install the package sweave but got the following warning: install.packages(sweave) Installing package into ‘/home/fredo/R/x86_64-pc-linux-gnu-library/3.0’ (as ‘lib’ is unspecified) Warning in install.packages : package ‘sweave’ is not available (for R version 3.0.2) I

Re: [R] sweave package for R version 3.02

2014-11-11 Thread Marc Schwartz
On Nov 11, 2014, at 5:25 AM, Frederic Ntirenganya ntfr...@gmail.com wrote: Hi All, I would like to install the package sweave but got the following warning: install.packages(sweave) Installing package into ‘/home/fredo/R/x86_64-pc-linux-gnu-library/3.0’ (as ‘lib’ is unspecified)

Re: [R] sweave package for R version 3.02

2014-11-11 Thread Duncan Murdoch
On 11/11/2014, 6:25 AM, Frederic Ntirenganya wrote: Hi All, I would like to install the package sweave but got the following warning: install.packages(sweave) Installing package into ‘/home/fredo/R/x86_64-pc-linux-gnu-library/3.0’ (as ‘lib’ is unspecified) Warning in install.packages :

Re: [R] sweave package for R version 3.02

2014-11-11 Thread Frederic Ntirenganya
Thanks all for the help. Now I want to use it and I am getting this error: \documentclass[9pt,a4paper]{article} Error: unexpected input in \ \usepackage{amsmath} Error: unexpected input in \ \usepackage{booktabs} Error: unexpected input in \ \usepackage{adjustbox} Error: unexpected input in

Re: [R] sweave package for R version 3.02

2014-11-11 Thread Frederic Ntirenganya
I got it. I should use compile not run option. Thanks All. Frederic Ntirenganya Maseno University, African Maths Initiative, Kenya. Mobile:(+254)718492836 Email: fr...@aims.ac.za https://sites.google.com/a/aims.ac.za/fredo/ On Tue, Nov 11, 2014 at 4:08 PM, Frederic Ntirenganya ntfr...@gmail.com

[R] problem with vegan function rda()

2014-11-11 Thread Lukas Kohl
Hello R-list Maybe someone knows what's going on here. I'm trying to re-run a script I wrote earlier this year using the function rda() in the vegan package. The script run fine back then, and I did not change the dataset, so I was wandering whether there's some problem in a updated version of

Re: [R] Error: (list) object cannot be coerced to type double; on running the following code in R ver 3.1.2

2014-11-11 Thread Mark Sharp
Aditya, Please use plan text. HTML is not handled correctly. Within your last statement it appears you are trying to find the sum of a logical vector - is.na(). This is what is causing the error. My guess is that you want to count the number of elements in the second column that are not NA

Re: [R] Error: (list) object cannot be coerced to type double; on running the following code in R ver 3.1.2

2014-11-11 Thread Bert Gunter
1. No comment on original garbled HTML code. 2. Comment on: ... Within your last statement it appears you are trying to find the sum of a logical vector - is.na(). This is what is causing the error. That is false: sum(rep(c(FALSE,TRUE),3)) [1] 3 Please do read basic R documents -- this is

[R] (no subject)

2014-11-11 Thread sikiru suleiman
I want to build a package that can generates random replication of treatment for DOE in matrix form.please I need your assistance on how to use R to generate nth row by jth col matrix with random replications of experiments. Sent from Windows Mail [[alternative HTML version

[R] segfault with readDCF on R 3.1.2 on AIX 6.1 when using install.packages

2014-11-11 Thread Vinh Nguyen
Dear list, I was able to successfully compile R on our AIX box at work using the GNU compilers following the instructions on the R Administration guide. The output can be seen at here (https://gist.github.com/nguyenvinh/504321ea9c89d8919bef) and yields no errors . However, I get a segfault

Re: [R] segfault with readDCF on R 3.1.2 on AIX 6.1 when using install.packages

2014-11-11 Thread Vinh Nguyen
I went back and compiled older versions of R to see if this error exists. On R 3.0.3, I get: debug(available.packages) install.packages('ggplot2', dep=TRUE, repo='http://cran.stat.ucla.edu') ... Browse[2] debug: z - res0 - tryCatch(read.dcf(file = tmpf), error = identity) Browse[2] Error:

Re: [R] (no subject)

2014-11-11 Thread Bert Gunter
Start reading: http://cran.r-project.org/doc/manuals/R-intro.pdf (or hire a consultant?) Cheers, Bert Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374 Data is not information. Information is not knowledge. And knowledge is certainly not wisdom. Clifford Stoll On Tue, Nov 11,

[R] How to highlight a group on a dendrogram

2014-11-11 Thread Leandro Colli
Hi, everyone, I am trying to highlight a group of samples at a cluster (dendogram). I would like to do it setting a group name in bold (the group Para). It is a large series, but I have a sampler above: # Library library(cluster) library(png) # Generating table1: table1 -

Re: [R] segfault with readDCF on R 3.1.2 on AIX 6.1 when using install.packages

2014-11-11 Thread Jeff Newmiller
Perhaps you are not using a compatible compiler. I believe this is off-topic for this mailing list, though.. see the Posting Guide. --- Jeff NewmillerThe . . Go Live...

[R] How are the standard errors of the estimates in glm.nb() calculated?

2014-11-11 Thread 정재희
Hello, I am running a negative binomial model using the glm.nb function in MASS package. But the standard errors I get are slightly different from the same model I ran using Stata's nbreg command. Some of the standard errors are the same, but some are not. Those that are different differ in

Re: [R] segfault with readDCF on R 3.1.2 on AIX 6.1 when using install.packages

2014-11-11 Thread Vinh Nguyen
On Tue, Nov 11, 2014 at 10:06 AM, Jeff Newmiller jdnew...@dcn.davis.ca.us wrote: Perhaps you are not using a compatible compiler. I believe this is off-topic for this mailing list, though.. see the Posting Guide. I'll move this question to r-devel. Thanks. -- Vinh

[R] Two dimensional likelihood surface plot

2014-11-11 Thread Gyanendra Pokharel
Hi R users, I am trying to plot two dimensional posterior likelihood surface. I have a data like para1 para2 likehood ... ... ... ... I looked at contour plot but it needs a shorted values of parameters and a matrix of

[R] R memory issues

2014-11-11 Thread eliza botto
Dear useRs, I have this funny thing going on with me since morning. I am 32 bit window 7 system with 4 GB RAM(2.95 usable). I tried to run a code on it but when I tried to convert dataframe to matrix by using the following code mat-matrix(as.numeric(unlist(SFI)),nrow=nrow(SFI)) *where SFI is my

Re: [R] Two dimensional likelihood surface plot

2014-11-11 Thread David Winsemius
On Nov 11, 2014, at 11:17 AM, Gyanendra Pokharel wrote: Hi R users, I am trying to plot two dimensional posterior likelihood surface. I have a data like para1 para2 likehood ... ... ... ... I looked at contour

Re: [R] Two dimensional likelihood surface plot

2014-11-11 Thread Duncan Murdoch
On 11/11/2014, 2:17 PM, Gyanendra Pokharel wrote: Hi R users, I am trying to plot two dimensional posterior likelihood surface. I have a data like para1 para2 likehood ... ... ... ... I looked at contour plot but

Re: [R] Two dimensional likelihood surface plot

2014-11-11 Thread Bert Gunter
... as would the loess predict() method do from a loess() fit in the base package. I have used loess() for this purpose primarily to take advantage of its robustness capabilities. I hasten to add that the algorithm is not infallible in this regard, as it may not recover from a sufficiently bad

[R] Cannot change R package name in Windows and cannot install an R package in Mac OS Yosemite

2014-11-11 Thread Michael Peng
Hi, I am now writing an R package LFSpro. I build it for both Mac OS and Windows. For Windows, the binary package name is LFSpro_1.0.3.zip. It can be installed into R successfully. But when I changed the name to LFSpro_1.0.3.Windows.zip, an error occurred: Error in

Re: [R] Cannot change R package name in Windows and cannot install an R package in Mac OS Yosemite

2014-11-11 Thread Uwe Ligges
On 11.11.2014 23:05, Michael Peng wrote: Hi, I am now writing an R package LFSpro. I build it for both Mac OS and Windows. For Windows, the binary package name is LFSpro_1.0.3.zip. It can be installed into R successfully. But when I changed the name to LFSpro_1.0.3.Windows.zip, an error

Re: [R] Cannot change R package name in Windows and cannot install an R package in Mac OS Yosemite

2014-11-11 Thread Michael Peng
I see. Thanks a lot. Gang On Tuesday, November 11, 2014, Uwe Ligges lig...@statistik.tu-dortmund.de wrote: On 11.11.2014 23:05, Michael Peng wrote: Hi, I am now writing an R package LFSpro. I build it for both Mac OS and Windows. For Windows, the binary package name is

Re: [R] R memory issues

2014-11-11 Thread Uwe Ligges
On 11.11.2014 20:32, eliza botto wrote: Dear useRs, I have this funny thing going on with me since morning. I am 32 bit window 7 system with 4 GB RAM(2.95 usable). I tried to run a code on it but when I tried to convert dataframe to matrix by using the following code

Re: [R] R memory issues

2014-11-11 Thread Ista Zahn
The short answer is get a bigger computer or find a way to do the computation using less memory. Best, Ists On Nov 11, 2014 2:34 PM, eliza botto eliza_bo...@hotmail.com wrote: Dear useRs, I have this funny thing going on with me since morning. I am 32 bit window 7 system with 4 GB RAM(2.95

Re: [R] Two dimensional likelihood surface plot

2014-11-11 Thread Gyanendra Pokharel
Thanks David, what do you mean by organized data in regular manner? Gyanendra Pokharel University of Guelph Guelph, ON On Tue, Nov 11, 2014 at 3:53 PM, David Winsemius dwinsem...@comcast.net wrote: On Nov 11, 2014, at 11:17 AM, Gyanendra Pokharel wrote: Hi R users, I am trying to plot

Re: [R] Strange error while passing string as an argument to the function in bnlearn package

2014-11-11 Thread Marco Scutari
Hi Alexandr, On 11 November 2014 00:10, Alexandr M rus...@gmail.com wrote: Sorry that I formulated my question not very accurately. I form expressions/(logic conditions for parameters evidence and event) dynamically inside the loop and they are sometimes quite long. By any chance, are using

Re: [R] Two dimensional likelihood surface plot

2014-11-11 Thread David Winsemius
On Nov 11, 2014, at 2:53 PM, Gyanendra Pokharel wrote: Thanks David, what do you mean by organized data in regular manner? This is what I meant by a regular manner: matrix( c( rep( seq(0,1, by=.1), 11), rep( seq(0,1, by=.1),each=11) , runif(121) ), 121,3) [,1] [,2][,3]

Re: [R] Two dimensional likelihood surface plot

2014-11-11 Thread Gyanendra Pokharel
Thanks a lot, David ! Thats what I wanted. it is greatly helpful. GP University of Guelph Guelph, ON On Tue, Nov 11, 2014 at 7:02 PM, David Winsemius dwinsem...@comcast.net wrote: On Nov 11, 2014, at 2:53 PM, Gyanendra Pokharel wrote: Thanks David, what do you mean by organized data in

[R] qq-plot in R

2014-11-11 Thread Ron Michael
Hi, I am some questions on qq-plot offered by R. Let say I have following qq-plot:  qqplot(rt(300, df = 5), rt(300, df = 5)) However I want to get more controls to define the range of x-axis as well as y-axis. For example I want to define that, x-axis range will be -10 to 10 and y-axis range

[R] how to use the rpart model to predict new data frame?

2014-11-11 Thread PO SU
Dear expeRts,     Now i have a  train  dataset a  and  test dataset b , i  using the following codes: rp-rpart(y~.,data=a,method=class) plot(rp) text(rp) but how can i use the trained model to predict b? TKS. -- PO SU mail: desolato...@163.com Majored in Statistics from SJTU

Re: [R] how to use the rpart model to predict new data frame?

2014-11-11 Thread David Winsemius
On Nov 11, 2014, at 7:47 PM, PO SU rhelpmaill...@163.com wrote: Dear expeRts, Now i have a train dataset a and test dataset b , i using the following codes: rp-rpart(y~.,data=a,method=class) plot(rp) text(rp) but how can i use the trained model to predict b? ?predict --

Re: [R] how to use the rpart model to predict new data frame?

2014-11-11 Thread Bharat Bargujar
HI, Try this: results - predict(rp,b,type = vector) Regards, Bharat On 12 November 2014 09:17, PO SU rhelpmaill...@163.com wrote: Dear expeRts, Now i have a train dataset a and test dataset b , i using the following codes: rp-rpart(y~.,data=a,method=class) plot(rp) text(rp)

Re: [R] how to use the rpart model to predict new data frame?

2014-11-11 Thread PO SU
OK , i tried predict(rp,b) but showed me a result which i can't understand, now it's the argument  type=vector worked. -- PO SU mail: desolato...@163.com Majored in Statistics from SJTU At 2014-11-12 11:55:08, Bharat Bargujar bharatbargu...@gmail.com wrote: HI,   Try this:   results -

Re: [R] qq-plot in R

2014-11-11 Thread Gerrit Eichner
Hello, ron, have you looked at the help page of qqplot and consequently tried, e.g., the following? xy - qqplot( rt(300, df = 5), rt(300, df = 5), xlim = c(-10, 10), ylim = c(0, 10)) str( xy) Hth -- Gerrit On Tue, 11 Nov 2014, Ron Michael wrote: Hi, I am some questions

[R-es] Evaluar como texto un parámetro de mi función

2014-11-11 Thread Raúl Vaquerizo
Compañeros, Una de primero de funciones pero que no soy capaz de resolver. Necesito evaluar como texto el parámetro de mi función. Ejemplo: datos.A-rnorm(10,3) datos.B-rnorm(100,30) datos.C-rnorm(1000,300) datos.D-rnorm(1,3000) describe - function(letra){ summary(datos.letra) } describe(B)