Re: [R] POSIXlt error

2010-07-13 Thread Meissner, Tony (DFW)
OK, I thought I was being explicit enough, but here goes. The out of the first five rows of mu dataframe is: Time hour lev.morgan lev.lock2 lev.lock1 flow direction velocity bearingvelcat 1 2009-07-06 15:00:00 15 3.266 3.274 3.240 1710.6180.28 4.352

Re: [R] create variables with indexes

2010-07-13 Thread Jeff Newmiller
In virtually every case where people think they need gobs of similarly-named variables, what they really need are vectors or data frames. I strongly recommend reading the Introduction to R document again to learn how to create them and access individual elements and subsets of elements.Data fram

Re: [R] FYI: matrix surprise

2010-07-13 Thread Prof Brian Ripley
Better moral: read the basic documentation. You missed matrix indexing (indexing an array with a matrix subscript), and that is described in 'An Introduction to R', section 5.3 E.g. s$p <- match(s$prefix, colnames(y)) y[cbind(s$idx, s$p)] <- s$val (You are trying to use different types of in

[R] logical to numeric matrix changing dimensions

2010-07-13 Thread Felipe Bhering
example: > y=(rbind(c(TRUE,TRUE,TRUE),c( FALSE,FALSE,FALSE))) > y [,1] [,2] [,3] [1,] TRUE TRUE TRUE [2,] FALSE FALSE FALSE > as.numeric(y) [1] 1 0 1 0 1 0 I am trying to make some important matrixes become nuemric (1 or 0) but they change their dimensions.. anyone know how to easily fi

[R] Set environment name

2010-07-13 Thread thmsfuller...@gmail.com
Hello All, ?environmentName shows how to get the environment name. But I don't see how to set the name in the first place. Could you tell me where to look for the function that set the environment name? -- Tom __ R-help@r-project.org mailing list http

[R] How to define a function (with '<-') that has two arguments?

2010-07-13 Thread thmsfuller...@gmail.com
Hi All, The last line if the following code returns the error right below this paragraph. Essentially, I use the operator %:% to retrieve a variable in a nested frame. Then I want to use the same operator (with '<-') to change its value. I'm not sure if this is possible in R with %:% operator. Wo

[R] Error while connecting to Oracle using RODBC package

2010-07-13 Thread vikrant
Dear All, I want to connnect R with oracle. I am using RODBC package for this connection. Following is my code to connect library(RODBC) channel <- odbcConnect("Vikrant") I am getting following error. 1: In odbcDriverConnect("DSN=Vikrant") : [RODBC] ERROR: state NA000, code 12288, message [M

[R] logical to numeric matrix changing dimensions

2010-07-13 Thread Felipe Bhering
example: > y=(rbind(c(TRUE,TRUE,TRUE),c(FALSE,FALSE,FALSE))) > y [,1] [,2] [,3] [1,] TRUE TRUE TRUE [2,] FALSE FALSE FALSE > as.numeric(y) [1] 1 0 1 0 1 0 I am trying to make some important matrixes become nuemric (1 or 0) but they change their dimensions.. anyone know how to easily fix

Re: [R] POSIXlt error

2010-07-13 Thread Prof Brian Ripley
Check out your timezone. Did something change on that day? You omitted the time, so it is trying to make sense of "1982-01-01 00:00" According to http://en.wikipedia.org/wiki/Singapore_Standard_Time that time did not exist in that time zone (which I am guessing is the one your computer is se

[R] FYI: matrix surprise

2010-07-13 Thread Mario Valle
Some time ago someone asked for things that make R difficult to master. Here I want to record one R behavior that took me off-guard yesterday. Moral of the story: vectorialize, but don't exaggerate. Hope it helps mario ### A very simple data frame tc <- textConn

Re: [R] Converting POSIXct vales to real values

2010-07-13 Thread Prof Brian Ripley
On Wed, 14 Jul 2010, Meissner, Tony (DFW) wrote: I have a dataframe that contains time values in the form of -mm-dd hh:mm i.e. 2010-07-14 13:00. When I convert this to numeric via tvec <- as.numeric(Time) I get a number that is in seconds. So far so good. When I then divide the numeric

[R] Converting POSIXct vales to real values

2010-07-13 Thread Meissner, Tony (DFW)
I have a dataframe that contains time values in the form of -mm-dd hh:mm i.e. 2010-07-14 13:00. When I convert this to numeric via tvec <- as.numeric(Time) I get a number that is in seconds. So far so good. When I then divide the numeric value by the number of seconds in a day eg tvec/(

[R] calling a c function from R

2010-07-13 Thread Fahim Md
Hi, I am trying to call a C function, that I wrote to parse a flat file, into R. The argument that will go into this function is an input file that I need to parse and write the desired output in an output file. I used some hit and trial approach but i keep on getting the "file not found" or "seg

Re: [R] Question about food sampling analysis

2010-07-13 Thread Sarah Henderson
Greetings to all -- As always, I am grateful for the help of the R community. The generosity of other R users never ceases to impress me. Just to recap the responses I have had to this question, in case they can help anyone else down the line: Robert LaBudde suggested Applied Survey Data Analys

[R] Arrange values on a timeline

2010-07-13 Thread Ralf B
I have a set of labels arranged along a timeframe in a. Each label has a timestamp and marks a state until the next label. The dataframe a contains 5 such timestamps and 5 associated labels. This means, on a continious scale between 1-100, there are 5 markers. E.g. 'abc' marks the timestampls betwe

[R] please give us some suggestions regarding a modified PCA algo

2010-07-13 Thread Michael
Hi all, Let's say we have M x N matrix, which represents N time series, each having M observations in order of time. How do we find maximal number of linear combinations of these N time series, their mutual correlation has to be less than certain pre-specified constraints. That's to say, we woul

Re: [R] create variables with indexes

2010-07-13 Thread Greg Snow
It looks like you want to use a matrix, then you can do proper indexing. Creating the names will just lead to unnecessary complexity and confusion. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- >

[R] Seeking guidance on MLE scaling

2010-07-13 Thread David Warren
Hi all, I'm trying out R's optimization functions (nlm() and optim()) in order to obtain parameter estimates for a combination of distributions. I've got my likelihood function, and optim() is happy to provide estimates (nlm() less so), but I'm concerned that uneven parameter scaling may be

Re: [R] New R-SIG for Discrete Choice Modelling

2010-07-13 Thread Chris Chapman
To follow up: if you tried to join this SIG but couldn't, please try again. There was a configuration error but it has been corrected. The link to join is below. Cheers! -Original Message- From: John Williams [mailto:john.willi...@otago.ac.nz] Sent: Thursday, July 08, 2010 5:55 PM To:

[R] ccf function

2010-07-13 Thread Megan Moreau
Hello, I am a very new R user and not a statistician so please excuse any over explanation, I'm just trying to be as clear as possible. I have performed a cross correlation of two time series (my columns) in a single data setusing: ccf(ts(A[rows,columnX]),(A[rows,columnY]), lag=NULL, type="cor

[R] question about SVM in e1071

2010-07-13 Thread Jack Luo
Hi, I have a question about the parameter C (cost) in svm function in e1071. I thought larger C is prone to overfitting than smaller C, and hence leads to more support vectors. However, using the Wisconsin breast cancer example on the link: http://planatscher.net/svmtut/svmtut.html I found that th

Re: [R] POSIXlt error

2010-07-13 Thread Ian Seow
Oops, sorry! Here it is: R version 2.11.1 (2010-05-31) i386-pc-mingw32 locale: [1] LC_COLLATE=English_Singapore.1252 LC_CTYPE=English_Singapore.1252 LC_MONETARY=English_Singapore.1252 LC_NUMERIC=C [5] LC_TIME=English_Singapore.1252 attached base packages: [1] grDevices datasets splines graph

Re: [R] POSIXlt error

2010-07-13 Thread Erik Iverson
Do you care to share your sessionInfo() , as the Posting Guide asks? I cannot reproduce on: R version 2.11.1 (2010-05-31) i486-pc-linux-gnu On 07/13/2010 09:07 PM, Ian Seow wrote: Hi, I'm encountering a strange error in POSIXlt... anyone got a clue on this? as.POSIXlt("1982-01-01") Error i

[R] POSIXlt error

2010-07-13 Thread Ian Seow
Hi, I'm encountering a strange error in POSIXlt... anyone got a clue on this? > as.POSIXlt("1982-01-01") Error in as.POSIXlt.character("1982-01-01") : character string is not in a standard unambiguous format > as.POSIXlt("1992-01-01") [1] "1992-01-01" > as.POSIXlt("1972-01-01") [1] "1972-01-01"

[R] POSIXlt error for 1982-01-01

2010-07-13 Thread Ian Seow
Hi, I am encountering a strange error in POSIXlt... anyone got a clue? > as.POSIXlt("1982-01-01") Error in as.POSIXlt.character("1982-01-01") : character string is not in a standard unambiguous format > as.POSIXlt("1992-01-01") [1] "1992-01-01" > as.POSIXlt("1972-01-01") [1] "1972-01-01" > as.PO

Re: [R] [R-pkgs] New package "list" for analyzing listsurveyexperiments

2010-07-13 Thread Jonathan Baron
Some of us enter these things with a keyboard! (Don't know what the rest of you do.) That takes time, and command completion won't always pick out the right one immediately. On 07/13/10 18:44, Bert Gunter wrote: > Rich: > > I suspect it's a cultural relic of the "storage is scarce" era that beg

Re: [R] [R-pkgs] New package "list" for analyzing listsurveyexperiments

2010-07-13 Thread Bert Gunter
Rich: I suspect it's a cultural relic of the "storage is scarce" era that begat "C" and "R" in the first place. Cutesiness. Culture is hard to change, but I think you make a very salient point! -- Bert Bert Gunter Genentech Nonclinical Statistics > -Original Message- > From: r-help-bou

Re: [R] Rename column or row names

2010-07-13 Thread T.D. Rudolph
this isn't a whole lot different, but if x is a data.frame (and not a matrix), you could also try this: names(x)[which(names(x)=="oldname")]= "newname" -- View this message in context: http://r.789695.n4.nabble.com/Rename-column-or-row-names-tp2288122p2288183.html Sent from the R help mailing

Re: [R] create variables with indexes

2010-07-13 Thread T.D. Rudolph
Here is another way of going about it (presuming we are correct about what you are after): i=1:10 j=1:10 unlist(lapply(i, function(x) paste("X", x, j, sep="_"))) Tyler -- View this message in context: http://r.789695.n4.nabble.com/create-variables-with-indexes-tp2288119p2288171.html Sent from

[R] Write value to PHP webpage

2010-07-13 Thread Jared Stabach
I have a series of animals that are being radio-tracked. I have written some code that goes through each animal and calculates the total distance that each animal is traveling. I will need to run these data on a regular basis and want to write the result to a .php webpage file so that the page up

Re: [R] Checking for duplicate rows in data frame efficiently

2010-07-13 Thread T.D. Rudolph
Henrique is correct; entering duplicated(df) will return an index of TRUE or FALSE for every row. TRUE indicates a duplicated row. df[duplicated(df),] # shows which rows are repeated df[-duplicated(df),] # shows which rows are unique -- View this message in context: http://r.789695.n4.nabble.

Re: [R] create variables with indexes

2010-07-13 Thread Erik Iverson
Suppose I want create variables with indexes in their names, e.g., X_1_1, X_1_2, X_1_3, ..., X_1_10, X_2_1, X_2_2, X_2_3, .. X_2_10,..., X_10_1, X_10_2, ... X_10_10. It looks like I need to use 2 indexes I and J so I is looped from 1 to 10, and J is looped from 1 to 10. But I don't know how to

Re: [R] Checking for duplicate rows in data frame efficiently

2010-07-13 Thread Henrique Dallazuanna
See ?duplicated On Tue, Jul 13, 2010 at 7:42 PM, david hilton shanabrook < davidshanabr...@me.com> wrote: > I wrote something to check for duplicate rows in a data frame, but it is > too inefficient. Is there a way to do this without the nested loops? > > This code correctly indicates rows 1-7,

[R] Wilcox.test U values

2010-07-13 Thread Worik R
I have been examining the Mann-Whitney test closely. And there are two features of the R implementation that puzzles me. The test statistic is reported as "W" and depends on the order of the arguments to the function. > x <- c(1,3,5,7,9) > y <- x-1 > x [1] 1 3 5 7 9 > y [1] 0 2 4 6 8 > wilcox.t

Re: [R] create variables with indexes

2010-07-13 Thread Wenbo Mu
Maybe I misunderstand your problem. For my understanding, it's quite simple.I hope it can help. id <- vector() for(i in 1:10){ for(j in 1:10){ id<-append(id,paste("X",i,j,sep="_")) } } Wenbo Mu On Tue, Jul 13, 2010 at 5:44 PM, He, Yulei wrote: > Hi, there: >

[R] question regarding "varImpPlot" results vs. model$importance data on package "RandomForest"

2010-07-13 Thread Mike Williamson
Hi everyone, I have another "Random Forest" package question: - my (presumably incorrect) understanding of the varImpPlot is that it should plot the "% increase in MSE" and "IncNodePurity" exactly as can be found from the "importance" section of the model results. - However, th

[R] Rename column or row names

2010-07-13 Thread thmsfuller...@gmail.com
Hello All, Suppose that x is a data.frame. I want to change the colname 'oldname' to 'newname'. I have the following code. Could anybody let me know if there is any better way to change a column name? colnames(x)[grep('oldname', colnames(x))]='newname' -- Tom __

[R] Checking for duplicate rows in data frame efficiently

2010-07-13 Thread david hilton shanabrook
I wrote something to check for duplicate rows in a data frame, but it is too inefficient. Is there a way to do this without the nested loops? This code correctly indicates rows 1-7, 1-8, 2-9 and 7-8 are duplicates. > m <- matrix(c(1,1,1,1,1, 2,2,2,2,2, 6,6,6,6,6, 3,3,3,3,3, 4,4,4,4,4, > 5,5,

[R] create variables with indexes

2010-07-13 Thread He, Yulei
Hi, there: Suppose I want create variables with indexes in their names, e.g., X_1_1, X_1_2, X_1_3, ..., X_1_10, X_2_1, X_2_2, X_2_3, .. X_2_10,..., X_10_1, X_10_2, ... X_10_10. It looks like I need to use 2 indexes I and J so I is looped from 1 to 10, and J is looped from 1 to 10. But I don't

[R] A problem about the package "lme4" in R-2.11.1

2010-07-13 Thread Nai-Wei Chen
Dear all R-users, When I install the package "lme4" in R-2.11.1, and use it to run the simulation on the Linux system, it appears the following problem. Attaching package: 'lme4' The following object(s) are masked from 'package:stats':     AIC Error in names(argNew)[1] <- names(formals(new))

[R] Neural Network package AMORE and a weight decay

2010-07-13 Thread Ron Shefi
Hi, I want to use the neural network package AMORE and I don't find in the documentation the weight decay option. Could someone tell if it is possible to add a regularization parameter (also known as a weight decay) to the training method. Is it possible to alter the gradient descent rule for

Re: [R] a very particular plot

2010-07-13 Thread Ian Bentley
I've got a couple of more changes that I want to make to my plot, and I can't figure things out. Thanks for all the help. I'm using this R script library(ggplot2) library(lattice) # Generate 50 data sets of size 100 and assign them to a list object low <- 1 n <- 50 #Load data from file for(i in

Re: [R] dnorm Line Plot Graphics

2010-07-13 Thread Ted Harding
On 13-Jul-10 22:21:29, Melissa Peters wrote: > Hello, > > 1. I have a number of snow depth measurements (centimeters depth) that > were acquired in a row (linear transect). > > A: I am trying to plot the probability density function (PDF) of these > points. When I use the "dnorm" command and lin

Re: [R] export tables to excel files on multiple sheets with titles for each table

2010-07-13 Thread Gabor Grothendieck
On Tue, Jul 13, 2010 at 4:21 PM, eugen pircalabelu wrote: > Hello R-users, > Checking the archives, I recently came across this topic: > "export tables to Excel files" > (http://r.789695.n4.nabble.com/export-tables-to-Excel-files-td1565679.html#a1565679), >  and the following interesting reference

[R] dnorm Line Plot Graphics

2010-07-13 Thread Melissa Peters
Hello, 1. I have a number of snow depth measurements (centimeters depth) that were acquired in a row (linear transect). A: I am trying to plot the probability density function (PDF) of these points. When I use the "dnorm" command and line type = points, the PDF is displayed correctly. When I

Re: [R] export tables to excel files on multiple sheets with titles for each table

2010-07-13 Thread Marc Schwartz
If I am correctly understanding what Eugen is trying to do, WriteXLS() won't get him there. WriteXLS() will enable you to label/name the worksheets (tabs) but not allow you to precede the actual data frame rows and columns on the sheet with a title or label. I suspect that you may have to look

Re: [R] export tables to excel files on multiple sheets with titles for each table

2010-07-13 Thread Felipe Carrillo
Check the WriteXLS package, I think it does that and also saves each R object on a different excel sheet.   Felipe D. Carrillo Supervisory Fishery Biologist Department of the Interior US Fish & Wildlife Service California, USA - Original Message > From: eugen pircalabelu > To: R-help

[R] compiling, linking and including multiple FORTRAN subroutines in R

2010-07-13 Thread Bill Shipley
Although there are a number of documents describing library development, in which compiling and using C or FORTRAN source code is discussed, such documents are too detailed and complicated for my limited needs (i.e. I can't follow them!). I am looking for a worked example (i.e. the series of comm

[R] latex table question

2010-07-13 Thread Felipe Carrillo
Hi: My head is spinning with this latex doc so hopefully after I align my tables to the left of the page my headache are going to be over. I always use: \hspace*{-0.1in} to move my figures horizontally to the left margin of the page but the table below doesn't move at all, but instead it gets sid

Re: [R] Want to exclude a column when using sample function

2010-07-13 Thread T.D. Rudolph
It's not really clear what the structure of your data is, nor how exactly you are sampling it (you need to provide an example), but you could try adding this to the end of your sample command (if the result is a data.frame or matrix): [,-1] Tyler -- View this message in context: http://r.789695

Re: [R] Need help on index for time series object

2010-07-13 Thread Gabor Grothendieck
On Tue, Jul 13, 2010 at 3:58 PM, Megh Dal wrote: > Dear all, > > Please forgive me if there is a duplicate post; my previous mail perhaps > didnt reach the list... > > Let say I have following time series > > library(zoo) >> dat1 <- zooreg(rnorm(10), start=as.Date("2010-01-01"), frequency=1)

[R] Want to exclude a column when using sample function

2010-07-13 Thread Addi Wei
For example: When I take a sample of 5 from 10 columns, I want to exclude from the sample column 1 from being chosen. How do I do this? -- View this message in context: http://r.789695.n4.nabble.com/Want-to-exclude-a-column-when-using-sample-function-tp2287988p2287988.html Sent from the R h

[R] potential BUG in BBMM

2010-07-13 Thread T.D. Rudolph
http://r.789695.n4.nabble.com/file/n2287976/BBMM_BUG.RData BBMM_BUG.RData I've been constructing utilization distributions for 63 animal movement trajectories using a Brownian bridge movement model with BBMM. I started noticing after running the routine numerous times at different resolutions t

Re: [R] Need help on index for time series object

2010-07-13 Thread T.D. Rudolph
which(!is.na(dat1)) -- View this message in context: http://r.789695.n4.nabble.com/Need-help-on-index-for-time-series-object-tp2287926p2287948.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://s

[R] export tables to excel files on multiple sheets with titles for each table

2010-07-13 Thread eugen pircalabelu
Hello R-users, Checking the archives, I recently came across this topic: "export tables to Excel files" (http://r.789695.n4.nabble.com/export-tables-to-Excel-files-td1565679.html#a1565679), and the following interesting references have been proposed: http://rwiki.sciviews.org/doku.php?id=tips:da

Re: [R] Need help on index for time series object

2010-07-13 Thread Jonathan Christensen
Megh, I don't know whether this is the best way, but it works: > seq(1,length(dat1))[!is.na(dat1)] [1] 1 2 4 5 6 9 10 Jonathan On Tue, Jul 13, 2010 at 1:58 PM, Megh Dal wrote: > Dear all, > > Please forgive me if there is a duplicate post; my previous mail perhaps > didnt reach the lis

[R] Need help on index for time series object

2010-07-13 Thread Megh Dal
Dear all, Please forgive me if there is a duplicate post; my previous mail perhaps didnt reach the list... Let say I have following time series library(zoo) > dat1 <- zooreg(rnorm(10), start=as.Date("2010-01-01"), frequency=1) > dat1[c(3, 7,8)] = NA > dat1 2010-01-01 2010-01-02 2010-01-03

Re: [R] [R-pkgs] New package "list" for analyzing list surveyexperiments

2010-07-13 Thread Erik Iverson
Raubertas, Richard wrote: I agree that 'list' is a terrible package name, but only secondarily because it is a data type. The primary problem is that it is so generic as to be almost totally uninformative about what the package does. For some reason package writers seem to prefer maximall

[R] working out main effect variance when different parameterization is used and interaction term exists

2010-07-13 Thread Adaikalavan Ramasamy
Dear all, Apologies if this question is bit theoretical and for the longish email. I am meta-analyzing the coefficients and standard errors from multiple studies where the raw data is not available. Each study analyst runs a model that includes an interaction term for, say, between sex and s

[R] Boxplot: Scale outliers

2010-07-13 Thread Robert Peter
Hello! I am trying to scale the outliers in a boxplot. I am passing "pars = list(boxwex=0.1, staplewex=0.1, outwex=0.1)" to the boxplot command. The boxes are scaled correctly, but the circles (outliers) are not scaled at all, and thus pretty big compared to the boxes scaled with 0.1. Am I m

Re: [R] Time Variable and Historical Interest Rates

2010-07-13 Thread Joshua Wiley
On Tue, Jul 13, 2010 at 9:54 AM, Aaditya Nanduri wrote: > Guys, I wrote to the finance mailing list earlier with my questions but was > directed here. > > Sorry for the repeat. > > --- > library(quantmod) > > now <- Sys.time() > > midnight <- strptime()        # < I want to ma

Re: [R] StartsWith over vector of Strings?

2010-07-13 Thread Greg Snow
My solution was based on using vectors (which were your original example), now you are using data frames. The actual result is NA, then you just print content again (which my code never modified) so you are going to see the full content data frame. Try: content[na.omit(pmatch(searchset$signat

[R] RJSONIO install problem

2010-07-13 Thread christiaan pauw
Hi everybody I am trying to install RJSONIO from source in on Mac OS X 10.5.8. I used the Package Installer. The message and sessionInfo is attached below Can someone help me to understand the error message and maybe give hint towards solving the problem thanks in advance Christiaan Message: T

Re: [R] StartsWith over vector of Strings?

2010-07-13 Thread Ralf B
When running the combined code with your suggested line: content <- data.frame(urls=c( "http://www.google.com/search?source=ig&hl=en&rlz=&=&q=stuff&aq=f&aqi=g10&aql=&oq=&gs_rfai=CrrIS3VU8TJqcMJHuzASm9qyBBgAAAKoEBU_QsmVh";,

Re: [R] Wrap column headers caption

2010-07-13 Thread Erik Iverson
Using this dataframe with quite long column headers, how can I wrap the text so that the columns are narrower. I was trying to use strwrap without success. Thanks reportDF <- structure(list(IDDate = c("3/12/2010", "3/13/2010", "3/14/2010", "3/15/2010"), FirstRunoftheYear = c("33 (119 ? 119)",

Re: [R] [R-pkgs] New package "list" for analyzing list surveyexperiments

2010-07-13 Thread Raubertas, Richard
I agree that 'list' is a terrible package name, but only secondarily because it is a data type. The primary problem is that it is so generic as to be almost totally uninformative about what the package does. For some reason package writers seem to prefer maximally uninformative names for the

Re: [R] Wrap column headers caption

2010-07-13 Thread Henrique Dallazuanna
You can't try this: sapply(names(reportDF), toString, width = 10) abbreviate(names(reportDF)) On Tue, Jul 13, 2010 at 2:43 PM, Felipe Carrillo wrote: > Hi: > Using this dataframe with quite long column headers, how can I wrap the > text so that the columns are narrower. I was trying to use strw

Re: [R] SAS Proc summary/means as a R function

2010-07-13 Thread Frank E Harrell Jr
What is the original intent? The bandwidth:productivity ratio is not looking encouraging for this problem. Frank On 07/13/2010 12:38 PM, schuster wrote: Hello, are you trying to pase SAS code (or lightly modified SAS code) and run it in R? Then you are right: the hard part is parsing the c

Re: [R] Calculate confidence interval of the mean based on ANOVA

2010-07-13 Thread Joshua Wiley
N_runs -1 seems a bit of an odd df to choose to calculate the CI for a mean. To answer your question, I think that t.test() is the easiest way to get a CI in R. That said, you can use the MS_residuals from ANOVA to take advantage of variance calculated on groups and pooled. Something like: foo <

[R] Wrap column headers caption

2010-07-13 Thread Felipe Carrillo
Hi: Using this dataframe with quite long column headers, how can I wrap the text so that the columns are narrower. I was trying to use strwrap without success. Thanks reportDF <- structure(list(IDDate = c("3/12/2010", "3/13/2010", "3/14/2010", "3/15/2010"), FirstRunoftheYear = c("33 (119 ? 119)"

Re: [R] SAS Proc summary/means as a R function

2010-07-13 Thread schuster
Hello, are you trying to pase SAS code (or lightly modified SAS code) and run it in R? Then you are right: the hard part is parsing the code. I don't believe that's possible without a custom parser, and even then it's really hard to parse all the SAS "sub languages" right: data step, macro c

Re: [R] distributing a value for a given month across the number of weeks in that month

2010-07-13 Thread Dimitri Liakhovitski
Thank you very much, Gabor! Dimitri On Tue, Jul 13, 2010 at 12:25 PM, Gabor Grothendieck wrote: > On Tue, Jul 13, 2010 at 11:19 AM, Dimitri Liakhovitski > wrote: >> Actually, >> I realized that my task was a bit more complicated as I have different >> (let's call them) Markets and the dates repe

[R] hclust information in a table

2010-07-13 Thread Ralph Modjesch
i try to show the result of the cluster-analysis (hclust, method=ward) in a table with following information first column: height second column: number of clusters third column: clustering information 0,041 | 20 | (3)-(5) 0,111 | 19 | (6)-(11) 0,211 | 18 |

Re: [R] Calculate confidence interval of the mean based on ANOVA

2010-07-13 Thread Paul
Paul wrote: I am trying to recreate an analysis that has been done by another group (in SAS I believe). I'm stuck on one part, I think because my stats knowledge is lacking, and while it's OT, I'm hoping someone here can help. Given this dataframe; Well, that will teach me to read the quest

[R] Revolutions Blog: June Roundup

2010-07-13 Thread David Smith
I write about R every weekday at the Revolutions blog: http://blog.revolutionanalytics.com and every month I post a summary of articles from the previous month of particular interest to readers of r-help. So, in case you missed them, here are some articles related to R from the month of June: ht

[R] Time Variable and Historical Interest Rates

2010-07-13 Thread Aaditya Nanduri
Guys, I wrote to the finance mailing list earlier with my questions but was directed here. Sorry for the repeat. --- library(quantmod) now <- Sys.time() midnight <- strptime()# < I want to make this a static variable that will be equal to 12:00:00 am but I dont know

Re: [R] distributing a value for a given month across the number of weeks in that month

2010-07-13 Thread Gabor Grothendieck
On Tue, Jul 13, 2010 at 11:19 AM, Dimitri Liakhovitski wrote: > Actually, > I realized that my task was a bit more complicated as I have different > (let's call them) Markets and the dates repeat themselves across > markets. And the original code from Gabor gives an error - because > dates repeate

Re: [R] MplusAutomation

2010-07-13 Thread Jeff Newmiller
Create a shortcut that targets your batch file and edit its properties to open minimized, and call the shortcut from R rather than the calling the batch file directly. "Gushta, Matthew" wrote: >R list- >i have begun using the "MplusAutomation" while piloting a large-scale >simulation (~200,00

Re: [R] Generate groups with random size but given total sample size

2010-07-13 Thread Greg Snow
For one definition of random: ss <- rexp(100) ss <- ss/sum(ss) ss <- 5 + round( ss*9500 ) cnt <- 0 while( ( d <- sum(ss) - 1 ) != 0 ) { tmpid <- sample.int(100,1) ss[tmpid] <- ss[tmpid] - d ss[ ss > 500 ] <- 500 ss[ ss < 5 ] <- 5 cnt <- cnt

Re: [R] What is the degrees of freedom in an nlme model

2010-07-13 Thread Bert Gunter
... > > Aug;235(2):E97-102). The paper is freely available. The idea is to fit > > the curves individually and obtain the residual sum of squares and > > then fit the curves altogether somehow constraining some parameters > > and then you have another residual sum of squares. Then you can do a > >

Re: [R] StartsWith over vector of Strings?

2010-07-13 Thread Greg Snow
content[na.omit(pmatch(searchset, content,,TRUE))] -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Ralf B > S

Re: [R] How can i draw a graph with high and low data points

2010-07-13 Thread Greg Snow
There are several functions in several packages for plotting intervals that will give you plots much better than the excel one. The RSiteSearch function or the sos package may help you find those. But it is also easy to create such plots using just a few lines of R code and base graphics. Re

Re: [R] How to select the column header with \Sexpr{}

2010-07-13 Thread Ista Zahn
Hi Felipe, See in line below. On Tue, Jul 13, 2010 at 11:04 AM, Felipe Carrillo wrote: > Thanks Izta: > I see your point, then I should extract the column names when the > dataset is first read because is a dataframe: That might work, but it's definitely not how I would do it. >  report <- stru

Re: [R] Fast string comparison

2010-07-13 Thread Matt Shotwell
Good idea Romain, there is quite a bit of type testing in the function versions of STRING_ELT and CHAR, not to mention the function call overhead. Since the types are checked explicitly, I believe this function is safe. All together now... > system.time(strings[-1] == strings[-1e5]) user syste

Re: [R] What is the degrees of freedom in an nlme model

2010-07-13 Thread Greg Snow
If the curves are sufficiently close to sine (cosine) curves and you know the period, then this can be restructured as a linear model and you can avoid all the complexities that come with non-linear models. Further, from your description, it does not sound like you really gain much from using t

Re: [R] Accessing files on password-protected FTP sites

2010-07-13 Thread Erik Iverson
Is it possible to download data from password-protected ftp sites? I saw another thread with instructions for uploading files using RCurl, but I could not find information for downloading them in the RCurl documentation. Did you try the ?getURL function in RCurl? See the `Test the password

Re: [R] distributing a value for a given month across the number of weeks in that month

2010-07-13 Thread Dimitri Liakhovitski
Actually, I realized that my task was a bit more complicated as I have different (let's call them) Markets and the dates repeat themselves across markets. And the original code from Gabor gives an error - because dates repeate themselves and apparently zoo cannot handle it. So, I had to do program

Re: [R] Robust regression error: Too many singular resamples

2010-07-13 Thread Alexandra Denby
"You could try rlm in the MASS package; it doesn't use he resampling step." That seems to do the trick. Thank you! -- View this message in context: http://r.789695.n4.nabble.com/Robust-regression-error-Too-many-singular-resamples-tp2286585p2287468.html Sent from the R help mailing list archiv

Re: [R] isdst warning when rounding a range of time data: fix or suppress?

2010-07-13 Thread philippgrueber
Dear Clay, dear list, I face the same problem when rounding POSIXct objects. Have you (or has anybody) found an explanation meanwhile, or a way to work around this issue? Example: opt<-options(digits.secs=3) ts1<-as.POSIXct(c("2006-11-01 09:00:00.03", "2006-11-01 09:00:01", "2006-11-01 09:00:0

Re: [R] Regarding R -installation

2010-07-13 Thread venkatesh bandaru
Dear nuncio my internet is connected properly, i am running yast as a superuser , i am getting the following error > > > *Problem* : > > Cannot access installation media > > http://download.opensuse.org/repositories/devel:languages:R:patched/openSUSE_11.2 > (Medium 1). > Check whether the ser

[R] MplusAutomation

2010-07-13 Thread Gushta, Matthew
R list- i have begun using the "MplusAutomation" while piloting a large-scale simulation (~200,000 replications). since the package takes advantage of the DOS batch mode available in Mplus, each replication starts and activates a new instance of a command prompt window. this effectively locks me

Re: [R] how to extract information from anova results

2010-07-13 Thread Joshua Wiley
I think the easiest way is from calling anova() on your aov class object. For instance y <- 1:10 x <- runif(10) my.aov <- aov(y ~ x) anova(my.aov)["Residuals", "Sum Sq"] anova(my.aov)["x", "Pr(>F)"] You can also extract these values from a call to summary(my.aov), but that output is a list (even

Re: [R] Substring function?

2010-07-13 Thread Erik Iverson
The high-level concept you need is called "Regular Expressions". R supports these through several functions, see ?regex . Ralf B wrote: Hi all, I would like to detect all strings in the vector 'content' that contain the strings from the vector 'search'. Here a code example: content <- data.f

Re: [R] How to select the column header with \Sexpr{}

2010-07-13 Thread Felipe Carrillo
Thanks Izta: I see your point, then I should extract the column names when the dataset is first read because is a dataframe:  report <- structure(list(Date = c("3/12/2010", "3/13/2010", "3/14/2010",  "3/15/2010"), Run1 = c("33 (119 ? 119)", "n (0 ? 0)", "893 (110 ? 146)",  "140 (111 ? 150)"), Run2

Re: [R] how to extract information from anova results

2010-07-13 Thread David Winsemius
On Jul 13, 2010, at 10:35 AM, Luis Borda de Agua wrote: Hi, I have used the instruction aov in the following manner: res <- aov(qwe ~ asd) when I typed "res" I get: _ Call: aov(formula = qwe ~ asd) Terms: asd Residuals Sum of Squares 0.0708704 0.5255957 Deg.

[R] how to extract information from anova results

2010-07-13 Thread Luis Borda de Agua
Hi, I have used the instruction aov in the following manner: res <- aov(qwe ~ asd) when I typed "res" I get: _ Call: aov(formula = qwe ~ asd) Terms: asd Residuals Sum of Squares 0.0708704 0.5255957 Deg. of Freedom 1 8 Residual standard error:

Re: [R] Continuing on with a loop when there's a failure

2010-07-13 Thread David Winsemius
On Jul 13, 2010, at 10:26 AM, David Winsemius wrote: On Jul 13, 2010, at 9:24 AM, Josh B wrote: In my opinion the try and tryCatch commands are written and documented rather poorly. Thus I am not sure what to program exactly. Didn't you see the "silent" parameter? Its seems to be documen

Re: [R] Continuing on with a loop when there's a failure

2010-07-13 Thread David Winsemius
On Jul 13, 2010, at 9:24 AM, Josh B wrote: In my opinion the try and tryCatch commands are written and documented rather poorly. Thus I am not sure what to program exactly. Didn't you see the "silent" parameter? Its seems to be documented fairly clearly to me. The testing of try at the

Re: [R] How to select the column header with \Sexpr{}

2010-07-13 Thread Ista Zahn
Hi Felipe, The problem has nothing to do with Sweave or \Sexpr. The problem is that by the time you call \Sexpr report is a matrix, and you cannot access the column names of a matrix with names(). You need to use colnames() or convert the matrix to a data.frame. Perhaps a true useR can write R cod

Re: [R] RODBC and Excel 2010 xlsx

2010-07-13 Thread Prof Brian Ripley
On Tue, 13 Jul 2010, Rodrigo Aluizio wrote: Hi List, just to know if the issue is only a problem of mine or if it is a general issue due to the new MS Office pack. I'm using R 2.11.1 32 bits in a It's a Microsoft muddle, covered in the RODBC manual for the next release. Note that R-sig-db is

  1   2   >