Re: [R] order or sort doesn´t work properly

2012-07-17 Thread Bert Gunter
1. That you think order() or sort() "did not work " is preposterous. 2. I suggest that you carefully read both ?sort and ?order, as you obviously do not understand what these functions do. Here is a hint to get you started: > 3:1 [1] 3 2 1 > order(3:1) [1] 3 2 1 > sort(3:1) [1] 1 2 3 -- Bert O

Re: [R] ggplot2 qplot pch not working anymore

2012-07-17 Thread Stephen Sefick
Dr. Bolker thank you for the help. I have figured out how to make this do what I wanted - re:inline. I wanted to use the pch variable as the number for the R plotting symbol. I hope that makes more sense. kindest regards, Stephen On Tue 17 Jul 2012 10:31:07 PM CDT, Ben Bolker wrote: Stephe

Re: [R] problem with installing R pacakges

2012-07-17 Thread Kishor Tappita
Dear Uwe, I will enter the correct user::password values and try again. As per your suggestion I will contact the local sysadmin if required. Thanks for your help. Regards, Kishor On Wed, Jul 18, 2012 at 12:46 AM, Uwe Ligges < lig...@statistik.tu-dortmund.de> wrote: > > > On 16.07.2012 14:45,

Re: [R] Finding the column with the maximum value by row

2012-07-17 Thread Guillaume Bal
Hi, You should be able to reach your goal using functions "which" and "apply" On 7/17/2012 3:03 PM, Christopher Desjardins wrote: Hi, Let's say I have the following data: a=matrix(c(1,2,4,4,2,1,1,2,4),nrow=3,byrow=T) a [,1] [,2] [,3] [1,]124 [2,]421 [3,]1

[R] order or sort doesn´t work properly

2012-07-17 Thread Trying To learn again
Hi all, I want to order a series that is included on the second column in MCT.csv. I do but R doesn´t order, could be because is a csv? I have prove MCT<-read.csv("MCT.csv") a<-order(MCTor[,2],2,decreasing = FALSE) a<-order(MCTor[,2],1,decreasing = FALSE) or the same with sort but didn´t wo

Re: [R] need help please

2012-07-17 Thread arun
Hi Yolande, For your first error regaring factor, I am getting a single number thisIndex <- as.character(index(diveData_2008[2,])) > dive_id <- diveCond_all$dive_id[diveCond_all$timestamp==thisIndex] > dive_id [1] 1 #because there is only one TRUE value below and that refers to dive_id 1. diveC

Re: [R] Finding the column with the maximum value by row

2012-07-17 Thread arun
Hi, Try, apply(a,1,which.max) [1] 3 1 3 A.K. - Original Message - From: Christopher Desjardins To: r-help@r-project.org Cc: Sent: Tuesday, July 17, 2012 6:03 PM Subject: [R] Finding the column with the maximum value by row Hi, Let's say I have the following data: > a=matrix(c(1,2,4,

Re: [R] ggplot2 qplot pch not working anymore

2012-07-17 Thread Ben Bolker
Stephen Sefick auburn.edu> writes: > I'm sorry I didn't give the correct code, or explaination; the > shape=pch doesn't work anymore. For example this used to work, but no > longer can accept continuous values: > > #example code > a <- 1:10 > b <- 1:10 > pch <- 1:10 > > q <- data.frame(a,b

Re: [R] Lavaan Package - How to Extract Residuals in Data Values

2012-07-17 Thread Ed Merkle
Dear Emily, The lavaan package is typically used to fit models with latent variables, and these models are typically fit to the covariance matrix (and not necessarily to the raw data). Thus, it is usually not straightforward to get data residuals from the fitted models. In your case, it appe

[R] Regression Identity

2012-07-17 Thread darnold
Hi, I see a lot of folks verify the regression identity SST = SSE + SSR numerically, but I cannot seem to find a proof. I wonder if any folks on this list could guide me to a mathematical proof of this fact. Thanks. David. -- View this message in context: http://r.789695.n4.nabble.com/Regressi

Re: [R] weighted mean by week

2012-07-17 Thread David Freedman
Honestly, I wasn't sure what you wanted to do with 'group'. Here it is with the 'group' variable deleted library(data.table) dt=data.table(x[,-1]) dt[,lapply(.SD, function(x)weighted.mean(x,myweight)), keyby='myweek'] -- View this message in context: http://r.789695.n4.nabble.com/weighted

[R] Defining a variable outside of optim or differential equation solver.

2012-07-17 Thread Tjun Kiat Teo
This is applicable to either using optim or the differential equation solver or any similar solver Suppose I want to use the differential equation solver and this is my code d<-y[2] vdpol<-function(t,y) { list(c(1, d, 3, 4 ) } stiff<-ode(y=rep(0,4),times=c(0,1),func

Re: [R] weighted mean by week

2012-07-17 Thread Dimitri Liakhovitski
David, many thanks. Did something get ommitted from your line?: ddply(x ,.(myweek), summarize, m1=weighted.mean(var1,myweight), m2=weighted.mean(var2,myweight)) Because it just reproduces x - in a somewhat different order... Thank you! Dimitri On Tue, Jul 17, 2012 at 9:22 PM, David Freedman wr

Re: [R] weighted mean by week

2012-07-17 Thread David Freedman
If there are many variables, I'd then suggest the data.table package: library(data.table) dt=data.table(x) dt[,lapply(.SD, function(x)weighted.mean(x,myweight)), keyby=c('group', 'myweek')] The '.SD' is an abbreviation for all the variables in the data table (excluding the grouping variables). T

Re: [R] weighted mean by week

2012-07-17 Thread Dimitri Liakhovitski
Thanks a lot, David. Indeed, it's much shorter. Unfortunately, in my real task I am dozens and dozens of variables like var1 and var2 so that manually specifying things like in "m1=weighted.mean(var1,myweight)" would take a lot of code and a very long time. Dimitri On Tue, Jul 17, 2012 at 6:34 PM,

Re: [R] ggplot2 qplot pch not working anymore

2012-07-17 Thread Stephen Sefick
I'm sorry I didn't give the correct code, or explaination; the shape=pch doesn't work anymore. For example this used to work, but no longer can accept continuous values: #example code a <- 1:10 b <- 1:10 pch <- 1:10 q <- data.frame(a,b,pch) qplot(a,b, shape=pch) many thanks, Stephen Sefic

Re: [R] about different bandwidths in one graph

2012-07-17 Thread Peter Ehlers
On 2012-07-17 11:15, chester123 wrote: Thank you in advance. Now I want to make comparison of the different bandwidth h in a normal distribution graph. This is the table of bandwidth h: thumb rule (normal)--0.00205; thumb rule(Epanech.)--0.00452; Plug-in (normal)--0.0009; Plug-in(Epanech.)--0.0

[R] ggplot2 qplot pch not working anymore

2012-07-17 Thread Stephen Sefick
Is there a way to use a continuous variable to pch in qplot? I believe this worked in previous version. I need to specify certain values of a shape for particular points so that multiple graphs all show the same shapes for the same streams. I have gone to the original data and added a pch co

Re: [R] subsetting without losing the attributes

2012-07-17 Thread Peter Ehlers
Inline On 2012-07-17 04:16, MK wrote: Hi, How do I use the subset function without losing the attributes? You don't. At least not without modifying subset.data.frame(). The key sentence on the ?Extract help page is this: "Subsetting (except by an empty index) will drop all attributes exc

[R] Kernel smoothing ("ks" package)

2012-07-17 Thread Gary Dong
Dear R users, I'm trying to determine local population centers in a region through kernel smoothing. What I have is population density in each neighborhood, which can be presented as point density. So in my data set “pop”, I have three columns for about 1000 neighborhoods: x (x coordinate), y (y c

[R] tweaking forest plot (metafor package)

2012-07-17 Thread eesteves
Dear All, I'm having trouble tweaking a forest plot made using the R meta-analysis package metafor. I did the analysis based upon the correlation coeff from studies and plotted the corresponding forest plot easily q2<-rma(yi,vi,mods=cbind(grupo),data=qim) q2 forest (q2,transf=transf.ztor

Re: [R] Problem creation tensor

2012-07-17 Thread Kjetil Halvorsen
Amusing that someone named RICCI is asking about tensors (sorry!) Kjetil On Tue, Jul 17, 2012 at 6:31 AM, Peppe Ricci wrote: > Hi guys, > > I need some help to analyzing my data. > I start to describe my data: I have 21 matrices, every matrix on the > rows has users and on columns has items

Re: [R] weighted mean by week

2012-07-17 Thread David Freedman
The plyr package is very helpful for this: library(plyr) ddply(x ,.(myweek), summarize, m1=weighted.mean(var1,myweight), m2=weighted.mean(var2,myweight)) -- View this message in context: http://r.789695.n4.nabble.com/weighted-mean-by-week-tp4636814p4636816.html Sent from the R help mailing list

Re: [R] OT: Where's the new Tukey?

2012-07-17 Thread Kjetil Halvorsen
Venables & Ripley: "Modern Applied Statistics with S (fourth Edition)" (known as MASS) Kjetil On Sat, Jul 14, 2012 at 4:01 PM, Larry White wrote: > I'm looking for a single book that provides a deep, yet readable > introduction to applied data analysis for general readers. > > I'm looking for c

[R] weighted mean by week

2012-07-17 Thread Dimitri Liakhovitski
Hello! I wrote a code that works, but it looks ugly to me - it's full of loops. I am sure there is a much more elegant and shorter way to do it. Thanks a lot for any hints! Dimitri # I have a data frame: x<-data.frame(group=c("group1","group2","group1","group2"), myweight=c(0.4,0.6,0.4,0.6),

Re: [R] remove from listserv

2012-07-17 Thread Rolf Turner
On 18/07/12 07:58, Courtney Saltonstall Couch wrote: Could you please remove my email from the listserv? You have to do that yourself. See: https://stat.ethz.ch/mailman/listinfo/r-help cheers, Rolf Turner __ R-help@r-project.org maili

Re: [R] Finding the column with the maximum value by row

2012-07-17 Thread R. Michael Weylandt
apply(a, 1, which.max) Apply the which.max() function to the matrix a row-wise (1) Michael On Tue, Jul 17, 2012 at 5:03 PM, Christopher Desjardins wrote: > Hi, > Let's say I have the following data: > >> a=matrix(c(1,2,4,4,2,1,1,2,4),nrow=3,byrow=T) > >> a > > [,1] [,2] [,3] > > [1,]1

[R] Finding the column with the maximum value by row

2012-07-17 Thread Christopher Desjardins
Hi, Let's say I have the following data: > a=matrix(c(1,2,4,4,2,1,1,2,4),nrow=3,byrow=T) > a [,1] [,2] [,3] [1,]124 [2,]421 [3,]124 What syntax should I use to get R to tell me the column that corresponds to the maximum value for each row? For my exa

Re: [R] Script help: Determining Time Difference between two data points.

2012-07-17 Thread William Dunlap
By the way, here is a related function I wrote in response to an R-help question a while back that finds sequences that start when a signal rises about a certain threshold and end when the signal drops below a lower threshold. This avoids hysteresis-like problems. f1 <- function(x, startThreshold

[R] problem with function

2012-07-17 Thread Hermann Norpois
Dear list, I have a problem with defining a function (see below) to read my testfile (see testfile). My function only returns mydata I wish to work with attr(mydata, 'fc') as well (for labelling a plot). Principally it works if I do not insist on this function but it would be much easer if it is p

[R] Variable labels

2012-07-17 Thread Francois Maurice
Hi,   I'm using write.table() to export dataframe to Excel. All works fine except that I want to export the variable labels instead of variable names.  I can see the labels in the R consol using attr(), but I just don't know how to use the labels instead of the names. Thanks, François Mauric

Re: [R] R-help Digest, Vol 113, Issue 20

2012-07-17 Thread Francois Maurice
Hi,   I'm using write.table() to export dataframe to Excel. All works fine except that I want to export the variable labels instead of variable names.    I can see the labels in the R consol using attr(), but I just don't know how to use the labels instead of the names.   Thanks,   François Mauri

[R] remove from listserv

2012-07-17 Thread Courtney Saltonstall Couch
Could you please remove my email from the listserv? Thanks, Courtney -- -- Courtney Saltonstall Couch Ph.D. Candidate Corson Hall E323 Department of Ecology and Evolutionary Biology Cornell University Ithaca, NY 14853 Office: 607-254-4296 [[alternative HTML version deleted]] __

Re: [R] Table/Frame - output

2012-07-17 Thread andrija djurovic
Hi. You should check function addtable2plot from plotrix package. Also, here is an example of modified addtable2plot function that I sometimes use. This function is probably to far from perfect but, maybe, it will give you some ideas how to solve your problem: t2p <- function(x=par("usr")[1],y=

Re: [R] Table/Frame - output

2012-07-17 Thread Greg Snow
There are functions that allow for the "plotting" of text and R objects that could be used to plot to a bitmap. Look at the 'addtable2plot' function in the plotrix package and the textplot function in the gplots package (look for alternative spellings if you don't find them based on those exact sp

Re: [R] Script help: Determining Time Difference between two data points.

2012-07-17 Thread William Dunlap
Look at ?as.numeric.difftime > z <- f(d, d$Score > 150) > elapsedTime <- z$endDate - z$startDate > units(elapsedTime) [1] "secs" > as.numeric(elapsedTime, units="hours") [1] 7.616667 0.00 192.70 4.37 62.97 0.00 12.50 0.00 > as.numeric(elapsed

Re: [R] Need Help in a Combinatorial Optimzation Problem

2012-07-17 Thread Bert Gunter
Homework? -- we don't do homework here. -- Bert On Tue, Jul 17, 2012 at 11:13 AM, Chandramouli Banerjee < banerjee.chandramo...@gmail.com> wrote: > Dear Community, > > I have a problem I am trying to code in R. > > Suppose there are 7 products and each have a ROI value attached to it. > There ar

Re: [R] complexity of operations in R

2012-07-17 Thread Johan Henriksson
thanks for the link! I should read it through. that said, I didn't find any good general solution to the problem so here I post some attempts for general input. maybe someone knows how to speed this up. both my solutions are theoretically O(n) for creating a list of n elements. The function to impr

[R] edf's higher than 1

2012-07-17 Thread wshadish
Simon, in your recent reply to me, you noted that EDF=1 corresponds to a straight line fit. Does the edf always indicate the polynomial exponent directly? We ask because Hothorn and Everitt said "Roughly, the complexity of a cubic spline is about the same as a polynomial of degree one less than

Re: [R] Script help: Determining Time Difference between two data points.

2012-07-17 Thread APOCooter
Yes! That does exactly what I want it to. Thank you so much. One question, though, is it possible that the time difference be in hours instead of seconds (other than dividing by 3600)? Looking at the code, I don't know what I would change. Does this do what you want? > firstInRun <- functio

[R] Installing packages from RProfile.site file

2012-07-17 Thread abhisarihan
I am trying to install custom packages upon starting R. A lot of the code that is written by us right now is available for editing to the users. To try and protect the code, I am packaging the production level code and having the users install it on their machine during start up. However, when I t

[R] about different bandwidths in one graph

2012-07-17 Thread chester123
Thank you in advance. Now I want to make comparison of the different bandwidth h in a normal distribution graph. This is the table of bandwidth h: thumb rule (normal)--0.00205; thumb rule(Epanech.)--0.00452; Plug-in (normal)--0.0009; Plug-in(Epanech.)--0.002. this is the condition: N=1010 data

[R] Table/Frame - output

2012-07-17 Thread jcrosbie
I would like to output a nicely formatted data frame to a bitmap. Is this possible in R? -- View this message in context: http://r.789695.n4.nabble.com/Table-Frame-output-tp4636790.html Sent from the R help mailing list archive at Nabble.com. __ R-

[R] Need Help in a Combinatorial Optimzation Problem

2012-07-17 Thread Chandramouli Banerjee
Dear Community, I have a problem I am trying to code in R. Suppose there are 7 products and each have a ROI value attached to it. There are 400 representatives who calls 150,000 customers with these product detailing and achieve sales through the calls. There is a cost per call and revenue earned

Re: [R] Imposing more than one condition to if

2012-07-17 Thread Santiago Guallar
Thank for your time, Rui.   Now,  I get this error message: Error en rbind(deparse.level, ...) :   numbers of columns of arguments do not match Apparently, some columns have missing values and  rbind doesn't work. I tried: require(plyr) do.call(rbind.fill, by(z, z$date, f))   Then the code runs t

[R] Maximum Likelihood estimation of KB distribution

2012-07-17 Thread chamilka
Hi, The following distribution is known as Kumaraswamy binomial Distribution. http://r.789695.n4.nabble.com/file/n4636782/kb.png For a given data I need to estimate the paramters (alpha and beta) of this distribution(Known as Kumaraswamy binomial Distribution, A Binomial Like Distribution). For t

Re: [R] NA instead of time stamp

2012-07-17 Thread Rui Barradas
Hello, Print DateTime, and see what's wrong. When you paste(), you use the order ymd HM with space as separator but when you try to convert to POSIXct you pass a wrong format, not the one created by paste(). Solution: as.POSIXct(DAteTime, format="%Y %m %d %H %M") Hope this helps, Rui Barra

Re: [R] Threshold Quantile Regression code CRASHES in R

2012-07-17 Thread Thomas Lumley
On Tue, Jul 17, 2012 at 2:00 AM, Christos Michalopoulos wrote: > > > > > I am working on a two stage threshold quantile regression model in R, and my > aim is to estimate the threshold of the reduced-form equation (call it > rhohat), and the threshold of the structural equation (call it qhat), i

Re: [R] aligning image with bar plot in the same plot

2012-07-17 Thread Luís F
Dear Uwe, Dear List, This is exactly it. I knew there had to be an easier way. And I had even looked up in par for it! Knowledge is a beautiful thing; thank you so much. > On Tue, Jul 17, 2012 at 4:28 PM, Uwe Ligges > wrote: > > Insert > > par(yaxs="i") > > after you are finsihed with the image.

Re: [R] Power analysis for Cox regression with a time-varying covariate

2012-07-17 Thread Marc Schwartz
Hi Greg and Paul, I had initially contemplated a solution similar to Greg's, which is simulation. However, I might just throw out, that if based upon Terry's comments, time varying covariates do not impact the power/sample size considerations for the Cox model, then Schoenfeld's 1983 article in

Re: [R] aligning image with bar plot in the same plot

2012-07-17 Thread Uwe Ligges
Insert par(yaxs="i") after you are finsihed with the image. See ?par for details what is does. Uwe Ligges On 17.07.2012 13:13, Tiago R M wrote: Dear Mailing list, I want to plot a matrix using image() and on its side I want to give information to every line of the matrix using colors. I tr

Re: [R] "duplicate couples (time-id)" Problem

2012-07-17 Thread Uwe Ligges
On 12.07.2012 17:38, Saint wrote: Hi! Would be grateful if somebody helped me understand this error message after trying to run a panel data: PanelData <- read.xls("/Users/Bahman/Desktop/Taylor rule/Data/PanelData2.xls") attach(PanelData) # Panel Data regresson for all countrys. Answer <-

Re: [R] problem with installing R pacakges

2012-07-17 Thread Uwe Ligges
On 16.07.2012 14:45, Kishor Tappita wrote: Dear R- Users, I am unable to install R packages over the internet. Below is my session information. My guess is that this may be a proxy issue. I have set the http_proxy_user : my user id(network id) : password (machine password) . Maybe not corre

Re: [R] Imposing more than one condition to if

2012-07-17 Thread Santiago Guallar
Thank for your time, Rui.   Now, I get this error message: Error en rbind(deparse.level, ...) : numbers of columns of arguments do not match   Apparently, some columns have missing values and rbind doesn't work. I tried: require(plyr) do.call(rbind.fill, by(z, z$date, f))   Then the code runs thro

Re: [R] Warning message with read.csv.sql

2012-07-17 Thread Uwe Ligges
On 13.07.2012 14:00, Gabor Grothendieck wrote: On Thu, Jul 12, 2012 at 8:17 AM, Bharat Warule wrote: Hello, I am using read.csv.sql first time for reading the large data file.If I am ran this code that showns warning “closing unused connection”. Is it I am missing any argument from my comma

Re: [R] How to use a text in an object of class character position to create a vector with the text as name

2012-07-17 Thread Sarah Goslee
On Tue, Jul 17, 2012 at 2:23 PM, R. Michael Weylandt wrote: > On Tue, Jul 17, 2012 at 10:55 AM, Sarah Goslee wrote: >> In general, you use assign() to do that, but having object names >> containing spaces should be avoided. >> >>> mytext <- "Experiment name : CONTROL DB AD_1" >>> mytext >> [1] "E

Re: [R] R2WinBUGS

2012-07-17 Thread Uwe Ligges
On 17.07.2012 19:58, Michael Weylandt wrote: Reproducible code? The error seems to be rather clear. Also, this seems more of a BUGS question than an R question. Indeed, the reproducible code is somthing for a BUGS mailing list. just a guess: The typical row vs. column confusion in BUGS. b

Re: [R] How to use a text in an object of class character position to create a vector with the text as name

2012-07-17 Thread R. Michael Weylandt
On Tue, Jul 17, 2012 at 10:55 AM, Sarah Goslee wrote: > In general, you use assign() to do that, but having object names > containing spaces should be avoided. > >> mytext <- "Experiment name : CONTROL DB AD_1" >> mytext > [1] "Experiment name : CONTROL DB AD_1" >> mytext <- sub("Experiment name :

Re: [R] R2WinBUGS

2012-07-17 Thread Michael Weylandt
Reproducible code? The error seems to be rather clear. Also, this seems more of a BUGS question than an R question. Michael On Jul 17, 2012, at 11:06 AM, PRAGYA SUR wrote: > Dear R users, >Can anyone tell me why I might get the error message > "the array index is greater t

Re: [R] R CMD build/check on Windows 7 -- Please ignore

2012-07-17 Thread Bert Gunter
I will repost on R-devel. -- Bert On Tue, Jul 17, 2012 at 10:32 AM, Prof Brian Ripley wrote: > On 17/07/2012 18:20, Bert Gunter wrote: > >> Folks: >> >> sessionInfo() >> R version 2.15.0 (2012-03-30) >> Platform: i386-pc-mingw32/i386 (32-bit) >> >> locale: >> [1] LC_COLLATE=English_United States

Re: [R] NA instead of time stamp

2012-07-17 Thread arun
Hello, I think there is some mistake in the format. Try this: dat1<-data.frame(Year=rep(2009,2),Month=rep(10,2),Day=rep(5,2),hour=rep(0,2),minute=c(0,15),second=c(11.288,11.258)) ###Your code  DateTime<-with(dat1,paste(Year,Month,Day,hour,minute)) DateTime #[1] "2009 10 5 0 0"  "2009 10 5 0

Re: [R] comparing three vectors

2012-07-17 Thread arun
Hi, Try this: dat1<-data.frame(a,b,c) dat1[a<=c& b>c,"abc_check"]<-TRUE > dat1    a   b  c abc_check 1 10 100 50  TRUE 2 20 200 60  TRUE 3 30 300 70  TRUE #or dat1<-within(dat1,{abc_check<-ifelse(a<=c & b>c,"TRUE","FALSE")})  dat1    a   b  c abc_check 1 10 100 50  TRUE 2 20 200

[R] Nonparametric correlation with covariate

2012-07-17 Thread wnjiang
I am hoping to run a non-parametric correlation with a covariate. Unfortunately, for the two correlation I am running, one is not normally distributed and the other is categorical data. Therefore, I cannot use partial correlation for these two analysis. Any help would be greatly appreciated! Thank

Re: [R] R CMD build/check on Windows 7

2012-07-17 Thread Prof Brian Ripley
On 17/07/2012 18:20, Bert Gunter wrote: Folks: sessionInfo() R version 2.15.0 (2012-03-30) Platform: i386-pc-mingw32/i386 (32-bit) locale: [1] LC_COLLATE=English_United States.1252 [2] LC_CTYPE=English_United States.1252 [3] LC_MONETARY=English_United States.1252 [4] LC_NUMERIC=C [5] LC_TIME=En

Re: [R] Power analysis for Cox regression with a time-varying covariate

2012-07-17 Thread Greg Snow
One quick (though probably not canned) approach to get a feel for what an analysis might be like is to analyze a sample data set (from the survival package, a textbook, or a past analysis). Choose something that has some similarity to the planned study. Now look at the widths of the confidence in

Re: [R] NA instead of time stamp

2012-07-17 Thread John Kane
I think that you need to supply some data with your question. Use dput() to output your data or a subset of it and paste the output into the email See ?dput for more information. Probably a subset of the data would be sufficient. Something like dput(head(localRaw, 50) should be fine. John

[R] R CMD build/check on Windows 7

2012-07-17 Thread Bert Gunter
Folks: sessionInfo() R version 2.15.0 (2012-03-30) Platform: i386-pc-mingw32/i386 (32-bit) locale: [1] LC_COLLATE=English_United States.1252 [2] LC_CTYPE=English_United States.1252 [3] LC_MONETARY=English_United States.1252 [4] LC_NUMERIC=C [5] LC_TIME=English_United States.1252 attached base pa

Re: [R] Script help: Determining Time Difference between two data points.

2012-07-17 Thread William Dunlap
Does this do what you want? > firstInRun <- function(x) c(TRUE, x[-1] != x[-length(x)]) > lastInRun <- function(x) c(x[-1] != x[-length(x)], TRUE) > f <- function(data, condition) { + with(data, data.frame(startDate = Date[firstInRun(condition)], + endDate =

Re: [R] histogram of time-stamp data

2012-07-17 Thread e-letter
On 17/07/2012, Rui Barradas wrote: > Hello, > > That's not the error I've had. You must be aware that read.table creates > a data.frame and therefore the object 'timestamps' is NOT holding time > stamps, it's holding a vector, 'V1', of time stamps. > Was not aware of the significance of the data

Re: [R] Stats question: Comparison of the same individuals during two exposure times

2012-07-17 Thread Bert Gunter
I would STRONGLY recommend that you talk to your local statistician. Further: 1. R-help is not a statistical consulting forum 2. Remote statistical consulting is very risky due to the inherent difficulty in communicating all essential context of the problem and data. You have been warned! -- Be

[R] R2WinBUGS

2012-07-17 Thread PRAGYA SUR
Dear R users, Can anyone tell me why I might get the error message "the array index is greater than the upper bound for t" in WinBUGS ? t is a vector I have defined. I have checked repeatedly that the array index for t does match with the upper bound till which the loop is run.

Re: [R] {Link Suspeito} Re: variable (column) in a data frame

2012-07-17 Thread Paulo Barata
Dear Bert and Sarah, Thank you very much for your clarifications on this matter. I will have to study more closely the way extracting subsets of data structures is performed, and I will change my programming habits accordingly. Best regards, Paulo Barata ---

[R] Script help: Determining Time Difference between two data points.

2012-07-17 Thread APOCooter
I have the following data (a subset of the real data set): structure(list(Date = structure(c(1209625080, 1209641460, 1209652500, 1209676800, 1209682860, 1209692100, 1209706980, 1209722580, 1209726300, 1209739620, 1209762780, 1209765720, 1209770520, 1209791040, 1209812580, 1209829920, 1209837180

[R] aligning image with bar plot in the same plot

2012-07-17 Thread Tiago R M
Dear Mailing list, I want to plot a matrix using image() and on its side I want to give information to every line of the matrix using colors. I tried to use barplot, but cannot align the two plots. Code below. I succeed in doing what I want using another image() plot, but was wondering whether the

[R] bestglm - number of variables

2012-07-17 Thread pieniu
Hello, I have a question concerning the "bestglm" procedure (function that finds the best subset of explanatory variables for the variable we want to model by checking all possible models), available in the package "bestglm". When I use the function for a database that has over 45 variables (that

[R] complexity of operations in R

2012-07-17 Thread Johan Henriksson
Hello! I am optimizing my code in R and for this I need to know a bit more about the internals. It would help tremendously if someone could link me to a page with O()-complexities of all the operations. In this particular case, I need something like a linked list with O(1) insertLast/First ability

[R] Stats question: Comparison of the same individuals during two exposure times

2012-07-17 Thread natalie.vanzuydam
Hi, I'm hoping that someone will be able to help. I would like to compare how covariates associate with the risk of a binary outcome during two periods. Period 1 will be non-exposure to a treatment and period 2 will be exposure to a treatment. The same individuals will be examined in each group

[R] Threshold Quantile Regression code CRASHES in R

2012-07-17 Thread Christos Michalopoulos
I am working on a two stage threshold quantile regression model in R, and my aim is to estimate the threshold of the reduced-form equation (call it rhohat), and the threshold of the structural equation (call it qhat), in two stages. On the first stage, i estimate rhohat by quantile regressio

Re: [R] Confidence interval for Support Vector Regression

2012-07-17 Thread João Oliveirinha
Have you found a solution for this? I am also trying to find a way to retrieve the confidence intervals for the predictions. Best regards, João Oliveirinha On Sunday, October 30, 2011 7:04:03 PM UTC, Muhammed Akbulut wrote: > > Hi, > > Is it possible to calculate confidence intervals for suppor

Re: [R] TRUE/FALSE

2012-07-17 Thread Sarah Goslee
What's pos? What's o? What is your loop looping over? Where's your reproducible example provided using dput()? And more generally, have you read R FAQ 7.31 and the posting guide? Most likely either o is wrong, or there are NA values in pos, but we have no way to diagnose that. Sarah On Tue, Jul

Re: [R] How to use a text in an object of class character position to create a vector with the text as name

2012-07-17 Thread Sarah Goslee
In general, you use assign() to do that, but having object names containing spaces should be avoided. > mytext <- "Experiment name : CONTROL DB AD_1" > mytext [1] "Experiment name : CONTROL DB AD_1" > mytext <- sub("Experiment name : ", "", mytext) > mytext [1] "CONTROL DB AD_1" > > assign(mytext,

[R] simulating survival data according to covariate values

2012-07-17 Thread Andres LaCortadora
Hi, I'd like to simulate survival times according to continuous covariate values. Suppose we have a continuos covariate whose value of zero corresponds to a mean survival time of 180 days and whose value of 0.5 corresponds to a mean survival time of 240 days. How can I use this information to sim

[R] Building a web risk calculator based on Cox PH--definitive method for calculating probability?

2012-07-17 Thread vokey588
Hello all, I am a medical student and as a capstone for my summer research project I am going to create a simple online web "calculator" for users to input their relevant data, and a probability of relapse within 5 years will be computed and returned based on the Cox PH model I have developed. The

Re: [R] how to create table with file link in Rd File

2012-07-17 Thread Jessica Streicher
Yepp, that makes much more sense, look at Eiks post for an answer. I'm terribly sorry, i confused Rd with RData. On 17.07.2012, at 15:18, Jessica Streicher wrote: > Oh, i think i get it now, you're talking about formatting a table in a > documentation file? > > On 17.07.2012, at 14:45, purus

[R] about dpik

2012-07-17 Thread chester123
Thanks in advance here. I use dpik() function to calculate the bandwidth h. Following is the related code: h<-dpik(x,scalest="minim",level=2L,kernel="normal",canonical=FALSE,gridsize=401L,range.x=range(x),truncate=TRUE) But there is warning messages: 1: In bkfe(gcounts, 6L, alpha, range.x = c(sa

Re: [R] comparing three vectors

2012-07-17 Thread andrija djurovic
Hi. Try this: a<=c & c wrote: > Hi > > I 've a data > > a=c(10,20,30) > b=c(100,200,300) > c=c(50,60,70) > > I want to compare a[1]<=c[1] > How to compare for all the records > > - > Thanks in Advance > Arun > -- > View this message in context: > http://r.789695.n4.nabble.com/comparin

[R] TRUE/FALSE

2012-07-17 Thread cm
Any reason I'd get an error like this? Error in if (round(pos[o + 1]) == (pos[o + 1] - 0.4)) { : missing value where TRUE/FALSE needed but when i do it individually, out of the for loop, > (round(pos[o+1])==(pos[o+1]-.4) ) 65 TRUE -- View this message in context: http://r.789695.n4.na

[R] How to use a text in an object of class character position to create a vector with the text as name

2012-07-17 Thread benji
Hello, >titletool<-read.csv("TotalCSVData.csv",header=FALSE,sep=",") > class(titletool) [1] "data.frame" >titletool[1,1] [1] Experiment name : CONTROL DB AD_1 >t<-titletootl[1,1] >t [1] Experiment name : CONTROL DB AD_1 >class(t) [1] "character" now i want to create an object (vector) with th

[R] comparing three vectors

2012-07-17 Thread arunkumar1111
Hi I 've a data a=c(10,20,30) b=c(100,200,300) c=c(50,60,70) I want to compare a[1]<=c[1]http://r.789695.n4.nabble.com/comparing-three-vectors-tp4636728.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing lis

Re: [R] variable (column) in a data frame

2012-07-17 Thread Bert Gunter
Inline below. -- Bert On Tue, Jul 17, 2012 at 7:40 AM, Paulo Barata wrote: > > Dear Frans and Peter, > > Yes, the notation df[,'var'] is able to catch a non-existent > variable var inside a data frame df. But the notation df$var > isn't. > > So we have this situation, where two different notatio

Re: [R] variable (column) in a data frame

2012-07-17 Thread Sarah Goslee
Hi, On Tue, Jul 17, 2012 at 10:40 AM, Paulo Barata wrote: > > Dear Frans and Peter, > > Yes, the notation df[,'var'] is able to catch a non-existent > variable var inside a data frame df. But the notation df$var > isn't. > > So we have this situation, where two different notations, which > (as fa

[R] NA instead of time stamp

2012-07-17 Thread Yolande Tra
I was wondering why I get instead of the timestamp in the following. Thanks. > dataDir <- file.path(wd) > localRaw <- read.csv(file.path(dataDir,"LOCAL.csv"), as.is=T,stringsAsFactors = FALSE) > localRaw[1:2,] Year Month Day hour minute second Temp1mab Temp7mab Temp14mab Salinity1mab 1 2009

Re: [R] Cost Effectiveness Example

2012-07-17 Thread Marc Schwartz
On Jul 16, 2012, at 6:55 PM, Noah Silverman wrote: > Hello, > > I'm tasked with putting together a cost effectiveness analysis on a proposed > medical treatment. > > The "standard" suggested by someone is an expensive commercial package names > "TreeAge Pro" which looks like its just a fancy

Re: [R] variable (column) in a data frame

2012-07-17 Thread Paulo Barata
Dear Frans and Peter, Yes, the notation df[,'var'] is able to catch a non-existent variable var inside a data frame df. But the notation df$var isn't. So we have this situation, where two different notations, which (as far as I understand) perform the same action, have different kinds of respon

Re: [R] how to create table with file link in Rd File

2012-07-17 Thread purushothaman
Yes your right , pls tell how do format table in Rd files Thanks B.Purushothama -- View this message in context: http://r.789695.n4.nabble.com/how-to-create-table-with-file-link-in-Rd-File-tp4636740p4636747.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] how to create table with file link in Rd File

2012-07-17 Thread Jessica Streicher
Oh, i think i get it now, you're talking about formatting a table in a documentation file? On 17.07.2012, at 14:45, purushothaman wrote: > Hi, > > i need to create table like this > > -

Re: [R] how to create table with file link in Rd File

2012-07-17 Thread Jessica Streicher
Try again please, so you have a table/dataframe or some such with 4(?) columns: module_name, class_name, function_name and function_description I guess under the second line shall be an example of data in the table, but i cannot see what belongs to what column. If you have an example table alre

Re: [R] how to create table with file link in Rd File

2012-07-17 Thread Eik Vettorazzi
Hi, I think \tabular does what you want, see see http://cran.r-project.org/doc/manuals/R-exts.html#Lists-and-tables hth. Am 17.07.2012 14:45, schrieb purushothaman: > Hi, > > i need to create table like this > > ---

Re: [R] how to create table with file link in Rd File

2012-07-17 Thread purushothaman
Hi, i need to create table like this --- module name class namefunction name

Re: [R] how to create table with file link in Rd File

2012-07-17 Thread Jessica Streicher
I think you need to elaborate a bit. At least I get no idea of what you want from that one sentence. On 17.07.2012, at 13:44, purushothaman wrote: > Hi > > how to create table with file link in Rd File > > Thanks > B.Purushothaman > > -- > View this message in context: > http://r.789695.n4

  1   2   >