[R] glmer.nb: function not in downloaded lme4 package?

2013-05-17 Thread Ross Marriott
Dear R Help, I would like to use the glmer.nb function for mixed modelling using negative binomial distribution please. On the CRAN website apparently this function is called from the lme4 package (version 0.9911-1). I have downloaded the latest version of the lme4 package (version 0

[R] Heterogeneous negative binomial

2013-05-17 Thread Joseph Hilbe
I have seen several queries about parameterizing the negative binomial scale parameter. This is called the heterogeneous negative binomial. I have written a function called "nbinomial" which is in the msme package on CRAN. Type ?nbinomial to see the help file. The default model is a negative b

Re: [R] Error with adehabitatHR and kernelbb

2013-05-17 Thread Michael Sumner
I presume it's related to the fact that the X coordinate is duplciated in the two records, and the grid generated by adehabitatHR is a single column, Here's a test: require(adehabitatHR) m <- matrix(c(5419574 ,390051, 5419490 , 390051), ncol = 2, byrow = TRUE) tt <- as.POSIXct(c("2012-05-

Re: [R] filter rows by value

2013-05-17 Thread Ye Lin
it works!Thanks! On Fri, May 17, 2013 at 2:28 PM, Rui Barradas wrote: > Hello, > > Try the following. > > > dat <- read.table(text = " > > Var Time > 1 51 > 2 151 > 3 251 > 4234 > 5 331 > 6351 > ", header = TRUE) > > dat[dat$Time

Re: [R] filter rows by value

2013-05-17 Thread arun
Hi, dat1<- read.table(text=" Var  Time 1  51 2  151 3  251 4    234 5  331 6    351 ",sep="",header=TRUE) dat1[!is.na(match(gsub(".*(\\d{2})$","\\1",dat1$Time),51)),] #  Var Time #1   1   51 #2   2  151 #3   3  251 #6   6  351 #or dat1[substr(dat1$T

Re: [R] Bivariate - multivariate linear regression

2013-05-17 Thread Peter Ehlers
On 2013-05-17 12:45, Jesse Gervais wrote: Hi there, I want to do several bivariate linear regressions and, than, do a multivariate linear regression including only variables significantly associated *(p < 0.15)* with y in bivariate analysis, without having to look manually to those p values.

Re: [R] filter rows by value

2013-05-17 Thread Rui Barradas
Hello, Try the following. dat <- read.table(text = " Var Time 1 51 2 151 3 251 4234 5 331 6351 ", header = TRUE) dat[dat$Time %% 100 == 51, ] Em 17-05-2013 22:01, Ye Lin escreveu: Hey All, I want to delete rows based on the

[R] filter rows by value

2013-05-17 Thread Ye Lin
Hey All, I want to delete rows based on the last 2 digits on the value in one column but I dont know how to do that. Suppose my data looks like this: Var Time 1 51 2 151 3 251 *4234* *5 331* 6351 I want to delete the rows that the

Re: [R] #Keeping row names when using as.data.frame.matrix

2013-05-17 Thread arun
Hi, library(plyr) res<-dcast(dataset,Date~ScowNo,sum,value.var="EstimatedQuantity")  rownames(res)<- res[,1] res[,-1] # 3002 4001 4002 BR 8 #9/7/2010 2772 3535 6763 6685 #9/8/2010    0 3305    0    0 A.K. - Original Message - From: Tim To: r-help@r-project.org Cc: Sent: Friday,

Re: [R] formatting column names of data frame

2013-05-17 Thread Rainer Schuermann
Have you tried xtable? library( xtable ) x <- structure(list(Record = 1:3, Average = c(34L, 14L, 433L), Maximum = c(899L, 15L, 1003L)), .Names = c("Record", "Average", "Maximum"), class = "data.frame", row.names = c(NA, -3L)) x <- xtable( x ) print( x ) % latex table generated in R 2.15.2 by x

Re: [R] image and color gradient

2013-05-17 Thread David Winsemius
On May 17, 2013, at 12:58 PM, Hermann Norpois wrote: > Hello, > > I have a nice function that makes an image of an matrix > e.g.: > qt[1:3,1:3] > rs655246 rs943795 rs955612 > rs655246 NA NA NA > rs943795 9.610070e-04 NA NA > rs955612 5.55

Re: [R] Problems using lmer {lme4}

2013-05-17 Thread Andrea Goijman
Hi Patrick, Thanks for you reply. I tried adding site fixed effect as you told me, but the program failed again (R stopped working). Basically, what I am trying to do is to test for auto-correlation between sites within routes. My survey takes place in routes, but each route is divided in segments

Re: [R] inverse for formula transformations on LHS

2013-05-17 Thread Roger Koenker
Paul, Inverting log(y) is just the beginning of the problem, after that you need to teach predict.lm() that E(y |x) = exp(x'betahat + .5*sigmahat^2) and then further lessons are required to get it to understand how to adapt its confidence and prediction bands… and then you need to generalize

[R] image and color gradient

2013-05-17 Thread Hermann Norpois
Hello, I have a nice function that makes an image of an matrix e.g.: qt[1:3,1:3] rs655246 rs943795 rs955612 rs655246 NA NA NA rs943795 9.610070e-04 NA NA rs955612 5.555616e-05 7.915982e-07 NA myimage <- function(x, cex.axis = 0.7,

[R] formatting column names of data frame

2013-05-17 Thread Patrick Leyshock
Is there any way to format the headers of data frames, for printing? I am using Sweave to generate formatted reports. In Sweave, I read in a data.frame: result <- read.table(path.to.table); then display it: print.data.frame(result); This gives me what I expect in t

[R] Bivariate - multivariate linear regression

2013-05-17 Thread Jesse Gervais
Hi there, I want to do several bivariate linear regressions and, than, do a multivariate linear regression including only variables significantly associated *(p < 0.15)* with y in bivariate analysis, without having to look manually to those p values. So, here what I got for the moment. Fir

Re: [R] help

2013-05-17 Thread David Winsemius
On May 17, 2013, at 11:55 AM, masumeh akhgar wrote: > hi all > this command used tt function for all variables. > How can i define a different function for each variable? >> exCox.all<-coxph(Surv(SURVT,STATUS) ~ > RX+LOGWBC+SEX+tt(RX)+tt(LOGWBC)+tt(SEX), > data=rem.data,tt=function(x,t,...) log(t

Re: [R] time-series aggregation of information

2013-05-17 Thread arun
Hi, May be this helps: dat<- read.table(text=" Date,Parameter,Weight 2012-01-31,90,200 2012-01-31,80,400 2012-01-31,70,500 2012-01-31,60,800 2012-02-29,120,220 2012-02-29,110,410 2012-02-29,75,520 2012-02-29,65,840 2012-03-31,115,210 2012-03-31,100,405 2012-03-31,70,500 2012-03-31,60,800 ",sep=",",

[R] help

2013-05-17 Thread masumeh akhgar
hi all this command used tt function for all variables. How can i define a different function for each variable? > exCox.all<-coxph(Surv(SURVT,STATUS) ~ RX+LOGWBC+SEX+tt(RX)+tt(LOGWBC)+tt(SEX), data=rem.data,tt=function(x,t,...) log(t)*x)) thank you __

Re: [R] time-series aggregation of information

2013-05-17 Thread David Winsemius
On May 17, 2013, at 11:48 AM, Chirag Maru wrote: > I have following data for which I need to calculate the weighted aggregate > value of the parameter at each time. > > Date,Parameter,Weight > 2012-01-31,90,200 > 2012-01-31,80,400 > 2012-01-31,70,500 > 2012-01-31,60,800 > 2012-02-29,120,220 > 2

Re: [R] help

2013-05-17 Thread John Kane
m <- as.matrix(var) John Kane Kingston ON Canada > -Original Message- > From: akhgar.masu...@gmail.com > Sent: Fri, 17 May 2013 22:45:22 +0430 > To: r-help@r-project.org > Subject: [R] help > > Hello, > > I fail to tranfer data from a dataframe to a matrix. > > var is from a datafra

Re: [R] help

2013-05-17 Thread Berend Hasselman
On 17-05-2013, at 20:15, masumeh akhgar wrote: > Hello, > > I fail to tranfer data from a dataframe to a matrix. > > var is from a dataframe (and belongs still to the class dataframe) and > should look like m (see below). > >> var > vec1 vec3 d1 d2 > 1 172 173 223 356 >> dput (var) > str

Re: [R] #Keeping row names when using as.data.frame.matrix

2013-05-17 Thread David Winsemius
On May 17, 2013, at 9:46 AM, Tim wrote: > #question I have the following data set: > > Date<-c("9/7/2010","9/7/2010","9/7/2010","9/7/2010","9/7/2010","9/7/2010","9/8/2010") > > EstimatedQuantity<-c(3535,2772,3279,3411,3484,3274,3305) > > ScowNo<-c("4001","3002","4002","BR 8","4002","BR 8","400

Re: [R] help

2013-05-17 Thread Kevin E. Thorpe
On 05/17/2013 02:34 PM, masumeh akhgar wrote: hi deer all Estimate KM survival probabilities for each categories of RX means ‘treatment’ and ‘placebo’ separately surv.Rx<-survfit(Surv(SURVT,STATUS)~strata(RX),data=rem.data) when write that command. it doesnt run. what should i do? thanks Wha

[R] help

2013-05-17 Thread masumeh akhgar
hi deer all Estimate KM survival probabilities for each categories of RX means ‘treatment’ and ‘placebo’ separately > surv.Rx<-survfit(Surv(SURVT,STATUS)~strata(RX),data=rem.data) when write that command. it doesnt run. what should i do? thanks __ R-help

[R] help

2013-05-17 Thread masumeh akhgar
Hello, I fail to tranfer data from a dataframe to a matrix. var is from a dataframe (and belongs still to the class dataframe) and should look like m (see below). > var vec1 vec3 d1 d2 1 172 173 223 356 > dput (var) structure(list(vec1 = 172L, vec3 = 173L, d1 = 223L, d2 = 356L), .Names = c

[R] time-series aggregation of information

2013-05-17 Thread Chirag Maru
I have following data for which I need to calculate the weighted aggregate value of the parameter at each time. Date,Parameter,Weight 2012-01-31,90,200 2012-01-31,80,400 2012-01-31,70,500 2012-01-31,60,800 2012-02-29,120,220 2012-02-29,110,410 2012-02-29,75,520 2012-02-29,65,840 2012-03-31,115,21

[R] #Keeping row names when using as.data.frame.matrix

2013-05-17 Thread Tim
#question I have the following data set: Date<-c("9/7/2010","9/7/2010","9/7/2010","9/7/2010","9/7/2010","9/7/2010","9/8/2010") EstimatedQuantity<-c(3535,2772,3279,3411,3484,3274,3305) ScowNo<-c("4001","3002","4002","BR 8","4002","BR 8","4001") dataset<- data.frame(EstimatedQuantity,Date,ScowNo)

Re: [R] Error with adehabitatHR and kernelbb

2013-05-17 Thread Rémi Lesmerises
There was some mistakes in my previous sending. The following are correct. This is the problematic data, especially the line 43, but when I removed that line, it bugs at line 62 and so on.           sig1                    time                        id       UTMnorthin  UTMeasting 40      4.5

Re: [R] pearson correlation significant level

2013-05-17 Thread Don McKenzie
Just stating the obvious that Peter left unsaid: The OP calculated a matrix, whose diagonal is the correlations between each variable and itself, with the off-diagonal entries being the ones of interest. On 17-May-13, at 11:06 AM, Peter Ehlers wrote: On 2013-05-17 08:37, Jose Iparraguirre

Re: [R] Problems using lmer {lme4}

2013-05-17 Thread Patrick Coulombe
Hi Andrea, I'm not exactly sure what you're trying to do, but you've included a random effect for a "site" coefficient that's not even in your list of fixed effects... you're basically allowing the coefficient for site to vary across routes, but you're never including the coefficient in the first

Re: [R] Error with adehabitatHR and kernelbb

2013-05-17 Thread Rémi Lesmerises
This is the problematic data, especially the line 43, but when I removed that line, it bugs at line 62 and so on.           sig1                    time                        id     UTMnorthin UTMeasting 40      4.5766      2012.05.30 08:00:00     Ade-55419576     390052 41      4.5766      

Re: [R] pearson correlation significant level

2013-05-17 Thread Peter Ehlers
On 2013-05-17 08:37, Jose Iparraguirre wrote: Dear Elaine, One of the elements you obtain the P matrix, which is the matrix of asymptotic p-values. In your case, you get that the asymptotic p-value of the association between t_i and t_r is 0. That is, there would exist a perfect association

Re: [R] Error with adehabitatHR and kernelbb

2013-05-17 Thread David Winsemius
On May 17, 2013, at 7:44 AM, Rémi Lesmerises wrote: > Dear all, > > I'm trying to get a Brownian bridge kernel (kernelbb) for each combination of > two consecutive animal locations (see commands below) and put them, with a > loop, inside a list. It works well at the beginning but after 42 runs

Re: [R] update an array of plots in 'real-time' without drawing lags

2013-05-17 Thread David Winsemius
On May 17, 2013, at 7:04 AM, Martin Batholdy wrote: > Hi, > > I know R is not made for this, but I still wanted to ask if there are > possibilities to do this; > > > I repeatedly collect data from a database for a given time interval. > Now I would like to monitor the change of this data with

Re: [R] Problems using lmer {lme4}

2013-05-17 Thread agoijman
Thanks! I didn't know about that list. I forwarded my question there Andrea Bert Gunter wrote > It would be better to post this on the r-sig-mixed-models list, I think. > > -- Bert > > On Fri, May 17, 2013 at 10:02 AM, Andrea Goijman > < > agoijman@.gov > > wrote: >> Dear R list, >> >> I'm at

Re: [R] Problems using lmer {lme4}

2013-05-17 Thread Bert Gunter
It would be better to post this on the r-sig-mixed-models list, I think. -- Bert On Fri, May 17, 2013 at 10:02 AM, Andrea Goijman wrote: > Dear R list, > > I'm attaching a sample of my data which consists on the presence/absence > ("punto6", binomial n=5 occasions) > of different species ("sp"),

[R] inverse for formula transformations on LHS

2013-05-17 Thread Paul Johnson
This is an R formula handling question. It arose in class. We were working on the Animals data in the MASS package. In order to see a relationship, you need to log brain and body weight. It's a fun one for teaching regression, if you did not try it yet. There are outliers too! Students wanted to

[R] Problems using lmer {lme4}

2013-05-17 Thread Andrea Goijman
Dear R list, I'm attaching a sample of my data which consists on the presence/absence ("punto6", binomial n=5 occasions) of different species ("sp"), on different sites ("site") within routes ('route"). First, I want to be able to find if there is autocorrelation of the response variable between

Re: [R] Comma separated vector

2013-05-17 Thread Jeff Newmiller
You are wrong... since the SQL query you wish to create is itself a string. Of course, you cannot send a SQL fragment such as you used as an example, so be sure to form a complete, syntactically correct SQL statement before giving it to your database query function. Oh, and if you need more ass

Re: [R] Comma separated vector

2013-05-17 Thread jim holtman
is this what you want" > x <- c(1, 2, 3, 4, 5) > paste0("where ASSETT in (", paste(x, collapse = ','), ")") [1] "where ASSETT in (1,2,3,4,5)" On Fri, May 17, 2013 at 11:46 AM, Manta wrote: > Hi all, > > I have a vector of numbers, and to be able to pass it to RMySQL and use the > IN clause I

[R] Comma separated vector

2013-05-17 Thread Manta
Hi all, I have a vector of numbers, and to be able to pass it to RMySQL and use the IN clause I need to have this vector to be a single list numeric and comma separated. I saw the post below but it is about strings, which I do not need (I cannot pass strings in this SQL query, I need something li

Re: [R] pearson correlation significant level

2013-05-17 Thread Jose Iparraguirre
Dear Elaine, One of the elements you obtain the P matrix, which is the matrix of asymptotic p-values. In your case, you get that the asymptotic p-value of the association between t_i and t_r is 0. That is, there would exist a perfect association (look also at the first result, the matrix of co

Re: [R] Problem with ordiellipse coloured factor in Vegan

2013-05-17 Thread John Kane
No data. The list tends to strip out many kinds of attachements including csv files. I'd suggest trying .txt or parking the data at someplace like [url=http://www.mediafire.com/][b]MediaFire[/b][/url] or Dropbox [url=https://www.dropbox.com/][b]Dropbox[/b][/url] John Kane Kingston ON Canada >

Re: [R] zigzag confidence interval in a plot

2013-05-17 Thread Rui Barradas
Hello, Try the following. lmR <- lm(cd$Depth ~ cd$CHAOsep12RNA) pconfR <- predict(lmR,interval="confidence") pcR <- pconfR[order(pconfR[, 1]), ] # Add this line plot(cd$CHAOsep12RNA,cd$Depth, ylim = rev(range(0:100)), xlab="CHAO", ylab="Depth", pch=15, las=2, main="Sep12-RNA", cex.main=1) a

Re: [R] zigzag confidence interval in a plot

2013-05-17 Thread Peter Ehlers
On 2013-05-17 06:03, Ozgul Inceoglu wrote: Dear All, When I plot the values and linear regression line for one data set, it is fine. But for another one I see zigzags, when I plot the confidence interval cd Depth CHAOsep12RNA 9,94804 25,06 1476,83 40,04 1540,561404 50,11 1575

Re: [R] max length of a factor variable

2013-05-17 Thread bennose
Technically this is correct for raw R functionality. in practice various modules impose their own limits on variables so you have to check. For example the coxreg package truncates all variables to 16 characters. for example the test below > res Call: coxreg(formula = Surv(vtime, vstatus) ~ abcde

Re: [R] points overlay axis

2013-05-17 Thread Jonathan Phillips
Apologies to John - I should have thought to give an example. However, xpd is what I was looking for. Thanks for the help! On 14 May 2013 14:55, David Carlson wrote: > Let's try again after restraining Outlook's desire to use html. > > set.seed(42) > dat <- matrix(c(runif(48), 0, 0), 25, 2, b

Re: [R] R and libre office base

2013-05-17 Thread Marc Schwartz
On May 17, 2013, at 9:47 AM, Johan Lassen wrote: > Dear community . I would like to connect r to libre office base. Does > anyone know if and how this can be done? I think of the pendant to rodbc > for libre office. I am using windows 7. > Thanks in advance and best regards johan As an FYI, th

[R] R and libre office base

2013-05-17 Thread Johan Lassen
Dear community . I would like to connect r to libre office base. Does anyone know if and how this can be done? I think of the pendant to rodbc for libre office. I am using windows 7. Thanks in advance and best regards johan [[alternative HTML version deleted]]

[R] Error with adehabitatHR and kernelbb

2013-05-17 Thread Rémi Lesmerises
Dear all, I'm trying to get a Brownian bridge kernel (kernelbb) for each combination of  two consecutive animal locations (see commands below) and put them, with a loop, inside a list. It works well at the beginning but after 42 runs, it appears the following warning : >Error in seq.default(yl

Re: [R] how to calculate the mean in a period of time?

2013-05-17 Thread arun
Hi, Try this:  dat1$idx<-with(dat1,ifelse(is.na(delais)|delais<45 & delais>20, 1,ifelse(delais<60 & delais>=45,2,ifelse(delais<=90 & delais>=60,3,NA dat1$idx1<-c(dat1$idx[-head(dat1$idx,1)],1) library(zoo) res1<-do.call(rbind,lapply(split(dat1,dat1$patient_id),function(x) {x$idx[as.logica

[R] mirt package "error in ESTIMATION..."

2013-05-17 Thread kende jan
Hello everyone, I am trying to undertake an item bifactor analysis of graded response data from a questionnaire. I am using the mirt package, especially the bfactor function.My dataset is called "data.items", it contains about 2000 observations and 31 variables (variables represent the items in

[R] update an array of plots in 'real-time' without drawing lags

2013-05-17 Thread Martin Batholdy
Hi, I know R is not made for this, but I still wanted to ask if there are possibilities to do this; I repeatedly collect data from a database for a given time interval. Now I would like to monitor the change of this data with some nice plots. I actually have to draw 15 plots to get the whole p

Re: [R] out of the mailing list

2013-05-17 Thread Pascal Oettli
Hello, It is not the correct procedure. Go to the bottom of the following webpage to unsubscribe. https://stat.ethz.ch/mailman/listinfo/r-help Regards, Pascal 2013/5/17 Mario Garrido > Hello, > I want to stop receiveng mails from R help forum, > thanks. > > This is my data : > Mario Garrido

[R] out of the mailing list

2013-05-17 Thread Mario Garrido
Hello, I want to stop receiveng mails from R help forum, thanks. This is my data : Mario Garrido Escudero Dpto. de Biología Animal, Ecología, Parasitología, Edafología y Qca. Agrícola Fac. de Farmacia Campus Unamuno Universidad de Salamanca gaiarr...@usal.es [[alternative HTML version de

Re: [R] Rcmdr Bug?

2013-05-17 Thread Knut Krueger
Am 17.05.2013 13:36, schrieb John Fox: Dear Knut, This is really more a limitation than a bug. Like most of the dialogs in the Rcmdr, the dialog to read Excel files uses existing facilities in R and R packages. I'll see whether it's possible to add an option to read a data set without variabl

Re: [R] R looping help

2013-05-17 Thread Adams, Jean
It's difficult to see where your error is when you provide no accompanying data for us to test your code out on (X? Y? Stand?). However, it looks like you are making your code more complex than it needs to be. Are you simply trying to a fit a separate linear regression to each subset of your da

[R] zigzag confidence interval in a plot

2013-05-17 Thread Ozgul Inceoglu
Dear All, When I plot the values and linear regression line for one data set, it is fine. But for another one I see zigzags, when I plot the confidence interval >cd Depth CHAOsep12RNA 9,94804 25,06 1476,83 40,04 1540,561404 50,11 1575,17 52,46 349,22 54,92 1941,5 57,2

[R] External access to fft routines

2013-05-17 Thread Peter Craig
Dear colleagues (especially those with an understanding of the inner workings of R), For some years, I have been using R's fft (Fast Fourier Transform) routines from within C code as part of an R package. With R-3.0.1, fft_factor and fft_work are no longer available as entry points declared in R

[R] Log scales

2013-05-17 Thread Emily Gleeson
Dear All, I have a query about using log scales for filled.contour plots. I have used log values on the x and y axes but labelled the axes with their linear (non-log) values. I's like to do the same with the contour values. I want the range to go from -100% to +100%. To use log I just added 1

Re: [R] Contour lines in a persp plot

2013-05-17 Thread Matthew
Thanks a lot, that is all i want. If someone is interessed, see the code below panel.3d.contour <- function(x, y, z, rot.mat, distance, nlevels = 20, zlim.scaled, ...) # les3 points de suspension pour dire les autres paramètres sont ceux données par défaut { add.line <- trel

[R] Using grubbs test for residuals to find outliers

2013-05-17 Thread Karthik Srinivasan
Hi, I am a new user of R. This is a conceptual doubt regarding screeing out outliers from the dataset in regression. I read up that Cook's distance can be used and if we want to remove influential observations, we can use the metric (>4/n) (n=no of observations) to remove any outliers. I also ca

[R] Homals: Nonlinear PCA

2013-05-17 Thread l. calciano
Hello! I'm using the NLPCA to reduce the dimensionality of nine variables (4 nominal / 3 ordinal /2 numeric) to obtain the object-scores to be used as dependent variable in a regression model. I'm using the package homals (http://www.jstatsoft.org/v31/i04/paper). The output is: Call: homals

[R] n in pglm() and relogit()

2013-05-17 Thread f . leyendecker84
Dear all, How do I obtain the number of countries that my panel models estimated by pglm() and relogit() (the latter one is in the Zelig library) use? I couldn't find any information on that in the help files. Thank you very much in advance. Best wishes _

Re: [R] A function that can modify an object? Or at least shows principles how to modify an object?

2013-05-17 Thread Adams, Jean
To make it easier for R-help readers to help you, please you provide the before UUU[2] data using the dput() function. dput(UUU[2]) Jean On Thu, May 16, 2013 at 11:12 AM, Aldi wrote: > Hi, If I have an R object UUU, where the second element is U2, based on > "g" column of my.table > > my.tab

Re: [R] Repeating sequence elements

2013-05-17 Thread arun
Hi, rep(seq_along(v),v)  #[1] 1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 5 5 5 6 6 A.K. - Original Message - From: Stefan Petersson To: r-help@r-project.org Cc: Sent: Friday, May 17, 2013 6:53 AM Subject: [R] Repeating sequence elements I want to create a sequence, repeating each element according

Re: [R] Rcmdr Bug?

2013-05-17 Thread John Fox
Dear Knut, This is really more a limitation than a bug. Like most of the dialogs in the Rcmdr, the dialog to read Excel files uses existing facilities in R and R packages. I'll see whether it's possible to add an option to read a data set without variable names. The obvious workaround is to add

Re: [R] Repeating sequence elements

2013-05-17 Thread Jorge I Velez
Try rep(1:length(v), v) HTH, Jorge.- On Fri, May 17, 2013 at 8:53 PM, Stefan Petersson wrote: > I want to create a sequence, repeating each element according to a vector. > > I have this: > > v <- c(4, 4, 4, 3, 3, 2) > > And want to create this: > > 1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 5 5 5 6 6 >

Re: [R] Repeating sequence elements

2013-05-17 Thread Rui Barradas
Hello, At an R prompt, type ?rep Then use v <- c(4, 4, 4, 3, 3, 2) rep(1:6, v) Hope this helps, Rui Barradas Em 17-05-2013 11:53, Stefan Petersson escreveu: I want to create a sequence, repeating each element according to a vector. I have this: v <- c(4, 4, 4, 3, 3, 2) And want to crea

Re: [R] How could I see the source code of functions in an R package?

2013-05-17 Thread Duncan Murdoch
On 13-05-17 12:01 AM, David Winsemius wrote: Do this search with your favorite search tool Accessing the sources ligges (Uwe Ligges is the author of a comprehensive article on the topic in R News.) That article is also linked from the R help system. After help.start(), look for "technical

Re: [R] peering inside functions in a package?

2013-05-17 Thread Duncan Murdoch
On 13-05-16 9:56 PM, Seth Myers wrote: Let's say I would like to look inside the function corBrownian in library (ape). When I type in the function name I get the following, which is not nearly the detail that goes into this function. I am wondering how to begin cracking this function open (and

[R] Repeating sequence elements

2013-05-17 Thread Stefan Petersson
I want to create a sequence, repeating each element according to a vector. I have this: v <- c(4, 4, 4, 3, 3, 2) And want to create this: 1 1 1 1 2 2 2 2 3 3 3 3 4 4 4 5 5 5 6 6 TIA // s R version 3.0.0 (2013-04-03) Platform: x86_64-pc-linux-gnu (64-bit) locale: [1] LC_CTYPE=en_US.UTF-8 L

Re: [R] Selecting A List of Columns

2013-05-17 Thread peter dalgaard
On May 17, 2013, at 08:51 , Sparks, John James wrote: > Dear R Helpers, > > I need help with a slightly unusual situation in which I am trying to > select some columns from a data frame. I know how to use the subset > statement with column names as in: Notice that subset() is a convenience fun

Re: [R] Selecting A List of Columns

2013-05-17 Thread peter dalgaard
On May 17, 2013, at 12:02 , peter dalgaard wrote: > > On May 17, 2013, at 08:51 , Sparks, John James wrote: > >> Dear R Helpers, >> >> I need help with a slightly unusual situation in which I am trying to >> select some columns from a data frame. I know how to use the subset >> statement with

[R] pearson correlation significant level

2013-05-17 Thread Elaine Kuo
Hello I am using package Hmisc to calculate the pearson correlation and the significant level for the matrix of t_i and t_r. (temperature minimum and temperature range) However, I have difficulty interpreting the result, even after checking the manual. Please kindly help to indicate if the p-valu

Re: [R] Selecting A List of Columns

2013-05-17 Thread Pascal Oettli
Hello, It works for me if I replace > ImportantVars <- as.character(ImportantVars) by > ImportantVars <- ImportantVars$Vars Hope this helps, Pascal 2013/5/17 Sparks, John James > Dear R Helpers, > > I need help with a slightly unusual situation in which I am trying to > select some colum

Re: [R] read excel files problem [was] Rcmdr Bug

2013-05-17 Thread Knut Krueger
Am 17.05.2013 09:09, schrieb Pascal Oettli: > Hi, > > Which command? But I would say that the first row is imported as > column names. maybe its a general problem of importing excel files. First of all I am using only sheeets with headlines ;_) but Students do sometimes not. ;-) So gdata - read

Re: [R] Find the indices of non-NA elements of a sequence

2013-05-17 Thread Pascal Oettli
Hi, For example: > which(complete.cases(test)) [1] 1 3 4 6 Probably a more elegant way exists. Regards, Pascal 2013/5/17 jpm miao > Hi, > > I have a sequence whose 1st, 3rd, 4th, 6th are non-NAs. How could I let R > return 1,3,4,6, the indices? > > I know only how to find the non-NA ele

Re: [R] Rcmdr Bug?

2013-05-17 Thread Pascal Oettli
Hi, Which command? But I would say that the first row is imported as column names. Regards, Pascal 2013/5/17 Knut Krueger > may be it is a bug: > if a excel file is not containing headlines the first data row will not be > imported > > Knut > > __**___