Re: [R] Help needed on R output

2009-05-25 Thread Linlin Yan
> t <- c( + "", + "01001001011011101100", + "1001001011010101", + "1101110100000011", + "000100100101001001011001", + "000101101101101001101001") > { + cat ('rom_array := (\n'); + for (i in 1:length(t)) { +

[R] Help needed on R output

2009-05-25 Thread peng chen
Hi, R experts: I am trying to generate data output in the following format: rom_array := ( "", "01001001011011101100", "1001001011010101", "1101110100000011", "000100100101001001011001", "00010110110110100

[R] Grouping methods

2009-05-25 Thread Dyson
Hi i need help with this data set http://books.google.com.au/books?id=vWu-MJM_obsC&pg=PA62&dq=M345+statistical+methods+unit+13#PPA62,M1 what grouping methods could i use? -- View this message in context: http://www.nabble.com/Grouping-methods-tp23715866p23715866.html Sent from the R help mailin

Re: [R] Draw a rectangle on top of an image using RGtk2?

2009-05-25 Thread Ronggui Huang
I see. So if I want to draw a rectangle by a function outside the expose_fn, I need to refer to the drawable within the expose_fn. One possibility is to use an environment, so I can refer to it dynamically. Thanks, Ronggui 2009/5/25 Michael Lawrence : > > > On Sat, May 23, 2009 at 8:27 AM, Ronggu

Re: [R] sciplot question

2009-05-25 Thread Frank E Harrell Jr
Manuel Morales wrote: On Mon, 2009-05-25 at 06:22 -0500, Frank E Harrell Jr wrote: Jarle Bjørgeengen wrote: On May 24, 2009, at 4:42 , Frank E Harrell Jr wrote: Jarle Bjørgeengen wrote: On May 24, 2009, at 3:34 , Frank E Harrell Jr wrote: Jarle Bjørgeengen wrote: Great, thanks Manuel. Just

Re: [R] How to create all pairs

2009-05-25 Thread Mike Lawrence
expand.grid(i,j) On Mon, May 25, 2009 at 8:26 PM, alad wrote: > > Hi, > > I have: > i = c(1,2,3) > j = c(4,5,6) > > How do I create a matrix of all pairs? > i.e. > 1,4 > 1,5 > 1,6 > 2,4 > : > > Thanks! > > > -- > View this message in context: > http://www.nabble.com/How-to-create-all-pairs-tp237

Re: [R] How to create all pairs

2009-05-25 Thread Bill.Venables
?expand.grid e.g. M <- expand.grid(i = 1:3, j = 4:6) You can coerce it to a matrix if that is really what you want. Bill Venables http://www.cmis.csiro.au/bill.venables/ -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of alad S

Re: [R] How to create all pairs

2009-05-25 Thread jim holtman
Is this what you want: > i = c(1,2,3) > j = c(4,5,6) > expand.grid(i,j) Var1 Var2 114 224 334 415 525 635 716 826 936 > On Mon, May 25, 2009 at 7:26 PM, alad wrote: > > Hi, > > I have: > i = c(1,2,3) > j = c(4,5,6) > > H

Re: [R] How to create all pairs

2009-05-25 Thread Jorge Ivan Velez
Dear alad, Try this: expand.grid(i,j) See ?expand.grid for more details. HTH, Jorge On Mon, May 25, 2009 at 7:26 PM, alad wrote: > > Hi, > > I have: > i = c(1,2,3) > j = c(4,5,6) > > How do I create a matrix of all pairs? > i.e. > 1,4 > 1,5 > 1,6 > 2,4 > : > > Thanks! > > > -- > View this me

[R] How to create all pairs

2009-05-25 Thread alad
Hi, I have: i = c(1,2,3) j = c(4,5,6) How do I create a matrix of all pairs? i.e. 1,4 1,5 1,6 2,4 : Thanks! -- View this message in context: http://www.nabble.com/How-to-create-all-pairs-tp23714659p23714659.html Sent from the R help mailing list archive at Nabble.com. _

Re: [R] sciplot question

2009-05-25 Thread Manuel Morales
On Mon, 2009-05-25 at 06:22 -0500, Frank E Harrell Jr wrote: > Jarle Bjørgeengen wrote: > > > > On May 24, 2009, at 4:42 , Frank E Harrell Jr wrote: > > > >> Jarle Bjørgeengen wrote: > >>> On May 24, 2009, at 3:34 , Frank E Harrell Jr wrote: > Jarle Bjørgeengen wrote: > > Great, > >

[R] Piecewise Aggregate approximation

2009-05-25 Thread Anirudh Kondaveeti
Hi all! I was looking for a software which does Piecewise Aggregate Approximation of time series data for dimensionality reduction. I have read some papers which have mentoned the technique but no mention about the software used was given any where. Any suggestions about it would be appreciated. T

Re: [R] apply fn to many dataframes

2009-05-25 Thread Wacek Kusnierczyk
jim holtman wrote: > You have to return a value from the function in the lapply and assign the > result to another object: > > >> df <- data.frame(a=1,b=2,c=3,d=4) >> a <- list(df,df,df,df) >> # to change the name of the second, you have to change the name and then >> > return > >> # the

Re: [R] apply fn to many dataframes

2009-05-25 Thread markleeds
Hi:Â you have to return the dataframe inside the lapply. I also changed = to <- but I doubt that matters. d1 <- data.frame(x1=1,x3=4) d2 <- data.frame(x1=2,x3=5) d3 <- data.frame(x1=3,x3=6) d4 <- data.frame(x1=4,x3=7) a = list(d1,d2,d3,d4) print(a) lapply(a,function(.df

Re: [R] using optimize() correctly ...

2009-05-25 Thread Esmail
Hi Ravi! Ravi Varadhan wrote: > > Yes. Most classical optimization methods (e.g. gradient-type, > Newton-type) are "local", i.e. they do not attempt to locate the > global optimum. Ah .. I see. > The primary difficulty with global optimization is that there are no > mathematical conditions tha

Re: [R] using optimize() correctly ...

2009-05-25 Thread Esmail
Berend Hasselman wrote: If you do resopt <- optim(-5,f, method="SANN",control=list(fnscale=-1)) you will get the global maximum. SANN: simulated annealing. But starting in -4 takes you to the local maximum. So if I understand correctly, this method would also yield the same sort of result

Re: [R] apply fn to many dataframes

2009-05-25 Thread jim holtman
You have to return a value from the function in the lapply and assign the result to another object: > df <- data.frame(a=1,b=2,c=3,d=4) > a <- list(df,df,df,df) > # to change the name of the second, you have to change the name and then return > # the dataframe as the return value and assign it bac

Re: [R] Running R from a read-only CD

2009-05-25 Thread Duncan Murdoch
On 25/05/2009 5:36 PM, Charles Annis, P.E. wrote: I'm not sure how not to use chm help, since that's the only way I've ever done things. But why would things work well from a USB Flash Drive and not for a CD when the folders are identical? (The CD was burned from the image on the Flash Drive.)

[R] apply fn to many dataframes

2009-05-25 Thread James Fearon
Hi, Say I have dataframes d1, d2, ... , dn, and I want to apply a function to all of them. For example, say I want to change the name of the second variable in each dataframe to "x2". The following doesn't work: a = list(d1,d2,d3,d4) lapply(a,function(x) names(x)[2] = "x2") What would work

Re: [R] Interpolating variables within (RODBC library) SQL statements for MySQL

2009-05-25 Thread Gabor Grothendieck
x <- 1; y <- 2 # 1 paste("x is", x, "y is", y) # 2 sprintf("x is %d, y is %d", x, y) # 3 library(gsubfn) fn$cat("x is $x, y is $y\n") For the last one see http://gsubfn.googlecode.com If we preface a function by fn$ then it interpolates strings subject to some qualifications, e.g. fn$sqlQuery(

Re: [R] Running R from a read-only CD

2009-05-25 Thread Charles Annis, P.E.
I'm not sure how not to use chm help, since that's the only way I've ever done things. But why would things work well from a USB Flash Drive and not for a CD when the folders are identical? (The CD was burned from the image on the Flash Drive.) Charles Annis, P.E. charles.an...@statisticaleng

Re: [R] Running R from a read-only CD

2009-05-25 Thread Duncan Murdoch
On 25/05/2009 5:18 PM, Charles Annis, P.E. wrote: After reading your suggested page, it does appear that the problem is a security feature that I will have to live with since the CDs will be running on borrowed computers. BUT, if the same R-folder is loaded from a USB Flash Drive, rather than a

Re: [R] Running R from a read-only CD

2009-05-25 Thread Charles Annis, P.E.
After reading your suggested page, it does appear that the problem is a security feature that I will have to live with since the CDs will be running on borrowed computers. BUT, if the same R-folder is loaded from a USB Flash Drive, rather than a CD, the help files work just fine. So perhaps there

Re: [R] Running R from a read-only CD

2009-05-25 Thread Duncan Murdoch
On 25/05/2009 4:40 PM, Charles Annis, P.E. wrote: Dear R-helpers: I created a folder containing R on a read-only CD and use it by having the R-icon, located on the Windows desktop, point to the CD (R-2.8.1\bin\Rgui.exe) for the "Target," and to a Windows Desktop folder for "Start in." This wo

Re: [R] Interpolating variables within (RODBC library) SQL statements for MySQL

2009-05-25 Thread jim holtman
?paste e.g., sql <- paste("select YPOS, XPOS, YEAR, MONTH, RANGE, APFEL,", "TEMPMIN, TEMPAVG, TEMPMAX, PRECIPITATION, SUNDURATION from DATA where YPOS=", ypos, " AND XPOS=", xpos, " AND MONTH BETWEEN 1 AND 12 AND RANGE = 1;", sep="") On Mon, May 25, 2009 at 4:26 PM, John Fitzgerald < joh

[R] Running R from a read-only CD

2009-05-25 Thread Charles Annis, P.E.
Dear R-helpers: I created a folder containing R on a read-only CD and use it by having the R-icon, located on the Windows desktop, point to the CD (R-2.8.1\bin\Rgui.exe) for the "Target," and to a Windows Desktop folder for "Start in." This works nicely EXCEPT that the R help() function cannot d

[R] Interpolating variables within (RODBC library) SQL statements for MySQL

2009-05-25 Thread John Fitzgerald
Hi everyone, I am desperately looking for a method to interpolate strings within an SQL statement as follows: I get a lot of rows out of a database (in my example POSITION_to_ZIPCODE Database with holds records for German ZIP Code <--> Gauss-Krueger Coordinate System ) and want this to be selecte

Re: [R] sciplot question

2009-05-25 Thread Frank E Harrell Jr
spencerg wrote: Frank E Harrell Jr wrote: spencerg wrote: Dear Frank, et al.: Frank E Harrell Jr wrote: Yes; I do see a normal distribution about once every 10 years. To what do you attribute the nonnormality you see in most cases? (1) Unmodeled components of variance that c

[R] image, domain, codomain

2009-05-25 Thread federico totaro
Hi all! i'm trying to write a particular function: it is as follows: Pi greek (x): - has values from R(n) to the [0, 1] interval - the function Pi Greek(-x)=1-Pi Greek(x) now the question: how i could set the codomain to that interval?? thanks very much! ..fede! [[alternative HTML vers

Re: [R] Memory problems when using ifelse

2009-05-25 Thread jim holtman
It worked fine for me without using much memory. Take a look at you statements and you will see that you are missing a comma on the dimensions: > n <- 58000 > max_out <- data.frame(Lat=runif(n), Long=runif(n), Model=sample(1:12, n ,TRUE), + Obs=sample(1:12, n, TRUE)) > str(max_out) 'data.fram

Re: [R] Blocking design

2009-05-25 Thread Araujo, Edson
Hi, Does anyone know how to generate block designs using the AlgDesign package? I have a experimental design with 1024 combinations and need to reduce it. Thanks! Edson [[alternative HTML version deleted]] __ R-help@r-project.org mailing lis

Re: [R] SEM modelling

2009-05-25 Thread John Fox
Dear Simo, Apparently the input covariance matrix is a list rather than a numeric matrix. Without the input that you specified, it's not possible to know for sure what you did, but I suspect that you used the object returned by hetcor() in the polycor package rather than the polychoric correlation

[R] Or operator on working on the r-objects doesn't generate a logical value

2009-05-25 Thread Moumita Das
Hi friends, Can somebody help me out please? I have to create a string for a particular if condition , with some values(returned by function1) which are always variable. *Step-I* Suppose function1 returns a dataframe like this,shown below with two values 3 and 4:--- x 1 3 2 4 *STEP-II *For

[R] Memory problems when using ifelse

2009-05-25 Thread Steve Murray
Dear R Users, I have a data frame of 4 columns and ~58000 rows, the top of which looks like this: > head(max_out) Latitude Longitude Model Obs 1-0.25-49.25 4 4 2-0.25-50.25 4 5 3-0.25-50.75 4 4 4-0.25-51.25 311 5-0.25-5

[R] SEM modelling

2009-05-25 Thread Simo Vundla
Dear All,   I am trying to run a program using SEM and the input data is a covariance matrix (polychoric correlations). However I get an error message which says:      is.triangular(S) : (list) object cannot be coerced to 'double'   Do not know what the problem is. Have do

Re: [R] cairoDevice.dll error, but it exists..?

2009-05-25 Thread zubin
Duncan, thx - installing GTK fixed the issue :) -zubin Duncan Murdoch wrote: On 5/25/2009 9:43 AM, zubin wrote: Hello, running windows vista, R2.9. Installed the following libraries: (*latticist*, *playwith* and *Cairo*) Wanted then to run, to evaluate the visualization features: data(ir

Re: [R] cairoDevice.dll error, but it exists..?

2009-05-25 Thread Duncan Murdoch
On 5/25/2009 9:43 AM, zubin wrote: Hello, running windows vista, R2.9. Installed the following libraries: (*latticist*, *playwith* and *Cairo*) Wanted then to run, to evaluate the visualization features: data(iris) library(latticist) latticist(iris) However, i tested my desktop and

Re: [R] cairoDevice.dll error, but it exists..?

2009-05-25 Thread Prof Brian Ripley
Most likely you did not install the dependent DLLs: you need Gtk2 (aka GTk+) installed *and in your path*. That message does not say that 'cairoDevice.dll' cannot be loaded, but a DLL it specified: in interactive use on recent versions of Windows you normally get a pop-up with more information

Re: [R] long format - find age when another variable is first 'high'

2009-05-25 Thread Gabor Grothendieck
Depending on what you want (haven't checked the speed) you could try this one where we have changed the ldlc in the first row so that it has none > 130 for id=1 just to illustrate that case as well: > d <- data.frame(id = c(rep(1, 3), rep(2, 2), 3), age=c(5, 10, 15, 4, 7, 12), + ldlc=c(122, 120

Re: [R] Working with daily data

2009-05-25 Thread spencerg
Hi, Gabor: Is there a general search capability with "https://stat.ethz.ch/pipermail/r-sig-finance";? We can review the archives there by Thread, Subject, Author or Date within quarter, but I don't see anything that allows me to input a search term. Thanks, Spencer Gabor

Re: [R] sciplot question

2009-05-25 Thread spencerg
Frank E Harrell Jr wrote: spencerg wrote: Dear Frank, et al.: Frank E Harrell Jr wrote: Yes; I do see a normal distribution about once every 10 years. To what do you attribute the nonnormality you see in most cases? (1) Unmodeled components of variance that can generate erro

[R] cairoDevice.dll error, but it exists..?

2009-05-25 Thread zubin
Hello, running windows vista, R2.9. Installed the following libraries: (*latticist*, *playwith* and *Cairo*) Wanted then to run, to evaluate the visualization features: >data(iris) >library(latticist) >latticist(iris) However, i tested my desktop and laptop and get the following error afte

Re: [R] Working with daily data

2009-05-25 Thread Gabor Grothendieck
Your google search or daily data site:https://stat.ethz.ch/pipermail/r-sig-finance/ both seem to give reasonable results. On Mon, May 25, 2009 at 9:45 AM, spencerg wrote: > Hi, Gabor, et al.: > >     What's the best way to search the R-SIG-Finance archives?  Are R-SIG-* > included in any of the

Re: [R] long format - find age when another variable is first 'high'

2009-05-25 Thread Marc Schwartz
On May 25, 2009, at 7:45 AM, David Freedman wrote: Dear R, I've got a data frame with children examined multiple times and at various ages. I'm trying to find the first age at which another variable (LDL-Cholesterol) is >= 130 mg/dL; for some children, this may never happen. I can do t

Re: [R] long format - find age when another variable is first 'high'

2009-05-25 Thread ONKELINX, Thierry
Dear David, You would speed up things is you first create a subset were all values of ldlc is >= 130. Then you only have to find the lowest age for each child in this subset. HTH, Thierry ir. Thierry Onkelinx Institu

Re: [R] Working with daily data

2009-05-25 Thread spencerg
Hi, Gabor, et al.: What's the best way to search the R-SIG-Finance archives? Are R-SIG-* included in any of the main R search engines (at "http://www.r-project.org/search.html";)? Gmane has an option for "gmane.comp.lang.r.finance", but when I tried it just now, I got, "No such group

[R] Blocking design

2009-05-25 Thread Araujo, Edson
Hi, Does anyone know how to generate block designs using the AlgDesign package? I have a experimental design with 1024 combinations and need to reduce it. Thanks! Edson [[alternative HTML version deleted]] __ R-help@r-project.org mailing li

Re: [R] Draw a rectangle on top of an image using RGtk2?

2009-05-25 Thread Michael Lawrence
On Sat, May 23, 2009 at 8:27 AM, Ronggui Huang wrote: > Thanks, Michael. Just one more follow-up question. Is there other way > to get the "GdkDrawable" (here da2) without using <<- or other > assignment operation from within expose_fn? I thought > da$GetRootWindow() would work, but it does not. >

Re: [R] accuracy of a neural net

2009-05-25 Thread onyourmark
It looks promising. I saw the pdf at:http://cran.r-project.org/web/packages/caret/vignettes/caretMisc.pdf. I will give it a try. Thank you. onyourmark wrote: > > Hi. I started with a file which was a sparse 982x923 matrix and where the > last column was a variable to be predicted. I did principl

[R] mle2 for poisson data

2009-05-25 Thread alexander russell
Hello, I'd like to obtain parameters for my poisson data. Having made the function poisregfun = function(a,b) {Y.pred = exp(a + b*x) - sum(dpois(y, lambda = Y.pred, log = TRUE))} where Y is a vector of data to be regressed on another vector x. I'm asking for mle2( poisregfun, start = list(a = 2

[R] Odp: regrouping factor levels

2009-05-25 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 22.05.2009 18:53:37: > > Hi all, > I had some trouble in regrouping factor levels for a variable. After some > experiments, I have figured out how I can recode to modify the factor levels. > I would now like some help to understand why some methods

[R] long format - find age when another variable is first 'high'

2009-05-25 Thread David Freedman
Dear R, I've got a data frame with children examined multiple times and at various ages. I'm trying to find the first age at which another variable (LDL-Cholesterol) is >= 130 mg/dL; for some children, this may never happen. I can do this with transformBy and ddply, but with 10,000 different c

Re: [R] Working with daily data

2009-05-25 Thread Gabor Grothendieck
Check out the xts, zoo and quantmod packages. xts has a vignette (pdf document) and zoo has three vignettes. Also look at: ?read.zoo in zoo to read your data, or ?getSymbols in quantmod.to fetch data from the net, and the discussion list: https://stat.ethz.ch/mailman/listinfo/r-sig-finance On M

Re: [R] sciplot question

2009-05-25 Thread Frank E Harrell Jr
Jarle Bjørgeengen wrote: On May 24, 2009, at 4:42 , Frank E Harrell Jr wrote: Jarle Bjørgeengen wrote: On May 24, 2009, at 3:34 , Frank E Harrell Jr wrote: Jarle Bjørgeengen wrote: Great, thanks Manuel. Just for curiosity, any particular reason you chose standard error , and not confidence

Re: [R] build CONTENTS or 00Index.html without installing whole package

2009-05-25 Thread Jonathan Baron
Problem solved. Current script is at http://finzi.psych.upenn.edu/~baron/inst.R This makes all the help files in html format without installing any packages. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do r

Re: [R] how to implement a circular buffer with R

2009-05-25 Thread Wacek Kusnierczyk
milton ruser wrote: > Hi Maura, > > It is not "elegant" but may work. > > > actual.string<- "12345abcdefgh12345abcdefgh" > actual.string > actual.string<-paste(substr(actual.string, > nchar(actual.string),nchar(actual.string)), >substr(actual.string, 1,nchar(actual.string)-1), sep="") > actual.

[R] Working with daily data

2009-05-25 Thread Menezes, Ian
Hello I have daily S&P 500 from 1950 for which I would like to do some time series analysis in R. Could someone please show me an example of how to create a ts/ irts object for my data? Additionally, how do I create monthly subsamples of the data. I've experimented with the window function but

Re: [R] Getting an older version of a package

2009-05-25 Thread Uwe Ligges
stephen sefick wrote: if you are on a .nix then in a terminal move to the directory that contains the tar ball of the packages and type R CMD install foo.tar.bz ... same if you are on Windows (as it seems to be the case), but before, you need to install the tools mention in the manual R Inst

Re: [R] A question on type="h" plot lines

2009-05-25 Thread Jim Lemon
Martin Ivanov wrote: Dear R users, I need a produce a plot with a single panel and a few lines on it. Each line represents a different data set. The line types must be "h", i.e. ‘histogram’ like (or ‘high-density’) vertical lines. The problem is that the vertical lines comprising a plot line of

Re: [R] Creating a list by just using start and final component

2009-05-25 Thread Wacek Kusnierczyk
Romain Francois wrote: > Hollix wrote: >> Hi there, >> >> say, I have 100 matrices (m1,m2,...,m100) which I want to combine in >> a list. >> The list, thus, shall contain the matrices as components. >> >> Is it necessary to mention all 100 matrices in the list() command? I >> would >> like to use j

Re: [R] unit of grid size of s.class plot (ade4)?

2009-05-25 Thread Stéphane Dray
Hi, d is the side-length of a square in the grid. Please, post your questions regarding ade4 to adelist (http://listes.univ-lyon1.fr/wws/info/adelist) Cheers, heike.zimmerm...@botanik.uni-halle.de wrote: Dear R-helpers, I have perfomed a BPCA (dudi.pca, between, package=ade4) and visualis

Re: [R] sciplot question

2009-05-25 Thread Jarle Bjørgeengen
On May 24, 2009, at 4:42 , Frank E Harrell Jr wrote: Jarle Bjørgeengen wrote: On May 24, 2009, at 3:34 , Frank E Harrell Jr wrote: Jarle Bjørgeengen wrote: Great, thanks Manuel. Just for curiosity, any particular reason you chose standard error , and not confidence interval as the default