Re: [R] bootstrapping quantile regression

2012-10-30 Thread Kay Cichini
sry, I forgot to replace rlm() - but actually I tried both and the question applies to both approaches.. Am 31.10.2012 00:19 schrieb "Kay Cichini" : > > HI everyone, > > I try to get some bootstrap CIs for coefficients obtained by quantile regression. I have influencial values and thus switched to

Re: [R] change lm log(x) to glm poisson

2012-10-30 Thread Elaine Kuo
Hello, Thanks for the book list. Some are added. - Faraway. 2006. Extending the Linear Model With R: Generalized Linear, Mixed Effects and Nonparametric Regression Models (Texts in Statistical Science). - Venables and Ripley. 2002. Modern Applied Statistics with S (4th ed.). (Chapt

Re: [R] Swap rows and columns in a matrix

2012-10-30 Thread David Winsemius
On Oct 30, 2012, at 5:34 PM, arun wrote: > HI David, > > Seems like a closing bracket is needed. > > mat[, sample(dim(mat)[2]) ] > Actually a closing paren: set.seed(123) mat[, sample(dim(mat) ) [2] ] >^^^^^^ > A.K. > > > > > - Original Messag

Re: [R] POSIXct date missing "time component"

2012-10-30 Thread arun
Hi, ?as.POSIXct() format: character string giving a date-time format as used by   ‘strptime’. ?strptime() format: A character string.  The default for the ‘format’ methods is   ‘"%Y-%m-%d %H:%M:%S"’ if any component has a time component   which is not midnight, and ‘"%Y-%m

Re: [R] sqlFetch doesn't read the whole objects.

2012-10-30 Thread Jeff Newmiller
Not reproducible, not even close. Other than saying 600 is not a magic limit in R, not much help can be given. --- Jeff NewmillerThe . . Go Live... DCN:Basics: ##.#. ##.

[R] combined dependent pvalue

2012-10-30 Thread Sheng
Dear All, I am trying to combine dependent p-values in R. May you please help me with this? For independent pvalue combination, one of the popular way is fisher's method which I found the R code here (http://r.789695.n4.nabble.com/fisher-s-posthock-test-or-fisher-s-combination-test-td2195964.html

Re: [R] Swap rows and columns in a matrix

2012-10-30 Thread arun
HI David, Seems like a closing bracket is needed. mat[, sample(dim(mat)[2]) ]    ^^^ A.K. - Original Message - From: David Winsemius To: Haris Rhrlp Cc: "R-help@r-project.org" Sent: Tuesday, October 30, 2012 6:51 PM Subject: Re: [R] Swap rows an

Re: [R] homebrew install R

2012-10-30 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of Frazier, Tyler James > Sent: Tuesday, October 30, 2012 4:15 PM > To: r-help@R-project.org > Subject: [R] homebrew install R > > Is there a recommended way to install R with homeb

[R] homebrew install R

2012-10-30 Thread Frazier, Tyler James
Is there a recommended way to install R with homebrew? Will I completely lose the GUI? .r file command editor? thanks, Ty - Tyler Frazier Department of Transportation Planning and Telematics Technical University Berlin http://www.vsp.tu-berlin.de/ [[alternative HTML version dele

[R] sqlFetch doesn't read the whole objects.

2012-10-30 Thread happyji
Hi everyone, I connected a data in FileMaker server with odbcConnect. When I call the data "CANCERS" using sqlFetch, it looks okay. However, the number of obs was different with the actual number. If I read the same data from Microsoft Access, there are 656 obs. in it but srt() shows me 600 obs.

[R] lapply and kernelUD (adehabitatHR package): Home Range kernel estimation for a list of individuals

2012-10-30 Thread nymphita
Dear R experts, I'm using the adehabitatHR package in order to perform a kernel analysis and estimate the home range of my input data (GPS relocations of 42 individuals). I've done the analysis for one of the individuals and it worked perfectly (see code below). But now I'm trying to use a list a

[R] Error em plot.xy(xy.coords(x, y), type = type, ...) : objeto 'membros' não encontrado

2012-10-30 Thread kin Huts
Hi, I'm trying to plot a map with the location of the stations that I am using require(MASS)require(maps) mapaBrasil <- read.table("BASE_BR.txt",sep="") latlonRS <- read.csv2("coordenadas.txt",h=F,sep="") png(filename="mapa_grupos.png",width=600,height=800) # criating a map for RSmap(xlim=c(-80,-

Re: [R] POSIXct date missing "time component"

2012-10-30 Thread chuck.01
I suppose I should add that this happens at midnight Some more of the data: dates.mine <- dput(free.dates[59:62]) structure(c(1242948600, 1242949500, 1242950400, 1242951300), class = c("POSIXct", "POSIXt"), tzone = "GMT") dates.mine [1] "2009-05-21 23:30:00 GMT" "2009-05-21 23:45:00 GMT" [3] "

Re: [R] POSIXct date missing "time component"

2012-10-30 Thread chuck.01
Um, OK. My dates have times, they are 00:00:00 (i.e. midnight) I'll just add a fraction of a second my dates and go with it. Thanks for the reply. arun kirshna wrote > HI, > Please check this link > (http://rss.acs.unt.edu/Rdoc/library/base/html/as.POSIXlt.html). > "Dates without times are

[R] POSIXct date missing "time component"

2012-10-30 Thread chuck.01
Hi, I have some dates that are giving me a problem, in general the dates look like this: free.dates[60:61] [1] "2009-05-21 23:45:00 GMT" "2009-05-22 00:00:00 GMT" but for some reason, when taken "alone", they look like this: free.dates[60] [1] "2009-05-21 23:45:00 GMT" free.dates[61] [1] "2009

[R] centroid based ellipse

2012-10-30 Thread Lumila Menéndez
Hello After performing a pca of morphometric variables and a scatterplot of the first 2 principal components, using the package latticeExtra, I tried to draw the ellipses representing one sigma from the centroid for each sample, but the function panel.ellipse draws the ellipses around 95% of the sa

[R] centroid based ellipse

2012-10-30 Thread Lumila Menéndez
Hello After performing a pca of morphometric variables and a scatterplot of the first 2 principal components, using the package latticeExtra, I tried to draw the ellipses representing one sigma from the centroid for each sample, but the function panel.ellipse draws the ellipses around 95% of the sa

Re: [R] RCurl - curlPerform - Time out?!?

2012-10-30 Thread Duncan Temple Lang
Hi Florian Yes, there are several options for a curl operation that control the timeout. The timeout option is the top-level general one. There is also timeout.ms. You can also control the timeout length for different parts of the operation/request such as via the connecttimeout for just estab

[R] bootstrapping quantile regression

2012-10-30 Thread Kay Cichini
HI everyone, I try to get some bootstrap CIs for coefficients obtained by quantile regression. I have influencial values and thus switched to quantreg.. The data is clustered and within clusters the variance of my DV = 0.. Is this sensible for the below data? And what about the warnings? Thanks

Re: [R] Swap rows and columns in a matrix

2012-10-30 Thread David Winsemius
On Oct 30, 2012, at 11:59 AM, Haris Rhrlp wrote: > Dear R users, > > I want a help to write an algorithm for swapping rows and columns in a matrix > This will "shuffle" columns, although 'randomly permute' is the more common word for this;operation: set.seed(123) mat[, sample(dim(mat)[2] ]

Re: [R] help with for loop: new column giving count of observation for each SITEID

2012-10-30 Thread Bert Gunter
Eek! Just a bit simpler would be (á la Dr. Dunlap): (d is the data frame): d <- within(d,index <- ave(year,site, FUN = order)) (This assumes exactlly one data collection per each year that appears, though.) Cheers, Bert On Tue, Oct 30, 2012 at 12:56 PM, arun wrote: > HI, > > You can also use

Re: [R] Σχετ: Swap rows and columns in a matrix

2012-10-30 Thread Rolf Turner
Unless there is a good reason not to, you should keep discussions on-list. On 31/10/12 08:29, Haris Rhrlp wrote: > thank you for your answer but i dont want the transpose of matrix. I > want to swap rows seperatly and columns the same Then I am afraid that your question is all Greek to me. :-)

Re: [R] "NA-friendly" operator

2012-10-30 Thread William Dunlap
Instead of ignore-NA versions of ">", "<", "==", etc., I prefer to factor out the ignore-NA part of things: is.true <- function(x) !is.na(x) & x is.false <- function(x) !is.na(x) & !x used as > is.false(c(1,2,NA,4) > 3) [1] TRUE TRUE FALSE FALSE >is.true(c(1,2,NA,4) > 3) [1] F

Re: [R] "NA-friendly" operator

2012-10-30 Thread David Winsemius
On Oct 30, 2012, at 2:25 PM, Berend Hasselman wrote: > > On 30-10-2012, at 22:08, vincent guyader wrote: > >> Hi everyone, >> >> i'm looking for a "NA-friendly" operator >> >> I explain : >> >> vec<-c(3,4,5,NA,1,NA,9,NA,1) >> >> vec[vec == 1] # NA 1 NA NA 1 >> >> I dont want

Re: [R] "NA-friendly" operator

2012-10-30 Thread Berend Hasselman
On 30-10-2012, at 22:08, vincent guyader wrote: > Hi everyone, > > i'm looking for a "NA-friendly" operator > > I explain : > >vec<-c(3,4,5,NA,1,NA,9,NA,1) > >vec[vec == 1] # NA 1 NA NA 1 > > I dont want the NA's : >vec[vec == 1 & ! is.na(vec)]# 1 1 > is the same

Re: [R] "NA-friendly" operator

2012-10-30 Thread Sarah Goslee
Here's one option: > vec<-c(3,4,5,NA,1,NA,9,NA,1) > subset(vec, vec > 2) [1] 3 4 5 9 > subset(vec, vec == 1) [1] 1 1 Sarah On Tue, Oct 30, 2012 at 5:08 PM, vincent guyader wrote: > Hi everyone, > > i'm looking for a "NA-friendly" operator > > I explain : > > vec<-c(3,4,5,NA,1,NA,9,NA,1

[R] "NA-friendly" operator

2012-10-30 Thread vincent guyader
Hi everyone, i'm looking for a "NA-friendly" operator I explain : vec<-c(3,4,5,NA,1,NA,9,NA,1) vec[vec == 1] # NA 1 NA NA 1 I dont want the NA's : vec[vec == 1 & ! is.na(vec)]# 1 1 is the same as vec[vec %in% 1] # 1 1 %in% is NA-friendly :) But if i want

Re: [R] help with for loop: new column giving count of observation for each SITEID

2012-10-30 Thread arun
HI, You can also use this:res<-do.call(rbind,lapply(split(d,d$site),function(x) data.frame(x,newindex=1:nrow(x  rownames(res)<-1:nrow(res)  res #  RchID site year index newindex #1 1    A 2002 1    1 #2 2    A 2004 2    2 #3 3    A 2005 3    3 #4 4    B

Re: [R] help with for loop: new column giving count of observation for each SITEID

2012-10-30 Thread Bert Gunter
Care to tell us why you think you need such an index? I suspect you do not. Cheers, Bert On Tue, Oct 30, 2012 at 12:21 PM, Meredith, Christy S -FS wrote: > Not quite, > I need it like this, a new number for each ordered year in the sequence > within each site, regardless of what the years ar

Re: [R] help with for loop: new column giving count of observation for each SITEID

2012-10-30 Thread William Dunlap
Your data was, in R-readable format (from dput()) d <- data.frame( RchID = 1:9, site = factor(c("A", "A", "A", "B", "B", "B", "C", "C", "C"), levels = c("A", "B", "C")), year = c(2002L, 2004L, 2005L, 2003L, 2006L, 2008L, 2002L, 2003L, 2004L), inde

Re: [R] rms plot.Predict question: swapping x- and y- axis for categorical predictors

2012-10-30 Thread Frank Harrell
The new version of rms is now on CRAN (for Mac and Windows probably tomorrow). You can now do p <- Predict(...); plot(p, ~ x2, nlines=TRUE, type='p') to get what you want. Frank stephsus wrote > Hi Frank, > > Thanks for your reply! Using p <- Predict(f, x2); plot(p, ~x2, > nlines=TRUE) > makes

Re: [R] help with for loop: new column giving count of observation for each SITEID

2012-10-30 Thread Meredith, Christy S -FS
Not quite, I need it like this, a new number for each ordered year in the sequence within each site, regardless of what the years are, and to retain the RchID column. RchID siteyearindex 1 A 20021 2 A 20042 3 A 20053 4 B 2003

Re: [R] Swap rows and columns in a matrix

2012-10-30 Thread Rolf Turner
On 31/10/12 07:59, Haris Rhrlp wrote: Dear R users, I want a help to write an algorithm for swapping rows and columns in a matrix thanks in advance ?t (???) cheers, Rolf Turner __ R-help@r-project.org mailing list https://stat.et

Re: [R] help with for loop: new column giving count of observation for each SITEID

2012-10-30 Thread William Dunlap
Is this what you want? > withinGroupIndex <- function(group, ...) ave(integer(length(group)), group, ..., FUN=seq_along) > site <- c("A","A","C","D","C","A","B") > data.frame(site, index=withinGroupIndex(site)) site index 1A 1 2A 2 3C 1 4D 1 5

Re: [R] Swap rows and columns in a matrix

2012-10-30 Thread Federman, Douglas
Does the builtin function 't' work for your needs? -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Haris Rhrlp Sent: Tuesday, October 30, 2012 3:00 PM To: R-help@r-project.org Subject: [R] Swap rows and columns in a matrix Dear R us

[R] boxplots of various levels

2012-10-30 Thread dysonsphere
noob here trying to make boxplots of some data i would like to separate the boxplots according to conditons of various levels for example: i have group:1 and 2, each group performed tests consisting of condition A,B,C,D side: left and right time: 1 to 10 I would like separate boxplots of the res

[R] mapply instead for loop

2012-10-30 Thread Omphalodes Verna
Hi all!   My question in about using mapply instead for loop. Below is a example with for loop: Is it posible to give same results with mapply function?   Thanks for help!   OV   x <- 1:10 y <- 1:10 xyz <- data.frame(expand.grid(x,y)[1], expand.grid(x,y)[2], z = rnorm(100)) names(xyz) <- c("x", "y

[R] Swap rows and columns in a matrix

2012-10-30 Thread Haris Rhrlp
Dear R users, I want a help to write an algorithm for swapping rows and columns in a matrix thanks in advance [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

Re: [R] box() doesnt work

2012-10-30 Thread Jeff Newmiller
Not without reproducible code and data. --- Jeff NewmillerThe . . Go Live... DCN:Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead:

Re: [R] peer-reviewed (or not) publications on R

2012-10-30 Thread Albyn Jones
More links on reproducible research: Opinion: Open and Free: Software and Scientific Reproducibility Seismological Research Letters Volume 83 · Number 5 · September/October 2012 Reproducible Research in Computational Science Roger D. Peng Science 2 December 2011: 1226-1227. albyn On 2012-10-30

Re: [R] Named list of data.frames to data.frame with names

2012-10-30 Thread arun
Hi, You can also try this:  res<-do.call(rbind,lapply(l,function(x) data.frame(Name=names(l)[match.call()[[2]][[3]]],x)))  row.names(res)<-1:nrow(res)  head(res) #  Name  x  y #1    A -0.7326214 -0.8871683 #2    A  0.4761960  0.8245219 #3    A  0.2362935 -0.1427997 #4    A  1.16842

Re: [R] export variable from bash to R

2012-10-30 Thread sophie
Hi Barry, OK, now I absolutely do feel like the newbie I am :-) I added the function call, and - what a surprise - everything is working fine. Thanks a lot, sophie -- View this message in context: http://r.789695.n4.nabble.com/export-variable-from-bash-to-R-tp4647749p4647912.html Sent from t

[R] help with for loop: new column giving count of observation for each SITEID

2012-10-30 Thread Meredith, Christy S -FS
Hello, I think this is easy, but I can't seem to find a good way to do this in the R help. I have a list of sites, with multiple years of data for each site id. I want to create a new column that gives a number describing whether it is the 1st year ("1" ) the data was collected for the site, th

[R] box() doesnt work

2012-10-30 Thread penguins
Hi, when plotting a graphic i find that the surrounding box disappears if I adjust the margins with par(mar=..). Ive tried reassigning it with box() but it doesnt seem to make any difference. Does anyone know a way to overcome this? Thanks in advance -- View this message in context: http://r

Re: [R] HELP!! how to remove 10% of data randomly in R

2012-10-30 Thread arun
Hi, Try this: dat1<-read.table(text="   V1 V2 1 5 10 2 6  3 3 8  4 4 9 20 5 15 30 6 25 40 7 2  4 8 3  1 9 1  5 10 8 10 ",header=TRUE) dat1[sample(1:nrow(dat1), 0.50*nrow(dat1)),] #50% of data #   V1 V2 #4   9 20 #6  25 40 #8   3  1 #10  8 10 #9   1  5 dat1[-sample(1:nrow(dat1), 0.90*nrow(dat1)),] #

Re: [R] Creating dataframes with unique, sequential names

2012-10-30 Thread Bart Joosen
Damn, I didn't read that before but assign could get the job done if used wise, but without context it's hard to say, I must admit > Date: Tue, 30 Oct 2012 10:50:40 -0600 > Subject: Re: [R] Creating dataframes with unique, sequential names > From: 538...@gmail.com > To: bartjoo...@hot

Re: [R] standard error for quantile

2012-10-30 Thread Ted Harding
On 30-Oct-2012 13:46:17 PIKAL Petr wrote: > Dear all > > I have a question about quantiles standard error, partly practical > partly theoretical. I know that > > x<-rlnorm(10, log(200), log(2)) > quantile(x, c(.10,.5,.99)) > > computes quantiles but I would like to know if there is any funct

[R] issues with krige function

2012-10-30 Thread Adrienne Wootten
Greetings all, Ran into a strange problem with the krige function from geoR. The problem that I am having is that while the krige function seems to work well, the resulting predicted values are all NAs. Given the size of the datasets I am working with can't attach it, but I can provide snippets

Re: [R] create 3x2 panel boxplots

2012-10-30 Thread John Kane
I'm not sure it is "the most elegant" way but you can do this with ggplot2 You may have to install it, (install.packages("ggplot2") A very basis example: library(ggplot2) mydata <- data.frame(aa = rep(letters[1:6], each = 11), bb = rep( c("x", "y"), 11), cc <- rnorm(6

Re: [R] error in lm

2012-10-30 Thread Greg Snow
For a single response variable tools like LASSO, LARS, ridge regression, elasticnet, model averageing, and other penalized methods (packages lasso2, lars, rms, elasticnet, MASS, BMA, and probably others implement these tools) are preferred to stepwise methods. I don't know if any of these have bee

Re: [R] Amelia imputation - column grouping

2012-10-30 Thread Jose Iparraguirre
Hi Elisa, Simply create a data frame with the columns you want to use and then run the amelia() function on that data frame. Say, you've creasted the data frame MyDF with the 3 columns you want amelia to perform the imputation. Then type > a.out <- amelia(MyDFl, m =M) (where M is the number of

Re: [R] export variable from bash to R

2012-10-30 Thread Barry Rowlingson
On Tue, Oct 30, 2012 at 4:34 PM, sophie wrote: > Hi Barry, > > I already tried adding print commands, but even if I put the print command > right under "myscript <- function()", there is no printed output in the > shell... If your script is just: myscript <- function(){ # some stuff } The

Re: [R] create 3x2 panel boxplots

2012-10-30 Thread Greg Snow
You mention trellis, so I will assume that you already know about the trellis graphics functions (in the lattice package). If you are creating all the plots from a single dataset using conditioning then you can just use the 'layout' argument to specify the 3x2 arrangement (note that this argument

Re: [R] peer-reviewed (or not) publications on R

2012-10-30 Thread Bert Gunter
As usual, Google is your friend! Google on "growth of R software." The first 2 hits are relevant, and there are others further down. -- Bert On Tue, Oct 30, 2012 at 9:05 AM, R. Michael Weylandt wrote: > On Tue, Oct 30, 2012 at 2:22 PM, Paul Artes wrote: >> Dear Friends, >> >> I'm contributing

Re: [R] export variable from bash to R

2012-10-30 Thread sophie
Hi Barry, I already tried adding print commands, but even if I put the print command right under "myscript <- function()", there is no printed output in the shell... sophie -- View this message in context: http://r.789695.n4.nabble.com/export-variable-from-bash-to-R-tp4647749p4647897.html Sen

Re: [R] Creating dataframes with unique, sequential names

2012-10-30 Thread Greg Snow
On Tue, Oct 30, 2012 at 8:00 AM, Bart Joosen wrote: > Take a look at ?assign Then read fortune(236) Then learn about lists and environments to learn better methods. Bart, without context it is harder for use to contribute useful advice. > > Bart > > > > -- > View this message in context: >

Re: [R] help - extract data using column names

2012-10-30 Thread Bert Gunter
Please read the Introduction to R tutorial that ships with R to get started with R. Quoting Rolf Turner: " Learn something about R; don't just hammer and hope. Read the introductory manuals and scan the FAQ." Cheers, Bert On Tue, Oct 30, 2012 at 7:09 AM, alex_123 wrote: > hello , I am new use

Re: [R] newbie: embeding seq in a list

2012-10-30 Thread David Carlson
Pass a vector to list() instead of individual values: > env <- list(c(0.8,0.9,1.0,1.1,1.2)) > env [[1]] [1] 0.8 0.9 1.0 1.1 1.2 - David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77840-4352 -Original Message-

[R] RCurl - curlPerform - Time out?!?

2012-10-30 Thread Florian Umlauf (CRIE)
Hi, I am working with the RCurl package and I am using the curlPerform function for an soap-query. The problem is that the code is usually working well, but sometimes the connection gets lost. So I wrote a while-loop to repeat the query if anything might happened so that the same query runs

Re: [R] newbie: embeding seq in a list

2012-10-30 Thread Guillaume2883
Hello Just add "c()" collector as follows : env <- list(c(0.8,0.9,1.0,1.1,1.2)) Cheers Guillaume -- View this message in context: http://r.789695.n4.nabble.com/Re-newbie-embeding-seq-in-a-list-tp4647884p4647896.html Sent from the R help mailing list archive at Nabble.com.

[R] rJava Out of Memory Error

2012-10-30 Thread scoyoc
I'm running XLConnect 0.2-1 that depends on rJava 0.9-3. I am only able to work with 2 workbooks before I get this error... > SppRich = wb["SpeciesRichness"] # This command calls an Excel > spreadsheet Error: OutOfMemoryError (Java): GC overhead limit exceeded I have tried... > rm(list = ls(

Re: [R] Is there an lm() equivalent of panel.lmline()?

2012-10-30 Thread Greg Snow
You can use the lmList function in the nlme package to do several seperate regressions, or use a model that allows for multiple intercepts. Possibly Xvalues ~ 0 + log(Qvalues)*Tfac or Xvalues ~ 0 + Tfac + log(Qvalues):Tfac (assuming Tfac is a factor). On Tue, Oct 30, 2012 at 5:53 AM, Alex van der

Re: [R] help - extract data using column names

2012-10-30 Thread Jessica Streicher
A look at the tutorial might help here, but anyway: Say you have that dataframe down there with the name myData (you should use dput() to give us the data btw), then you can subset that by using myData[rows,columns], where left of the comma you define which rows you want, and right of the comma

Re: [R] create 3x2 panel boxplots

2012-10-30 Thread R. Michael Weylandt
On Tue, Oct 30, 2012 at 3:08 PM, nikalk wrote: > Hi, I would like to create a trellis plot (3x2) of 6 individual box plots. > It would look like this: > (Created semi-manually) > > What would be the most elegant way to do this? > Thank you!

Re: [R] peer-reviewed (or not) publications on R

2012-10-30 Thread R. Michael Weylandt
On Tue, Oct 30, 2012 at 2:22 PM, Paul Artes wrote: > Dear Friends, > > I'm contributing to a paper on a new R package for a clinical (medicine, > ophthalmology) audience, and part of the mission is to encourage people who > might be occasional users of Excel or SPSS, to become more familiar with R

Re: [R] error in lm

2012-10-30 Thread Greg Snow
First your response in the formula is a matrix which causes the lm function to return an object of type 'mlm' for multivariate linear model. Then when you run the stepAIC function it runs the addterm function which looks for a method(function) to add terms to mlm objects. However nobody has writt

Re: [R] help - extract data using column names

2012-10-30 Thread jim holtman
Is this what you want: > x <- read.table(text = "Mi RBN RBFnDB > nX + 3 2.6225979 0.53132756 -0.80599902 -1.4471864 -0.5705269 + 10 0.4818746 -1.72143092 -2.19579027 2.0118824 -0.5705269 + 12 2.8519611 1.88298265 0.09614617 0.6282549 -0.5705269

Re: [R] HELP!! how to remove 10% of data randomly in R

2012-10-30 Thread R. Michael Weylandt
Nope, you can do it easily along the lines of dat[sample(NROW(dat), NROW(dat)*(1 - 0.1)),] But you need to spend the time understanding what all that does. Lots of important and powerful R ideas in that little bit. Michael On Tue, Oct 30, 2012 at 3:12 PM, Eugenie wrote: > any can please tell m

Re: [R] export variable from bash to R

2012-10-30 Thread Barry Rowlingson
On Tue, Oct 30, 2012 at 2:03 PM, sophie wrote: > Hi Barry > > Thank you very much for your reply. I changed my scripts according to your > suggestions - this is how they look now: > > #!/bin/bash > > VARIABLES=( a b c d ) > > for i in ${VARIABLES[@]}; do > export VARIABLENAME=$i > Rscr

Re: [R] newbie: embeding seq in a list

2012-10-30 Thread Jessica Streicher
s <- seq(0.8, 1.2, by = 0.1) as.list(s) to get the first type of list from the sequence. On 30.10.2012, at 16:51, ONKELINX, Thierry wrote: > You first example is a list of 5 items, each item is a number > The second example is a list with one item: a vector with 5 elements. > > You'll need c()

[R] Data set BregFix in package flexmix

2012-10-30 Thread tudor
Dear list: I would like to recreate how the artificial data set BregFix was generated in package flexmix (thanks Bettina and Friedrich). The data set is thoroughly described in Grun and Leisch's Computational Statistics & Data Analysis 51(11) :5247-5252 but references to the appropriate seed numb

Re: [R] newbie: embeding seq in a list

2012-10-30 Thread ONKELINX, Thierry
You first example is a list of 5 items, each item is a number The second example is a list with one item: a vector with 5 elements. You'll need c() to make a vector of the item to get the same result. all.equal(list(c(0.8,0.9,1.0,1.1,1.2)), list(seq(0.8, 1.2, by = 1.1))) ir. Thierry Onkelinx Inst

[R] HELP FOR COMPUTING ENVIRONMENTAL EFFICIENCY INDEX/ LUENBERGER INDEX

2012-10-30 Thread Wang Sonne Soazic Elise
Dear Members  I am Writing to you because I need help to compute the Malmquist Luenberger   index  with  R with my panel data of 10 central Africa countries from the year 1980 to 2008. I have three inputs and 2 outputs which one is undesirable (CO2) and the other (GDP for agriculture is the des

[R] HELP!! how to remove 10% of data randomly in R

2012-10-30 Thread Eugenie
any can please tell me how to remove 10%,15%,25% and 50% of the data randomly by using R programme??? can anyone please show me the coding? do i need to install any package? -- View this message in context: http://r.789695.n4.nabble.com/HELP-how-to-remove-10-of-data-randomly-in-R-tp4647879.html

[R] FW: replace repeated id in a pedigree list

2012-10-30 Thread Roberta Carriero
From: roberta...@hotmail.it To: smartpink...@yahoo.com Subject: RE: [R] replace repeated id in a pedigree list Date: Tue, 30 Oct 2012 09:51:50 +0100 You are right! I want to "replace the second 6 with a new ID". For example I have id 6 which is repeated 2 times. In family 1 it appears on

[R] map similarity spatial autocorrelation in R

2012-10-30 Thread politeness
Hi, I have two global raster maps, each of the same variable but from different sources. The values range from 0 to 5 in whole numbers. Is there a statistical test in R that can quantify the similarity of the spatial patterns (i.e., highs and lows)? Thanks, -- View this message in context: h

[R] peer-reviewed (or not) publications on R

2012-10-30 Thread Paul Artes
Dear Friends, I'm contributing to a paper on a new R package for a clinical (medicine, ophthalmology) audience, and part of the mission is to encourage people who might be occasional users of Excel or SPSS, to become more familiar with R. I'd really appreciate any pointers to more recent papers th

Re: [R] export variable from bash to R

2012-10-30 Thread sophie
Hi Barry Thank you very much for your reply. I changed my scripts according to your suggestions - this is how they look now: #!/bin/bash VARIABLES=( a b c d ) for i in ${VARIABLES[@]}; do export VARIABLENAME=$i Rscript -e 'source("myscript.R")' done and in the R program, I used ar

[R] help - extract data using column names

2012-10-30 Thread alex_123
hello , I am new user in R . I have datafile (class = data.frame) which has 825 columns with unique column name i want extract 200 selected column from datafile how can I do this? my datafile look like.. Mi RBN RBFnDB nX 3 2.6225979 0.53132756 -0.80599

[R] create 3x2 panel boxplots

2012-10-30 Thread nikalk
Hi, I would like to create a trellis plot (3x2) of 6 individual box plots. It would look like this: (Created semi-manually) What would be the most elegant way to do this? Thank you! -- View this message in context: http://r.789695.n4.na

[R] Amelia imputation - column grouping

2012-10-30 Thread Elisa D'Arcangelo
Hi everybody, I am quite new to data imputation, but I would like to use the R package ' Amelia II: A Program for Missing Data '. However, its unclear to me how the input for amelia should look like: I have a data frame consisting of numerous coulmns, which represent different experimental condi

[R] newbie: embeding seq in a list

2012-10-30 Thread Anser Chen
Suppose I want to create a structure containing the following values: 0.8,0.9,1.0,1.1,1.2 If I use env <- list(0.8,0.9,1.0,1.1,1.2) then R returns > env [[1]] [1] 0.8 [[2]] [1] 0.9 [[3]] [1] 1 [[4]] [1] 1.1 [[5]] [1] 1.2 But, if I try to 'save some key-strokes', and use env <- list(seq(

Re: [R] Creating dataframes with unique, sequential names

2012-10-30 Thread Bart Joosen
Take a look at ?assign Bart -- View this message in context: http://r.789695.n4.nabble.com/Creating-dataframes-with-unique-sequential-names-tp4647863p4647864.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org maili

[R] Java Exception error while reading large data in R from DB using RJDBC.

2012-10-30 Thread aajit75
Dear List, Java Exception error while reading large data in R from DB using RJDBC. I am trying to read large data from DB table(Vectorwise), using RJDBC connection. I have tested the connection with small size data and was able to fetch DB tables using same connection(conn as in my code). Pleas

[R] Isomorphic matrices

2012-10-30 Thread Haris Rhrlp
Dear R users,  I have 2 matrices dim(16x5) below and i want to write an algorithm that check the 2 matrices if they are isomorphic ones (Isomorphic matrices: if I change the rows or/and columns or/and zeros into 1 and 1 into zeros in a row(s) or column(s) are the 2 matrices identical). 0    0  

Re: [R] standard error for quantile

2012-10-30 Thread Roger Koenker
Petr, You can do: require(quantreg) summary(rq(x ~ 1, tau = c(.10,.50,.99)) url:www.econ.uiuc.edu/~rogerRoger Koenker emailrkoen...@uiuc.eduDepartment of Economics vox: 217-333-4558University of Illinois fax: 217-244-6678

Re: [R] standard error for quantile

2012-10-30 Thread Bert Gunter
Petr: 1. Not an R question. 2. You want the distribution of order statistics. Search on that. It's basically binomial/beta. -- Bert On Tue, Oct 30, 2012 at 6:46 AM, PIKAL Petr wrote: > Dear all > > I have a question about quantiles standard error, partly practical > partly theoretical. I know

Re: [R] print and execute functions in a package namespace

2012-10-30 Thread Hadley Wickham
> But I need to work with the names of the figure functions instead, something > like > > figlist <- paste0("fig", 1:3) Are the functions exported or internal? # Use for internal functions pkg <- asNamespace("mypackage") # Use for exported functions: pkg <- "package:mypackage" # Find functions m

Re: [R] Opening SAS file using read.sas7bdat() function in sas7bdat library.

2012-10-30 Thread Matt Shotwell
Thanks for the helpful comments from others. The KNOWNHOST variable lists the types of file that are known to work with the read.sas7bdat function. It's likely that most files written on Windows platforms will work, even if not listed in KNOWNHOST. If you're feeling experimental, you might just co

[R] standard error for quantile

2012-10-30 Thread PIKAL Petr
Dear all I have a question about quantiles standard error, partly practical partly theoretical. I know that x<-rlnorm(10, log(200), log(2)) quantile(x, c(.10,.5,.99)) computes quantiles but I would like to know if there is any function to find standard error (or any dispersion measure) of th

[R] print and execute functions in a package namespace

2012-10-30 Thread Michael Friendly
Let's say I have a package that consists of a set of functions, fig1(), fig2(), fig3() ..., each of which produces a plot, and perhaps some printed output, e.g., fig1 <- function() plot(1:10) fig2 <- function() plot(10:1) fig3 <- function() {y<-sample(1:10,10); plot(y); y} I'd like to produce

Re: [R] Error unary operator

2012-10-30 Thread John Kane
it looks like facet_grid(Aeventexhumed ~ Rayos) + geom_smooth(method="lm", fill=NA) + ylim(c(0, 7)) should read facet_grid(Aeventexhumed ~ Rayos) + geom_smooth(method="lm", fill=NA) + ylim(c(0, 7)) In ggplot the + must be on the preceding line. John Kane Kingston ON Canada > -

Re: [R] subtract a time period from a date

2012-10-30 Thread arun
HI, Try this:  dat1<-"2011-05-01 CEST"  dat2<-as.POSIXlt(dat1) dat2$mday<-dat2$mday-30 dat2 #[1] "2011-04-01" A.K. - Original Message - From: paladini To: r-help@r-project.org Cc: Sent: Tuesday, October 30, 2012 6:25 AM Subject: [R] subtract a time period from a date Hello everybody,

Re: [R] subtract a time period from a date

2012-10-30 Thread PIKAL Petr
Hi > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of paladini > Sent: Tuesday, October 30, 2012 11:26 AM > To: r-help@r-project.org > Subject: [R] subtract a time period from a date > > Hello everybody, > how can I reduce e.g.

Re: [R] subtract a time period from a date

2012-10-30 Thread Rui Barradas
Hello, I don't get it, this seems to work as expected. d <- as.Date("2011-05-01 CEST") d - 30 [1] "2011-04-01" Hope this helps, Rui Barradas Em 30-10-2012 10:25, paladini escreveu: Hello everybody, how can I reduce e.g. 30 days from a date? When I do the following "2011-05-01 CEST" -"2011

Re: [R] FW: replace repeated id in a pedigree list

2012-10-30 Thread Rui Barradas
Hello, Ok, try the following. fun <- function(x, d, last){ new <- last if(any(d)){ ii <- which(d) for(i in ii){ new <- new + 1 old <- x$ID[i] x$ID[i] <- new x$FA_ID[x$FA_ID == old] <- new x$MO_ID[x$MO_ID == old]

[R] Is there an lm() equivalent of panel.lmline()?

2012-10-30 Thread Alex van der Spek
panel.lmline returns intercept and slope of y ~ x subsetted to the combination of conditioning factors given to xyplot in lattice. for instance: xyplot(Xvalues ~ log(Qvalues)|Tfac, data = df7, panel = panel.lmline) I am looking to find the equivalent formulation for lm() proper. If I do this:

[R] error in lm

2012-10-30 Thread paola
Hi everybody I am trying to run the next code but I have the next problem Y1<-cbind(score.sol, score.com.ext, score.pur) > vol.lm<-lm(Y1~1, data=vol14.df) > library(MASS) > stepAIC(vol.lm,~fsex+fjob+fage+fstudies,data=vol14.df) Start: AIC=504.83 Y1 ~ 1 Error in addterm.mlm(fit, scope$add, scale

Re: [R] Named list of data.frames to data.frame with names

2012-10-30 Thread Rui Barradas
Hello, You're right, sorry for the misleading post. It's even documented: "|times||A |integer vector giving the (non-negative) number of times to repeat each element if of length |length(x)|" As for a one liner, use within(). within(do.call(rbind, l), name <- rep(names(l), times=sapply(l, nrow

[R] subtract a time period from a date

2012-10-30 Thread paladini
Hello everybody, how can I reduce e.g. 30 days from a date? When I do the following "2011-05-01 CEST" -"2011-04-01 CEST" I get: "Time difference of 30 days" an thats fine. But when I try "2011-05-01 CEST" - 30 I get nonsense. So how can I subtract some days, month or years from a date? tha

  1   2   >