Re: [R] selecting data from table with timestamp

2011-05-12 Thread Pablo Rosado
Thank you Don so much, It was very helpful and it worked from the first try. Thanks for the extra comments on my script. On Wed, May 11, 2011 at 4:41 PM, MacQueen, Don wrote: > Try something similar to this: > > ## unchanged > full <- read.table("March_15.dat", sep=",",row.names=NULL, > as.is=

Re: [R] Uploading CSV file into R

2011-05-12 Thread peter dalgaard
On May 13, 2011, at 05:57 , Me wrote: > Sorry if I don't know all the vocabulary. I'm taking a research methods class > that uses R, but I'm a journalism major, so I'm not very good with a lot of > computer jargon. > > The read.csv operator didn't work. I got the following error message: > Error

Re: [R] Help with "apply"

2011-05-12 Thread Berend Hasselman
M.Ribeiro wrote: > > Ok, I am sorry, I was building a reproducible example to post here and I > made a mistake. Th second loop (in the variable k) updates ycorr. > Therefore, it would be > > ycorr <- rnorm(10) > Nindiv <- 10 > x <-matrix(sample(c(0:2),50,re = T),10) > gtemp <- rnorm(10) > for (i

Re: [R] Help with "apply"

2011-05-12 Thread M.Ribeiro
Ok, I am sorry, I was building a reproducible example to post here and I made a mistake. Th second loop (in the variable k) updates ycorr. Therefore, it would be ycorr <- rnorm(10) Nindiv <- 10 x <-matrix(sample(c(0:2),50,re = T),10) gtemp <- rnorm(10) for (i in 1:Nindiv) { for (k in 1:nco

Re: [R] Uploading CSV file into R

2011-05-12 Thread Me
Sorry if I don't know all the vocabulary. I'm taking a research methods class that uses R, but I'm a journalism major, so I'm not very good with a lot of computer jargon. The read.csv operator didn't work. I got the following error message: Error in file(file, "rt") : cannot open the connection In

Re: [R] strength of seasonal component

2011-05-12 Thread Arun Kumar Saha
Answering question as in " http://r.789695.n4.nabble.com/strength-of-seasonal-component-td3517033.html ." Possibly your code "MASS::rlm(mean price ~ month)" will result in Spurious regression; you would make wrong impression of your estimated beta coef. as in presence of the spurious regression th

Re: [R] can't run rjags package in R project

2011-05-12 Thread Prof Brian Ripley
On Thu, 12 May 2011, besbesmany wrote: i've windows 7 64 bit operating system i run latest jags backage 2.2 i make set enviroment variable for JAGS_home because the rjags in r program couldn't see the JAGS sw now the error is the following: Error : .onLoad failed in loadNamespace() for 'rjags',

Re: [R] Help with "apply"

2011-05-12 Thread Dennis Murphy
Hi: Are you *sure* that's what you want to do? > y - x[,5] * gtemp[5] [1] 0.10116205 2.46220119 3.04966544 0.56074569 -1.14872521 -0.89275228 [7] 3.52161381 0.64880894 0.70167063 -0.06120996 > identical(as.vector(ycorr), y - x[,5] * gtemp[5]) [1] TRUE Perhaps you ought to explain what y

[R] Embedding R's math expressions fonts for graphics generated by pdf() and postscript()

2011-05-12 Thread Vinh Nguyen
Dear list, First, I am not writing to ask about embedding Computer Modern font in graphics produced by R. I am generating plots to be saved using pdf() and postscript() in R, and I make use of some math expressions that are provided by R, namely, some greek letters. My question is, do I need to

[R] get adjusted means using the effects package

2011-05-12 Thread Xu Jun
Dear R experts, I am trying to use John Fox's effects package to conduct some post-estimation analysis. I think it is a great package for graphing predictions after GLM type models. However, I am having problems figuring out how to produce an adjusted mean. For example, using the following two

Re: [R] Saving misclassified records into dataframe within a loop

2011-05-12 Thread David Winsemius
On May 12, 2011, at 6:49 PM, John Dennison wrote: It is little ugly i agree but it is acting as it should. I am trying to capture the cases where the model produced a false positive but only for one of the variables. ie where the model predicts "present" but the case is "absent". I know th

Re: [R] Installing a Package tar.gz in windows

2011-05-12 Thread Duncan Murdoch
On 12/05/2011 7:44 PM, felipe beckedorff wrote: Hello I have downloaded the spp_1.10.tar.gz and it contains compiled code. I installed the Rtools; and I tried to install the package (spp_1.10.tar.gz) but it not worked bellow it is the error message. Coul

Re: [R] Exporting interactive 3D plots with axes and labels

2011-05-12 Thread Duncan Murdoch
On 12/05/2011 4:47 PM, van Rijn, Peter wrote: Hi, I have a question about exporting interactive 3D plots. I use the following code to plot a contour of a trivariate normal distribution: library(mvtnorm) library(rgl) library(misc3d) n=25 x=seq(-3,3,length=n) X=cbind(rep(x,each=n**2),rep(rep(x,

Re: [R] about vector to the power of a decimal

2011-05-12 Thread Phil Spector
Please take a look at FAQ 7.33 (http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-are-powers-of-negative-numbers-wrong_003f) Basically, what you're really calculating is -(2^2.1) [1] -4.287094 You can't raise a negative number to a fractional power, unless you specify it as a complex number

[R] Installing a Package tar.gz in windows

2011-05-12 Thread felipe beckedorff
Hello I have downloaded the spp_1.10.tar.gz and it contains compiled code. I installed the Rtools ; and I tried to install the package (spp_1.10.tar.gz) but it not worked bellow it is the error message. Could somebody please help me with this. Thank you

[R] about vector to the power of a decimal

2011-05-12 Thread 张静思
Hi why I can't do this? m<-c(1,-2,3) m^2.1 with a negative number in it ,but I can do this to a single negative number like -2^2.1~ Thank you ~ JIngsi [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.eth

[R] can't run rjags package in R project

2011-05-12 Thread besbesmany
i've windows 7 64 bit operating system i run latest jags backage 2.2 i make set enviroment variable for JAGS_home because the rjags in r program couldn't see the JAGS sw now the error is the following: Error : .onLoad failed in loadNamespace() for 'rjags', details: call: inDL(x, as.logical(lo

Re: [R] Reordering inputs

2011-05-12 Thread Steven Kennedy
On Fri, May 13, 2011 at 1:31 AM, Dat Mai wrote: > Yes, but I want to make it so that 2 different square matrices to both have > the same order for the x and y axis while, at the same time, the x and y > axis having variables in the same order as well: > >   a   b   c d   e 

[R] Can ROC be used as a metric for optimal model selection for randomForest?

2011-05-12 Thread Jing Liu
Dear all, I am using the "caret" Package for predictors selection with a randomForest model. The following is the train function: rfFit<- train(x=trainRatios, y=trainClass, method="rf", importance = TRUE, do.trace = 100, keep.inbag = TRUE, tuneGrid = grid, trControl=bootControl, scale =

Re: [R] Saving misclassified records into dataframe within a loop

2011-05-12 Thread William Dunlap
Your question concerned how to return data from a function. It looks like you are using the following idiom to save the data a function generates: f <- function() { result <- ... some calculations ... save(result, file="result.Rdata") } load("result.Rdata") ... now you will find a

Re: [R] Exporting interactive 3D plots with axes and labels

2011-05-12 Thread Remko Duursma
Does ?snapshot3d not do what you want? Or what do you mean by 'export' ? remko - Remko Duursma Research Lecturer Hawkesbury Institute for the Environment University of Western Sydney Hawkesbury Campus, Richmond Mobile: +61 (0)422 096908 www.r

Re: [R] Scale time series in a way that 90% of the data is in the -0.-9/ +0.9 range

2011-05-12 Thread Jerome Asselin
On Thu, 2011-05-12 at 06:40 -0700, Mr.Q wrote: > Hello, > > How can i scale my time series in a way that 90% of the data is in the > -0.-9/ +0.9 range? > I have two methods to suggest. One that uses the ranks to scale, hence is nonparametric and will work with any data distribution. The other u

Re: [R] Saving misclassified records into dataframe within a loop

2011-05-12 Thread John Dennison
It is little ugly i agree but it is acting as it should. I am trying to capture the cases where the model produced a false positive but only for one of the variables. ie where the model predicts "present" but the case is "absent". I know this is only half of the misclassifications, but the inverse

Re: [R] Saving misclassified records into dataframe within a loop

2011-05-12 Thread David Winsemius
On May 12, 2011, at 6:26 PM, John Dennison wrote: My apologies. I have transgressed the first law of posting, test your code. here is an updated set this should run: library(rpart) # grow tree fit <- rpart(Kyphosis ~ Age + Number + Start, method="class", data=kyphosis) #predict prediction<

Re: [R] Saving misclassified records into dataframe within a loop

2011-05-12 Thread John Dennison
My apologies. I have transgressed the first law of posting, test your code. here is an updated set this should run: library(rpart) # grow tree fit <- rpart(Kyphosis ~ Age + Number + Start, method="class", data=kyphosis) #predict prediction<-predict(fit, kyphosis) #create output data.frame resul

Re: [R] Problem with constrained optimization with maxBFGS

2011-05-12 Thread Prof. John C Nash
Is this a homework problem in finding the largest eigensolution of W? If not, I'd be trying to maximize (D' W D)/ (D' D) using (n-1) values of D and setting one value to 1 -- hopefully a value that is not going to be zero. JN > > Date: Wed, 11 May 2011 17:28:54 -0300 > From: Leonardo Monaste

Re: [R] Row names and matrixs

2011-05-12 Thread jlemaitre
Nielsen, The numbers in the brackets reference a component of a matrix/data frame/vector. So if you have: > x <- c(1:10) # a vector of integers in sequence from 1-10 > x[3] # the third component of x [1] 3 For 2-way matrices or data frames, the formatting is [row,column]. So, for a 10 x 10 matrix

[R] Help with "apply"

2011-05-12 Thread M.Ribeiro
Hello R gurus, I have a simple routine using for loops that i was just trying to make it faster y <- rnorm(10) Nindiv <- 10 x <-matrix(sample(c(0:2),50,re = T),10) gtemp <- rnorm(10) ycorr <- array(0,c(Nindiv,1)) for (i in 1:Nindiv) { for (k in 1:ncol(x)) { ycorr[i] <- y[i

Re: [R] pass character vector in instrument field of get.hist.quote function

2011-05-12 Thread MatAra
Thanks a lot for your reply Jim. I want to be able to run flex(xx-xx-,xx-xx-) at multiple date ranges, but couldn't make it work because I wasn't using the correct syntax. I will give it a try and post my findings (not too spectacular, of course). Thanks again, Mateo -- View this mes

[R] Exporting interactive 3D plots with axes and labels

2011-05-12 Thread van Rijn, Peter
Hi, I have a question about exporting interactive 3D plots. I use the following code to plot a contour of a trivariate normal distribution: library(mvtnorm) library(rgl) library(misc3d) n=25 x=seq(-3,3,length=n) X=cbind(rep(x,each=n**2),rep(rep(x,each=n),n),rep(x,n**2)) p=array(dmvnorm(X,sigma=

Re: [R] Saving misclassified records into dataframe within a loop

2011-05-12 Thread David Winsemius
On May 12, 2011, at 5:41 PM, John Dennison wrote: Having poked the problem a couple more times it appears my issue is that the object i save within the loop is not available after the function ends. I have no idea why it is acting in this manner. library(rpart) # grow tree fit <- rpart(K

[R] R development master class: SF, June 8-9

2011-05-12 Thread Hadley Wickham
Hi all, I hope you don't mind the slightly off topic email, but I'm going to be teaching an R development master class in San Francisco on June 8-9.  The basic idea of the class is to help you write better code, focused on the mantra of "do not repeat yourself". In day one you will learn powerful

Re: [R] Saving misclassified records into dataframe within a loop

2011-05-12 Thread John Dennison
Having poked the problem a couple more times it appears my issue is that the object i save within the loop is not available after the function ends. I have no idea why it is acting in this manner. library(rpart) # grow tree fit <- rpart(Kyphosis ~ Age + Number + Start, method="class", data=kyph

Re: [R] assigning creating missing rows and values

2011-05-12 Thread Adele_Thompson
I am still working on the weights problem. If the animals do not eat (like after sunset), then no new feed weight will be calculated and no new row will be entered. Thus, if I just use the previous value, it should be correct for how much cumulative feed was eaten that day up to that point. I wi

Re: [R] assigning creating missing rows and values

2011-05-12 Thread Bert Gunter
... But beware: Last observation carried forward is a widely used but notoriously bad (biased) way to impute missing values; and, of course, inference based on such single imputation is bogus (how bogus depends on how much imputation, among other things, of course). Unfortunately, dealing with suc

Re: [R] assigning creating missing rows and values

2011-05-12 Thread David Winsemius
On May 12, 2011, at 4:33 PM, Schatzi wrote: I have a dataset where I have missing times (11:00 and 16:00). I would like the outputs to include the missing time so that the final time vector looks like "realt" and has the previous time's value. Ex. If meas at time 15:30 is 0.45, then the m

Re: [R] Survival Rate Estimates

2011-05-12 Thread David Winsemius
On May 12, 2011, at 2:19 PM, David Winsemius wrote: On May 12, 2011, at 12:40 PM, Brian McLoone wrote: Dear List, Is there an automated way to use the survival package to generate survival rate estimates and their standard errors? To be clear, *not *the survivorship estimates (which are

[R] assigning creating missing rows and values

2011-05-12 Thread Schatzi
I have a dataset where I have missing times (11:00 and 16:00). I would like the outputs to include the missing time so that the final time vector looks like "realt" and has the previous time's value. Ex. If meas at time 15:30 is 0.45, then the meas for time 16:00 will also be 0.45. meas are the mea

[R] Mixed Ordinal logistic regression: marginal probabilities and standard errors for the marginal probabilities

2011-05-12 Thread Ma Ya
Dear R-list helpers: I am trying to run an ordinal logistic regression using lmer function(I think that is the correct function, although I have test it out yet), it is going to be a mixed model with second level as random. Instead the regular estimate results, I need to get the marginal probabili

Re: [R] foreach(): how to do calculations "between" two foreach loops?

2011-05-12 Thread Steve Lianoglou
Hi, On Wed, May 11, 2011 at 5:44 PM, Marius Hofert wrote: > Dear expeRts, > > is it possible to carry out calculations between different foreach() calls? > As for nested loops, you want to carry out calcuations not depending on the > inner > loop only once and not for each iteration of the inner

[R] DCC-GARCH model and AR(1)-GARCH(1,1) regression model

2011-05-12 Thread Marcin P?�ciennik
Hello, I have a rather complex problem... I will have to explain everything in detail because I cannot solve it by myself...i just ran out of ideas. So here is what I want to do: I take quotes of two indices - S&P500 and DJ. And my first aim is to estimate coefficients of the DCC-GARCH model for th

Re: [R] Assistance R

2011-05-12 Thread John Kane
As Alexander Engelhardt says we need more information/ Please give us the code you are using and a sample of the data. However one thing you might want to do is check that the seperetor is for the data. You may be reading something like tab delimited data when you think it is comma delimited.

Re: [R] Assistance R

2011-05-12 Thread Alexander Engelhardt
Am 12.05.2011 20:14, schrieb Carlosmagno: Assistance R, When trying to insert data in txt format already set up R pr is the following error: "Erro em scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, : linha 1 não tinha 10 elementos" I would like to know how to remedy this

Re: [R] extract integers from string

2011-05-12 Thread Henrique Dallazuanna
Try this: library(gsubfn) strapply(x, "\\d+", as.numeric, simplify = rbind) On Thu, May 12, 2011 at 3:06 PM, Alon Honig wrote: > I have a vector with a long list of sentences that contain integers. I > would like to extract the integers in a manner such that they are > separate and manipulatable

[R] Sensitivity Analysis: Morris method - argument "scale"

2011-05-12 Thread Christoph Warkotsch
Dear R-users, I have a question on the logical argument "scale" in the morris-function from the sensitivity package. Should it be set to TRUE or FALSE? Thanks, Chris [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

[R] extract integers from string

2011-05-12 Thread Alon Honig
I have a vector with a long list of sentences that contain integers. I would like to extract the integers in a manner such that they are separate and manipulatable. for example: x[i] <- "sally has 20 dollars in her pocket and 3 marbles" x[i+1] <- "30 days ago john had a 400k house" all sentences

[R] Assistance R

2011-05-12 Thread Carlosmagno
Assistance R, When trying to insert data in txt format already set up R pr is the following error: "Erro em scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, : linha 1 não tinha 10 elementos" I would like to know how to remedy this error pr I proceeded with my analysis,

[R] Read.xls in gdata

2011-05-12 Thread Bos, Roger
All, When I use gdata::read.xls to read in an excel file it seems to round the data to three decimal places and also converts the dates to factors. Does anyone know how to 1) get more precision in the numeric data and 2) how to prevent the dates from being converted to levels or factors? I trie

[R] Fw: Help with PLSR

2011-05-12 Thread Amit Patel
Hi I am attempting to use plsr which is part of the pls package in r. I amconducting analysis on datasets to identify which proteins/peptides are responsible for the variance between sample groups (Biomarker Spoting) in a multivariate fashion. I have a dataset in R called "FullDataListTra

Re: [R] problem with mediation

2011-05-12 Thread Dennis Murphy
Hi: Try this: library(sos) # install first if you don't have it already findFn('mediation') You should find at least a half dozen packages from which to choose, at least three of which appear to be devoted to mediation analysis. HTH, Dennis On Thu, May 12, 2011 at 8:56 AM, Mervi Virtanen

[R] [R-pkgs] new package 'mvmeta' to perform multivariate meta-analysis

2011-05-12 Thread Antonio.Gasparrini
Dear R Community, I am pleased to announce the release of a new package called 'mvmeta', now available on CRAN (version 0.2.0). The package mvmeta provides some functions to perform fixed and random-effects multivariate meta-analysis and meta-regression. This modelling framework is exploited

Re: [R] Survival Rate Estimates

2011-05-12 Thread David Winsemius
On May 12, 2011, at 12:40 PM, Brian McLoone wrote: Dear List, Is there an automated way to use the survival package to generate survival rate estimates and their standard errors? To be clear, *not *the survivorship estimates (which are cumulative), but the survival *rate * estimates...

Re: [R] do.call and applying na.rm=TRUE

2011-05-12 Thread Jonathan Daily
?do.call Second argument is a list of arguments to pass. Try do.call(mean, list(x, na.rm = T)) On Thu, May 12, 2011 at 1:57 PM, John Kerpel wrote: > Hi all!  I need to do something really simple using do.call. > > If I want to call the mean function inside do.call, how do I apply the > condition

[R] do.call and applying na.rm=TRUE

2011-05-12 Thread John Kerpel
Hi all! I need to do something really simple using do.call. If I want to call the mean function inside do.call, how do I apply the condition na.rm=TRUE? So, I use do.call(mean, list(x)) where x is my data. This works fine if there are no NAs. Thanks, John [[alternative HTML version d

Re: [R] Change font size in Windows

2011-05-12 Thread John Kane
I looked at that yesterday and totally missed the font settings! I'm blaming the new glasses. Thank you. I'll probably do the Rconsole change but I's nice to know about this one if I'm using R on another machine. That way I cannot mess up someone else's setup./ --- On Thu, 5/12/11, Greg Sno

Re: [R] Saving misclassified records into dataframe within a loop

2011-05-12 Thread Phil Spector
John - In your example, the misclassified observations (as defined by your predict.function) will be kyphosis[kyphosis$Kyphosis == 'absent' & prediction[,1] != 1,] so you could start from there. - Phil Spector

Re: [R] Simple 95% confidence interval for a median

2011-05-12 Thread peter dalgaard
On May 12, 2011, at 18:33 , Greg Snow wrote: > Contrary to the commonly held assumption, the Wilcoxin test does not deal > with medians in general. > > There are some specific cases/assumptions where the test/interval would apply > to the median, if I remember correctly the assumptions include

Re: [R] Change font size in Windows

2011-05-12 Thread John Kane
Definitely. I edited the one in the program files. I think i saw a ref to the home file but it did not sink in. Thanks --- On Thu, 5/12/11, Uwe Ligges wrote: > From: Uwe Ligges > Subject: Re: [R] Change font size in Windows > To: "John Kane" > Cc: "R R-help" > Received: Thursday, May 12,

Re: [R] group length

2011-05-12 Thread Jeffrey Dick
On Thu, May 12, 2011 at 10:00 AM, Ledon, Alain wrote: > sapply... > >> y1=c(1.214,1.180,1.199) >> y2=c(1.614,1.710,1.867,1.479) >> y3=c(1.361,1.270,1.375,1.299) >> y4=c(1.459,1.335) >> sapply(list(y1,y2,y3,y4), length) > [1] 3 4 4 2 > Or, if you don't want to name each object individually: > sap

[R] confint.multinom() slow?

2011-05-12 Thread Hans Ekbrand
Dear R-helpers, I'm doing a bivariate analysis with two factors, both with relatively many levels: 1. clustering, a factor with 35 levels 2. country, a factor with 24 levels n = 12,855 my.fit <- multinom(clustering ~ country, maxit=300) converges after 280 iterations. I would like to get CI:s

Re: [R] problem converting character to dates

2011-05-12 Thread Uwe Ligges
On 12.05.2011 17:40, Assu wrote: Hi all, I've searched this problem and still I can't understand my results, so here goes: I have some time series I've imported from excel with the dates in text format from excel. Data was imported with RODBC, sqlQuery() function. I have these dates: adates

Re: [R] package update

2011-05-12 Thread Dirk Eddelbuettel
On 9 May 2011 at 12:57, Uwe Ligges wrote: | | | On 08.05.2011 19:54, eric wrote: | > I tried to update my packages using update.packages() | > | > I got the following message: | > | > The downloaded packages are in | > ‘/tmp/RtmpyDYdTX/downloaded_packages’ | > Warning in install.packages(upd

Re: [R] Change font size in Windows

2011-05-12 Thread Uwe Ligges
On 12.05.2011 18:25, John Kane wrote: My day for dumb questions. How do I increase the type size in the Rgui console in Windows? (R-2.13.0, Windows 7) It looked to me that I just needed to change the font spec in Rconsole but that does not seem to be working. The R FAQ for Windows has a ref

Re: [R] Change font size in Windows

2011-05-12 Thread Greg Snow
One simple way: Run R (the gui version) Click on the Edit menu Click on the GUI Preferences item. Select the font, size, style, colors, etc. that you want. If you click on Save then these become the new default. If you click on Apply, but don't save then they will last that session but not be

[R] Survival Rate Estimates

2011-05-12 Thread Brian McLoone
Dear List, Is there an automated way to use the survival package to generate survival rate estimates and their standard errors? To be clear, *not *the survivorship estimates (which are cumulative), but the survival *rate * estimates... Thank you in advance for any help. Best, Brian [[a

Re: [R] R won't start keeps crashing

2011-05-12 Thread Bazman76
will delete it, just wanted to try and sort out the bug -- View this message in context: http://r.789695.n4.nabble.com/R-won-t-start-keeps-crashing-tp3516829p3518036.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org

Re: [R] R won't start keeps crashing

2011-05-12 Thread Bazman76
I will read the intor to R. When closing I got a pop up asking me if I wanted to save the workspace I just clicked yes? here is what I got load("C:/Documents and Settings/Hugh/My Documents/vars/vars/data") Error in readChar(con, 5L, useBytes = TRUE) : cannot open the connection In addition: Warn

Re: [R] group length

2011-05-12 Thread Ledon, Alain
sapply... > y1=c(1.214,1.180,1.199) > y2=c(1.614,1.710,1.867,1.479) > y3=c(1.361,1.270,1.375,1.299) > y4=c(1.459,1.335) > sapply(list(y1,y2,y3,y4), length) [1] 3 4 4 2 -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Asan Ramzan Se

Re: [R] group length

2011-05-12 Thread Scott Chamberlain
require(plyr) laply(list(y1, y2, y3, y4), length) Scott On Thursday, May 12, 2011 at 11:50 AM, Asan Ramzan wrote: Hi > > I have four groups > > y1=c(1.214,1.180,1.199) > y2=c(1.614,1.710,1.867,1.479) > y3=c(1.361,1.270,1.375,1.299) > y4=c(1.459,1.335) > Is there a function that can give me the

[R] group length

2011-05-12 Thread Asan Ramzan
Hi   I have four groups   y1=c(1.214,1.180,1.199) y2=c(1.614,1.710,1.867,1.479) y3=c(1.361,1.270,1.375,1.299) y4=c(1.459,1.335) Is there a function that can give me the length for each, like the made up example below?   >function(length(y1:y2) [1] 3 4 4 2 [[alternative HTML version deleted

Re: [R] log transformation and mean question

2011-05-12 Thread Ted Harding
On 12-May-11 15:15:00, 1Rnwb wrote: > I have question about log2 transformation and performing mean > on log2 data. I am doing analysis for ELISA data. the OD values > and the concentration values for the standards were log2 > transformed before performing the lm. the OD values for samples > were l

Re: [R] Simple 95% confidence interval for a median

2011-05-12 Thread Greg Snow
Contrary to the commonly held assumption, the Wilcoxin test does not deal with medians in general. There are some specific cases/assumptions where the test/interval would apply to the median, if I remember correctly the assumptions include that the population distribution is symmetric and the o

[R] Saving misclassified records into dataframe within a loop

2011-05-12 Thread John Dennison
Greetings R world, I know some version of the this question has been asked before, but i need to save the output of a loop into a data frame to eventually be written to a postgres data base with dbWriteTable. Some background. I have developed classifications models to help identify problem account

Re: [R] lm and anova

2011-05-12 Thread peter dalgaard
On May 12, 2011, at 15:30 , Paul Chatfield wrote: > anova uses sequential sums of squares (type 1), Yes. > summary adjusted sums of > squares (type 3) No. Type III SS is a considerably stranger beast. summary() looks at the s.e. of individual coefficients. For 1 DF effects, this is often eq

[R] Change font size in Windows

2011-05-12 Thread John Kane
My day for dumb questions. How do I increase the type size in the Rgui console in Windows? (R-2.13.0, Windows 7) It looked to me that I just needed to change the font spec in Rconsole but that does not seem to be working. The R FAQ for Windows has a reference in Q3.4 to changing fonts, (Q5.2),

[R] problem with mediation

2011-05-12 Thread Mervi Virtanen
Hello! I have problem with mediation analysis. I can do it with function mediate, when I have one mediator. But how I can do it if I have one independent variable and one dependent variable but 4 mediators? I have try function mediations, but it dosen't work. If I use mediate 4 times, each f

[R] log transformation and mean question

2011-05-12 Thread 1Rnwb
I have question about log2 transformation and performing mean on log2 data. I am doing analysis for ELISA data. the OD values and the concentration values for the standards were log2 transformed before performing the lm. the OD values for samples were log2 transformed and coefficients of lm were a

[R] problem converting character to dates

2011-05-12 Thread Assu
Hi all, I've searched this problem and still I can't understand my results, so here goes: I have some time series I've imported from excel with the dates in text format from excel. Data was imported with RODBC, sqlQuery() function. I have these dates: >adates [1] "01/2008" "02/2008" "03/2008"

Re: [R] separate date and time

2011-05-12 Thread Schatzi
That is wonderful. Thank you. Adele Ken Takagi wrote: > > Schatzi cargill.com> writes: > >> >> I have a combined date and time. I would like to separate them out into >> two >> columns so I can do things such as take the mean by time across all >> dates. >> >> meas<-runif(435) >> nTime<-seq(

Re: [R] R won't start keeps crashing

2011-05-12 Thread David Winsemius
On May 12, 2011, at 10:24 AM, Bazman76 wrote: http://r.789695.n4.nabble.com/file/n3517669/R_crash.jpg OK when I click on the .RData file I get the screen above. Also when I start R from the desktop icon or from select if from programs I get the same result. Why do you even have this file

Re: [R] R won't start keeps crashing

2011-05-12 Thread Jonathan Daily
I have some suggestions inline below. My biggest suggestion would be to read the help files that came with R, especially the section "Invoking R" in "An Introduction to R". On Thu, May 12, 2011 at 10:24 AM, Bazman76 wrote: > http://r.789695.n4.nabble.com/file/n3517669/R_crash.jpg > > OK when I cl

Re: [R] Simple order() data frame question.

2011-05-12 Thread John Kane
Thanks Matthew, I had data.table installed but totally forgot about it. I've only used it once or twice and, IIRC, that was last year. I remember thinking at the time that it was a very handy package but lack of need for this sort of thinglet me forget it. --- On Thu, 5/12/11, Matthew Dowle

Re: [R] separate date and time

2011-05-12 Thread KEn
Schatzi cargill.com> writes: > > I have a combined date and time. I would like to separate them out into two > columns so I can do things such as take the mean by time across all dates. > > meas<-runif(435) > nTime<-seq(1303975800, 1304757000, 1800) > nDateT<-as.POSIXct(nTime, origin="1970-01-0

Re: [R] Simple order() data frame question.

2011-05-12 Thread Matthew Dowle
With data.table, the following is routine : DT[order(a)] # ascending DT[order(-a)] # descending, if a is numeric DT[a>5,sum(z),by=c][order(-V1)] # sum of z group by c, just where a>5, then show me the largest first DT[order(-a,b)] # order by a descending then by b ascending, if a and b are

Re: [R] Errors and line numbers in scripts?

2011-05-12 Thread Duncan Murdoch
On 12/05/2011 11:02 AM, Elliot Joel Bernstein wrote: Is it possible to get R to report the line number of an error when a script is called with source()? I found the following post from 2009, but it's not clear to me if this ever made it into the release version: It does so for parse errors. I

Re: [R] (no subject)

2011-05-12 Thread Ista Zahn
Hi Fabian, You my find my discussion of "types" of SS helpful. My website has been down for some time, but you can retrieve it from http://psychology.okstate.edu/faculty/jgrice/psyc5314/SS_types.pdf among other places. Best, Ista On Thu, May 12, 2011 at 10:33 AM, Fabian wrote: > #subject: type I

[R] Errors and line numbers in scripts?

2011-05-12 Thread Elliot Joel Bernstein
Is it possible to get R to report the line number of an error when a script is called with source()? I found the following post from 2009, but it's not clear to me if this ever made it into the release version: ws wrote: >* Is there a way to have R return the line number in a script when it errors

Re: [R] R won't start keeps crashing

2011-05-12 Thread Bazman76
http://r.789695.n4.nabble.com/file/n3517669/R_crash.jpg OK when I click on the .RData file I get the screen above. Also when I start R from the desktop icon or from select if from programs I get the same result. The warning message is in focus and I can not move the focus to the GUI. When I eith

Re: [R] Question about glmnet

2011-05-12 Thread David Katz
I believe you can in this sense: use model.matrix to create X for glmnet(X,y,...). However, when dropping variables this will drop the indicators individually, not per factor, which may not be what you are looking for. Good luck, David Katz Axel Urbiz wrote: > > Hi, > > Is it possible to incl

Re: [R] package update

2011-05-12 Thread jjallaire
To run RStudio as root on Ubuntu you would just do: sudo rstudio The packages in /usr/lib/R/library are the ones that came with the base install of R. J.J. Allaire -- View this message in context: http://r.789695.n4.nabble.com/package-update-tp3507479p3517539.html Sent from the R help mailing

[R] (no subject)

2011-05-12 Thread Fabian
#subject: type III sum of squares - anova() Anova() AnovaM() #R-version: 2.12.2 #Hello everyone, #I am currently evaluating experimental data of a two factor experiment. to illustrate de my problem I will use following #dummy dataset: Factor "T1" has 3 levels ("A","B","C") and factor "T2" has

[R] Scale time series in a way that 90% of the data is in the -0.-9/ +0.9 range

2011-05-12 Thread Mr.Q
Hello, How can i scale my time series in a way that 90% of the data is in the -0.-9/ +0.9 range? My approach is to first build a clean vector without those 10% far away from the mean require(outliers) y<-rep(c(1,1,1,1,1,9),10) yc<-y ycc<-length(y)*0.1 for(j in 1:ycc) { cat("Remove",j)

[R] Simple 95% confidence interval for a median

2011-05-12 Thread Georgina Imberger
Hi! I have a data set of 86 values that are non-normally distributed (counts). The median value is 10. I want to get an estimate of the 95% confidence interval for this median value. I tried to use a one-sample Wiolcoxin test: wilcox.test(Comps,mu=10,conf.int=TRUE) and got the following outpu

Re: [R] Asking Favor For the Script of Median Filter

2011-05-12 Thread robleaf
Here is one I wrote for the raster package. It searches a raster layer for NA's and takes the median of the number of non NA adjacent cells determined by neighbor count. You could turn your matrix into a raster to make it work or change the code. Hope you find it useful, Robert neighbor.filter <-

Re: [R] lm and anova

2011-05-12 Thread Paul Chatfield
anova uses sequential sums of squares (type 1), summary adjusted sums of squares (type 3) Take for example the first line of each output. In summary this tests whether vole1 is needed ASSUMING volelag and year are already in the model (conclusion would then be: it isn't needed p=.89). Whereas in

Re: [R] Binomial

2011-05-12 Thread Sarah Sanchez
Thanks a lot sir. Regards Sarah --- On Thu, 5/12/11, Alexander Engelhardt wrote: From: Alexander Engelhardt Subject: Re: [R] Binomial To: "Sarah Sanchez" Cc: "David Winsemius" , r-help@r-project.org Date: Thursday, May 12, 2011, 12:53 PM Am 12.05.2011 13:19, schrieb Sarah Sanchez: > Dear R

Re: [R] lm and anova

2011-05-12 Thread Ista Zahn
Hi Sara, As the help page for anova.lm says, "Specifying a single object gives a sequential analysis of variance table". That most likely also the answer to your second question. The anova function can be used to compare nested models, and this provides the flexibility to test arbitrary hypothes

Re: [R] mtext text size (cex) doesn't match plot

2011-05-12 Thread Peter Ehlers
On 2011-05-12 07:16, George Locke wrote: thanks for reading the manual for me :X For a bit more reading, you could check out ?title. You could replace your mtext() calls with title(ylab='Y axis', cex.lab=1.5, line=4, font.lab=2) Peter Ehlers 2011/5/12 Prof Brian Ripley: On Wed, 11 M

Re: [R] Simple order() data frame question.

2011-05-12 Thread Ivan Calandra
I was wondering whether it would be possible to make a method for data.frame with sort(). I think it would be more intuitive than using the complex construction of df[order(df$a),] Is there any reason not to make it? Ivan Le 5/12/2011 15:40, Marc Schwartz a écrit : On May 12, 2011, at 8:09 AM

Re: [R] mtext text size (cex) doesn't match plot

2011-05-12 Thread George Locke
thanks for reading the manual for me :X 2011/5/12 Prof Brian Ripley : > On Wed, 11 May 2011, George Locke wrote: > >> Hi, >> >> I am using mtext instead of the ylab argument in some plots because i >> want to move it away from the numbers in the axis.  However, the text >> in the X axis, >> >> for

  1   2   >