Re: [R] Appending the Column names

2012-07-28 Thread Michael Weylandt
You can't have two sets of colnames on a single data.frame What are you trying to do (big picture wise)? Michael On Jul 28, 2012, at 12:56 PM, namit wrote: > Hi Freinds, > > I have two data frames X,Y. I want to append both the data frames into one, > along with the columns names from both t

Re: [R] lm without intercept

2012-07-28 Thread Joshua Wiley
Hi, R actually uses a different formula for calculating the R square depending on whether the intercept is in the model or not. You may also find this discussion helpful: http://stats.stackexchange.com/questions/7948/when-is-it-ok-to-remove-the-intercept-in-lm/ If you conceptualize R^2 as the sq

[R] Coloring Counties in a State Map

2012-07-28 Thread arcata
I am mapping U.S. state counties in individual states maps, e.g. A map of Montana, with county lines. How do I fill specific counties with a different color? -- View this message in context: http://r.789695.n4.nabble.com/Coloring-Counties-in-a-State-Map-tp4638218.html Sent from the R help mail

[R] Beta-Binomial Regression in R

2012-07-28 Thread Anamika Chaudhuri
Hi All: I am trying to generate Beta-Binomial data with regressors using R. I have used the following code to generate Beta-Binomial data. Now I want to add a covariate to the equation. I would then like to use the simulated data to run the Beta-Binomial model with covariates on it. Appreciate an

[R] low resolution word map

2012-07-28 Thread Thomas Steiner
Hi, I'd like to have a low resolution word map in R. The "maps" package has this option, but if I use the argument, the map looses sense: Russia and Australia get empty etc library("maps") m=map(col="skyblue",fill=TRUE,plot=TRUE,resolution=10) length(m$x) If I drop the "fill=TRUE", the effect of

[R] [rjson] toJSON serializes double as int

2012-07-28 Thread Erdal Karaca
I have this object: > obj <- list(test=1.0) > obj $test [1] 1 > toJSON(obj) [1] "{\"test\":1}" How do force the serialization of obj$test to be "1.0" instead of "1"? I.e. the output should be: > toJSON(obj) [1] "{\"test\":1.0}" [[alternative HTML version deleted]]

[R] Appending the Column names

2012-07-28 Thread namit
Hi Freinds, I have two data frames X,Y. I want to append both the data frames into one, along with the columns names from both the data frames (it should look like Z). X: SummaryG Y R Acc 1212 13 Bcc 1114 15 Ccc

[R] Mixed-model with paired design & covariates

2012-07-28 Thread Nathan Ranc
Dear all, I make habitat suitability models for animal species. The purpose of my research is to investigate the accuracy of different models. I clearly have a nested design: - accuracy_measure -> response variable - 2 model types (model_type) -> fixed effect - 230 species (species) -> random ef

Re: [R] lm without intercept

2012-07-28 Thread citynorman
I've just picked up R (been using Matlab, Eviews etc) and I'm having the same issue. Running reg=lm(ticker1~ticker2) gives R^2=50% while running reg=lm(ticker1~0+ticker2) gives R^2=99%!! The charts suggest the fit is worse not better and indeed Eviews/Excel/Matlab all say R^2=15% with intercept=0.

[R] low resolution word map

2012-07-28 Thread Thomas Steiner
Hi, I'd like to have a low resolution word map in R. The "maps" package has this option, but if I use the argument, the map looses sense: Russia and Australia get empty etc library("maps") m=map(col="skyblue",fill=TRUE,plot=TRUE,resolution=10) length(m$x) If I drop the "fill=TRUE", the effect of

Re: [R] "metafor" package, proportions: single groups wrt to a categorical dependent variable

2012-07-28 Thread Dushanthi Pinnaduwage
Dear Michael, Thanks very much for your quick response. My outcome is not binary. Outcome has more than 2 values (levels) and I have counts for the levels. I have not written a code yet. I would like to know if escalc() can handle categorical outcome data (more than 2 proportions). If so, how

[R] garch external regressors

2012-07-28 Thread saraberta
Hi everyone, i have a terribly stupid question, but i hope someone could reply me! when i'm fitting a garch model and i want to insert in the variance model some external regressors as temporal dummy or lags of other variables and so on, which timeline should follow the time series that i select? i

[R] using save() to work with objects that exceed memory capacity

2012-07-28 Thread David Romano
Context: I'm relatively new to R and am working with very large datasets. General problem: If working on a dataset requires that I produce more than two objects of roughly the size of the dataset, R quickly uses up its available memory and slows to a virtual halt. My tentative solution: To sav

Re: [R] producing a graph with glm poisson distributed respons count data and categorical independant variables

2012-07-28 Thread babs
Hi, I do have replicates, but not many. The offsets are my the number of replicates actually, i misled myself by thinking i could add the counts of the replicates all up and then go further with the offset function. I decided to split up my experiments in order to interpret them, they were actual

[R] Problem with a regression - Dataset Workinghours

2012-07-28 Thread Giorgio Monti
I'm a student. I'm working on a research using the statistical program "R 2.15.1". Here's my problem: how i can do a regression considering only values over a certain limit? For example, considering the dataset "Workinghour" of the "Ecdat" package, is possible to build a predictive model that expre

[R] quantreg Wald-Test

2012-07-28 Thread stefan23
Dear all, I know that my question is somewhat special but I tried several times to solve the problems on my own but I am unfortunately not able to compute the following test statistic using the quantreg package. Well, here we go, I appreciate every little comment or help as I really do not know how

Re: [R] use R remotely (ssh / shell / emacs)

2012-07-28 Thread Ranjan Maitra
I don't know if using R over ssh/remotely is off-topic, but the user needs to provide more information. I am not knowledgeable about wakeup-on-lan (isn't this set in the BIOS?) but I think it would be helpful to know OS's, etc. How much more powerful is the desktop than the laptop? If not, does it

Re: [R] selecting a subset of files to be processed

2012-07-28 Thread Erin Hodgess
Thanks so much! On Sat, Jul 28, 2012 at 1:32 PM, Ted Harding wrote: > And, in addition to the tip from Rui (and similar from Joshua) below, > I would advise that there is one good reason not to try doing it > in "pure Linux". > > The only source (that I know of) in Linux itself for random number

Re: [R] use R remotely (ssh / shell / emacs)

2012-07-28 Thread Jeff Newmiller
Unix-ish operating systems often have X-Windows installed for GUI programs. In this environment, it is very common to log in remotely and run GUI programs on the remote computer that open windows on your local screen. It is also possible to run a vnc or Remote Terminal service/daemon on the re

[R] readRDS, In as.double.xts(fishReport$count) : NAs introduced by coercion

2012-07-28 Thread Yolande Tra
Hello, I looked in the R-help but could not find an archive addressing the following. I would like to convert a character to numeric after reading a file with RDS extension. After using as.numeric, I checked if it is numeric. It was not converted. Please help. Here is my code >Report <- readRDS(

[R] use R remotely (ssh / shell / emacs)

2012-07-28 Thread Martin Batholdy
Hi, I have a laptop and a desktop PC. Now I was wondering, if it is possible to create a setup in which you can use the laptop (where ever you are) to remotely access the PC, open an R-instance and let the PC do the heavy computation. I have no idea about remote control, wake-on-lan, ssh and al

Re: [R] How to extract unique indices for time series Data?

2012-07-28 Thread Hasan Diwan
> > Here, I guess there are some duplicated dates-index. Is there any > function available to automatically extract unique indices ??? > ?zooreg should do what you want, if I'm understanding the question properly. -- Sent from my mobile device Envoyait de mon portable [[alternative HTML

Re: [R] Creating sparse matrix of type "dgCMatrix" directly

2012-07-28 Thread Søren Højsgaard
-Original Message- From: dmba...@gmail.com [mailto:dmba...@gmail.com] On Behalf Of Douglas Bates Sent: 28. juli 2012 20:36 To: Søren Højsgaard Cc: r-help@r-project.org Subject: Re: [R] Creating sparse matrix of type "dgCMatrix" directly On Sat, Jul 28, 2012 at 7:26 AM, Søren Højsgaard w

Re: [R] puzzling classical Mahalanobis distances from covMcd() {robustbase}

2012-07-28 Thread David L Carlson
The values should probably be labeled "initial" instead of "raw" which is how they are labeled in the source. The Details section of manual indicates that the first step is to identify a subset of the original data between .5 and 1 whose covariance matrix has the lowest possible determinant. The ne

Re: [R] minor axis ticks in trellis graphics?

2012-07-28 Thread Peter Ehlers
Dear Martin, Mea culpa! I screwed up. I was answering (not well, at that) a different question and somehow managed to make it a response to your request. Here's what may be a solution to your problem. (see also this post by ilai: <

Re: [R] How to extract unique indices for time series Data?

2012-07-28 Thread Gabor Grothendieck
On Sat, Jul 28, 2012 at 3:57 PM, Christofer Bogaso wrote: > Dear all, I am into following coding: > >> library(quantmod) >> Data1 <- get(getSymbols("TCS.NS", from = as.Date("2008-01-01"), >> return.class = "zoo"))[,4] > Warning messages: > 1: In zoo(cd, order.by = index(x), ...) : > some methods f

Re: [R] How to extract unique indices for time series Data?

2012-07-28 Thread Bert Gunter
?unique ?duplicated -- Bert On Sat, Jul 28, 2012 at 12:57 PM, Christofer Bogaso wrote: > Dear all, I am into following coding: > >> library(quantmod) >> Data1 <- get(getSymbols("TCS.NS", from = as.Date("2008-01-01"), >> return.class = "zoo"))[,4] > Warning messages: > 1: In zoo(cd, order.by = i

[R] How to extract unique indices for time series Data?

2012-07-28 Thread Christofer Bogaso
Dear all, I am into following coding: > library(quantmod) > Data1 <- get(getSymbols("TCS.NS", from = as.Date("2008-01-01"), return.class = "zoo"))[,4] Warning messages: 1: In zoo(cd, order.by = index(x), ...) : some methods for “zoo” objects do not work if the index entries in ‘order.by’ are n

Re: [R] Creating sparse matrix of type "dgCMatrix" directly

2012-07-28 Thread Douglas Bates
On Sat, Jul 28, 2012 at 7:26 AM, Søren Højsgaard wrote: > I want to create a sparse matrix of type "dgCMatrix" using the Matrix package > (and the matrix must be of this type even if other more compact > representations may exist). I do > >> library(Matrix) >> m1<-Matrix(rep(1,4),nrow=2,ncol=2,s

Re: [R] selecting a subset of files to be processed

2012-07-28 Thread Ted Harding
And, in addition to the tip from Rui (and similar from Joshua) below, I would advise that there is one good reason not to try doing it in "pure Linux". The only source (that I know of) in Linux itself for random numbers can be tapped by something like cat /dev/random > filename /dev/random sto

Re: [R] selecting a subset of files to be processed

2012-07-28 Thread Rui Barradas
Hello, If the files are to be processed in R select a random sample in R. Using list.files() you can assign a character vector with the filenames of interest and then sample from that vector. ?list.files filenames <- list.files(path, pattern) rand.sampl <- sample(filenames, 45) Hope this hel

Re: [R] selecting a subset of files to be processed

2012-07-28 Thread Joshua Wiley
Hi Erin, It is not difficult to imagine doing it either in R or via the shell. If they are all in the same directory, I would tend towards R, just because you can easily set the seed and keep that information so you can reproduce your random selection. If the wd is in the directory with the files

Re: [R] network plot problem

2012-07-28 Thread Rui Barradas
Hello, It's more or less the same it was with vertices. If the edge labels represent weights, then create an appropriate attribute and set the labels' values to that attribute's values: E(g)$weight <- something # keep the weights in a separate attribute E(g)$label <- E(g)$weight # set w

[R] selecting a subset of files to be processed

2012-07-28 Thread Erin Hodgess
Dear R People: I am using a Linux system in which I have about 3000 files. I would like to randomly select about 45 of those files to be processed in R. Could I make the selection in R or should I do it in Linux, please? This is with R-2.15.1. Thanks, erin -- Erin Hodgess Associate Professo

Re: [R] network plot problem

2012-07-28 Thread Vlatka Matkovic Puljic
Is it possible to write a numbers of link next to lines of the network? For exmple, I have 3 trials that have studied two drugs in network. So, now it seems all links are of same weight. 2012/7/27 Vlatka Matkovic Puljic > Thank you! > > It works fine now! :) > > 2012/7/27 Rui Barradas > >

Re: [R] "metafor" package, proportions: single groups wrt to a categorical dependent variable

2012-07-28 Thread Michael Dewey
At 15:47 28/07/2012, Dushanthi Pinnaduwage wrote: Dear Michael, Thanks very much for your quick response. My outcome is not binary. Outcome has more than 2 values (levels) and I have counts for the levels. I have not written a code yet. Well as the name of the key function in metafor (rma.

[R] A question regarding hypergeometric test

2012-07-28 Thread rad mac
Dear all, There is a simple question regarding gene set enrichment analysis. Say, we have a simple denominator and numerator, therefore hypergeometric test looks like: p=phyper(white-1,total white,total black,drawn). However, there is a question regarding database size. Say, my denominator (tota

Re: [R] "metafor" package, proportions: single groups wrt to a categorical dependent variable

2012-07-28 Thread Michael Dewey
At 01:44 28/07/2012, Dushanthi Pinnaduwage wrote: Dear all, I am using R version 2.15.0 and 'metafor' package version 1.6-0. Can this version of the package handle proportions from a categorical dependent variable for single studies?If so how do I set up my dataframe for the raw data from

Re: [R] Error accessing Vegan package

2012-07-28 Thread Ben Bolker
On 12-07-28 06:49 AM, Bob Green wrote: > In relation to where I was trying to access the zip file it was here: > http://cran.r-project.org/web/bin/windows/contrib/r-release/vegan_2.0-4.zip I think you had the wrong URL ... ? I was able to find it at http://cran.r-project.org/bin/windows/contrib

[R] Creating sparse matrix of type "dgCMatrix" directly

2012-07-28 Thread Søren Højsgaard
I want to create a sparse matrix of type "dgCMatrix" using the Matrix package (and the matrix must be of this type even if other more compact representations may exist). I do > library(Matrix) > m1<-Matrix(rep(1,4),nrow=2,ncol=2,sparse=T) > m1 2 x 2 sparse Matrix of class "dsCMatrix" [1

Re: [R] Error accessing Vegan package

2012-07-28 Thread Bob Green
In relation to where I was trying to access the zip file it was here: http://cran.r-project.org/web/bin/windows/contrib/r-release/vegan_2.0-4.zip I used this method as my work computer does not allow me to directly install packages. Instead I have to install through the local zip file option. I

[R] limit of detection (LOD) by logistic regression

2012-07-28 Thread Luigi
Dear all, I am trying to apply the logistic regression to determine the limit of detection (LOD) of a molecular biology assay, the polymerase chain reaction (PCR). The aim of the procedure is to identify the value (variable "dilution") that determine a 95% probability of success, that is "posit