Re: [R] how to use "apply" function partial to each vector of a matrix

2011-01-10 Thread Michael Bedward
Hello, Here is one way... m <- matrix(1:16, nrow=4) end <- c(2, 3, 1, 3) ii <- cbind(sequence(end), rep(1:length(end), end)) sums <- tapply(m[ ii ], ii[ , 2], sum) And here is another way... sums <- mapply(function(col, lastrow) sum(m[1:lastrow, col]), 1:ncol(m), end) Hope this helps, Michael

Re: [R] Generation of Normal Random Numbers

2011-01-10 Thread Jeff Newmiller
So you need to cbind the four vectors together... ?cbind "saggak" wrote: >Dear R helpers > >I have a data frame as given below > >df = data.frame(A = c(776,827,836,995,855,1026,1203,1363,965,1195), >�� B = >c(806,953,1049,1056,1243,764,1148,1162,948,1154), >��

Re: [R] Generation of Normal Random Numbers

2011-01-10 Thread Michael Bedward
m <- c(1004.1, 1028.3, 1044.3, 861.4) s <- c(194.5899, 158.7052, 123.3000, 285.8695) x <- mapply(function(mi, si) rnorm(25, mi, si), m, s) Hope this helps, Michael On 11 January 2011 17:44, saggak wrote: > Dear R helpers > > I have a data frame as given below > > df = data.frame(A = c(776,827,

[R] Interpolate xts

2011-01-10 Thread Rustamali Manesiya
Hello, I have a xts object, I would like to fill the NA with linear interpolated data. Can anyone please help. > str(zz) An ‘xts’ object from 2010-11-24 15:59:29 to 2010-11-24 16:00:00 containing: Data: num [1:23401, 1] 312 312 312 312 312 ... Indexed by objects of class: [POSIXct,POSI

[R] how to coerce part of each column of a matrix to a vector and merge them

2011-01-10 Thread zhaoxing731
Hello Suppose I have a matrix mat=(1:16,2) [,1] [,2] [,3] [,4] [1,]159 13 [2,]26 10 14 [3,]37 11 15 [4,]48 12 16 there is a vector end=c(2,3,1,3) #coerce the 1st 2 numbers of the 1st column to a vector [1] 1 2 #coerce the 1st 3 numbers of

[R] how to use "apply" function partial to each vector of a matrix

2011-01-10 Thread zhaoxing731
Hello Suppose I have a matrix mat=(1:16,2) [,1] [,2] [,3] [,4] [1,]159 13 [2,]26 10 14 [3,]37 11 15 [4,]48 12 16 I just want to use the "apply" function to the matrix partially there is a vector end=c(2,3,1,3) #sum the 1st 2 numbers of

[R] Problems producing quantreg-Tables

2011-01-10 Thread Jan Henckens
Hi Folks, I've got a question regarding the 'quantreg' package maintained by Roger Koenker: I tried to produce LaTeX tables using the longtable and dcolumn options as decribed in the manual, but the function latex() doesn't seem to react on _any_ other options than 'digits' and 'transpose'.

Re: [R] Rectangle height in lattice xyplot key

2011-01-10 Thread Deepayan Sarkar
On Sun, Jan 9, 2011 at 9:31 AM, Duncan Mackay wrote: > Dear All > > I have a problem with the height of the boxes in the key in the following. > (The text is over 2 lines to  accentuate the problem of no space between the > rectangles.) > Is there an easy way to put a space between the rectangles;

[R] Generation of Normal Random Numbers

2011-01-10 Thread saggak
Dear R helpers I have a data frame as given below df = data.frame(A = c(776,827,836,995,855,1026,1203,1363,965,1195),    B = c(806,953,1049,1056,1243,764,1148,1162,948,1154),    C = c(959,1155,1193,1163,863,1070,1087,877,1132,944),    D

[R] Real time dataset

2011-01-10 Thread antujsrv
my dataset looks like : >df VIX GLD FAS 12 4 5 28 9 10 356 9 98 .. continued the dataset has n observations which is fixed and i need to create a function : test <- function(variable name, value) -- this function has to insert the value under the re

[R] Rectangle height in lattice xyplot key

2011-01-10 Thread Duncan Mackay
Dear All I have a problem with the height of the boxes in the key in the following. (The text is over 2 lines to accentuate the problem of no space between the rectangles.) Is there an easy way to put a space between the rectangles; size controls the width but there appears to be nothing for t

Re: [R] question on aggregate

2011-01-10 Thread Gabor Grothendieck
On Mon, Jan 10, 2011 at 8:23 PM, analys...@hotmail.com wrote: > an example available on the net goes like > >> df >  identifier quantity > 1          1       10 > 2          1       20 > 3          2       30 > 4          1       15 > 5          2       10 > 6          3       20 >> aggregate(df$q

Re: [R] Assumptions for ANOVA: the right way to check the normality

2011-01-10 Thread Mike Marchywka
( again top posting since hotmail isn't adding ">" and these comments apply to whole thread anyway ) I'm not a statistician either but rather an engineer who has had a chance to use my intro stats/math background to look at some real life situations. I'm just making comments for conversation, ho

Re: [R] Memory Needed for Regression

2011-01-10 Thread Charles C. Berry
On Mon, 10 Jan 2011, efreeman wrote: I'm looking for a formula for memory usage in standard regression; that is, if I have X rows with Y predictors, how much memory is needed? I'm speccing out a system, and I'd like to be able to get enough memory that we can do some fairly large regressions.

[R] SVD, UV-Decomposition and NMF

2011-01-10 Thread noclue_
I am reading the Mining of Massive Datasets Book by Rajaraman and Ullman. It has a good explanation of Recommendation System at Chapter 9. But what are the relationship between 1) SVD (Singular Decomposition) 2) UV-Decomposition 3) NMF (Non-negative Matrix Factorization) In particular, it

[R] question on aggregate

2011-01-10 Thread analys...@hotmail.com
an example available on the net goes like > df identifier quantity 1 1 10 2 1 20 3 2 30 4 1 15 5 2 10 6 3 20 > aggregate(df$quantity, by=list(df$identifier), sum) Group.1 x 1 1 45 2 2 40 3

Re: [R] question about the chow test of poolability

2011-01-10 Thread Corey Sparks
Can you provide an example of your code? - Corey Sparks, PhD Assistant Professor Department of Demography and Organization Studies University of Texas at San Antonio 501 West Durango Blvd Monterey Building 2.270C San Antonio, TX 78207 210-458-3166 corey.sparks 'at' utsa.edu https://rowdyspa

Re: [R] Global variables

2011-01-10 Thread Michael Bedward
Hi Sebastian, You might also find the proto package useful as a way of restricting the scope of variables. It provides a more intuitive (at least to me) way of packaging variables and functions up into environments that can be related in a hierarchy. Michael On 10 January 2011 23:48, Sebastien B

Re: [R] Assumptions for ANOVA: the right way to check the normality

2011-01-10 Thread Frodo Jedi
Dear Greg, first of all thanks for your reply. And I add also many thanks to all of you guys who are helping me, sorry for the amount of questions I recently posted ;-) I don´t have a solid statistics background (I am not a statician) and I am basically learning everything by myself. So my

Re: [R] Help with Data Transformation

2011-01-10 Thread John Kane
That's fine. Am I correct that this is the format you want for the output file? nams <- c("fldsampid", "CLP_ID", "sacode", "matrix", "etc.", "CL", "PO4", "SO4AG", "AL", "AS", "B", "V", "Zn", "etc.", "ALK", "ALKB", "ALKC", "SOLID", "DOC", "TOC", "NO3") It seems a bit suspicious as you have et

Re: [R] Logistic Regression Fitting with EM-Algorithm

2011-01-10 Thread Ted Harding
In view of your further explanation, Robin, the best I can offer is the following. [1] Theoretical frame. *IF* variables (X1,X2,X3) are distributed according to a mixture of two multivariate normal distributions, i.e. as two groups, each with a multivariate normal distribution, *AND* the members o

[R] What happened to Rwiki?

2011-01-10 Thread kMan
Dear R-community, Rwiki is broken (well, some of the syntax is anyway). Anyone have some insight as to what is needed to fix it? Sincerely, KeithC. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the pos

[R] Looking for an Rmpi tutorial

2011-01-10 Thread Tena Sakai
Hi, I am looking for an Rmpi tutorial. Can someone please point me to a helpful tutorial? In particular, I am wanting to use mpi.spawn.Rslaves() function of Rmpi package. The difficulty I am having is that I want to use (arbitrary?) node on the local network. I am trying hosts argument of

Re: [R] Memory Needed for Regression

2011-01-10 Thread David Winsemius
On Jan 10, 2011, at 5:28 PM, efreeman wrote: I'm looking for a formula for memory usage in standard regression; that is, if I have X rows with Y predictors, how much memory is needed? I'm speccing out a system, and I'd like to be able to get enough memory that we can do some fairly large regr

Re: [R] Memory Needed for Regression

2011-01-10 Thread Doran, Harold
The size of the model matrix X can be estimated approximately. It depends on the kind of data in the model matrix. For instance, floating points require more memory than integers (which I think is 8 bits per cell). If your model matrix is sparse, you can use some hidden functions in the matrix p

[R] Memory Needed for Regression

2011-01-10 Thread efreeman
I'm looking for a formula for memory usage in standard regression; that is, if I have X rows with Y predictors, how much memory is needed? I'm speccing out a system, and I'd like to be able to get enough memory that we can do some fairly large regressions. ==Ed Freeman [[alternative HTML

Re: [R] Help with Data Transformation

2011-01-10 Thread Guy Jett
Thank you John, I have put a copy of the dput file below my signature block. I hope that is what you need as I am unfamiliar with that function. Note that empty cells need to become "NA". The "=" character is part of the "PARVALUE" column. Yours, Guy gj...@itsi.com structure(list(X = c(2268L,

Re: [R] ThinkCell type waterfall charts in R?

2011-01-10 Thread ang
I was actually looking to create a similar type of graph in R. But I guess I am going to try to approach it by using a stacked column chart and hiding the 'net' series, while only showing the increases/decreases in value. I'll post an update later on what I come up with. -- View this message i

[R] using Smolyak to genarate intervals

2011-01-10 Thread laleluia
Hello I am running a program from value intervals for a set of variables. I thought I could use Smolyak to get my intervals adding points as I need them , so instead of running the program for a whole interval I would run only for the most important points. I am new to Smolyak algorithm though, a

Re: [R] problem with packages

2011-01-10 Thread R Heberto Ghezzo, Dr
Hello, I am on a laptop with Win7, running R-2.12.1 if I click on Packages/InstallPackages I get : > utils:::menuInstallPkgs() Warning: unable to access index for repository http://cran.skazkaforyou.com/bin/windows/contrib/2.12 Warning: unable to access index for repository http://www.stats.ox.a

[R] Need help for interpreting the simulation results...

2011-01-10 Thread gokhanocakoglu
Hi all, I performed a simulation study on R for bootstrap, permutation and classic version of hotelling T^2 test. I aimed to compare 2 groups to see the performances of these tests for n= 20, 50, 100 and 500. For this reason I investigated type 1 error rates. I found that for n=20 type I error r

Re: [R] How to save the output of "split" command as series of .csv files

2011-01-10 Thread Dennis Murphy
Hi: This seems to work on the following toy example: df <- data.frame(gp = rep(LETTERS[1:6], each = 10), y = rnorm(60)) files <- paste('file', 1:6, '.csv', sep = '') mapply(write.csv, split(df, df$gp), file = files, MoreArgs = list(quote = FALSE, row.names = FALSE)) mapply() works h

Re: [R] How to save the output of "split" command as series of .csv files

2011-01-10 Thread Peter Ehlers
On 2011-01-10 12:56, menno wrote: Hello, I am looking for a way to quickly split a data frame containing daily temperature readings into a series of individual data frames, one for each year, in order to save them as individual .csv files which will be named according to Year. I would prefer no

Re: [R] Help with Data Transformation

2011-01-10 Thread John Kane
That sample data set is really hard to read. Could you resent it after having used dput on it? A file output with dput is easily read into R and makes seeing what you need much easier. BTW what are the = doing? Thanks --- On Mon, 1/10/11, Guy Jett wrote: > From: Guy Jett > Subject: [R

Re: [R] memory location of object?

2011-01-10 Thread Bert Gunter
?object.size -- Bert On Mon, Jan 10, 2011 at 11:16 AM, maddox wrote: > > Hi, > > I haven't found a way to display the memory location of an object in R. > Is there one? (I want to see whether some code 'grows' an object, and > an ever-changing memory location for the object would presumably conf

Re: [R] write.table equivalent for lists?

2011-01-10 Thread William Dunlap
serialize() and unserialize() in the base package should do the job also and are usually quite a bit faster than dput() and dget(). However, the format is not easily read by other programs. Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com > -Original Message- > From: r-help-boun.

Re: [R] debug biglm response error on bigglm model

2011-01-10 Thread Greg Snow
Not sure, but one possible candidate problem is that in your simulations one iteration ended up with fewer levels of a factor than the overall dataset and that caused the error. There is no recode function in the default packages, there are at least 6 recode functions in other packages, we cann

[R] How to save the output of "split" command as series of .csv files

2011-01-10 Thread menno
Hello, I am looking for a way to quickly split a data frame containing daily temperature readings into a series of individual data frames, one for each year, in order to save them as individual .csv files which will be named according to Year. I would prefer not to use a series of "subset" comman

Re: [R] memory location of object?

2011-01-10 Thread Martin Morgan
On 01/10/2011 11:16 AM, maddox wrote: > > Hi, > > I haven't found a way to display the memory location of an object in R. > Is there one? (I want to see whether some code 'grows' an object, and > an ever-changing memory location for the object would presumably confirm > this) For what you ask

[R] Help with Data Transformation

2011-01-10 Thread Guy Jett
Greetings, I am new to R and am having trouble with parsing a file with the following characteristics: * Individual results for a single sample are written to multiple lines. * First 16 columns are constant from sample to sample. * Remaining 10 need to be matched up (cro

Re: [R] how to run linear regression models at once

2011-01-10 Thread wangwallace
I am too negligent... thank you very much for pointing out that! -- View this message in context: http://r.789695.n4.nabble.com/how-to-run-linear-regression-models-at-once-tp3179256p3207823.html Sent from the R help mailing list archive at Nabble.com. ___

Re: [R] Logistic Regression Fitting with EM-Algorithm

2011-01-10 Thread Robin Aly
Dear Ted, sorry for being unclear. Let me try again. I indeed have no knowledge about the value of the response variable for any object. Instead, I have a data frames of explanatory variables for each object. For example, x1 x2 x3 1 4.409974 2.348745 1.9845313 2 3.809249 2

[R] Error: package 'akima' is not installed for 'arch=i386'

2011-01-10 Thread Carlos Montenegro
Dear R users, I am having problems loading the akima package. I use Windows XP, and R version 2.12.1. When I try to load the package I get this error message: Error: package 'akima' is not installed for 'arch=i386' Any help appreciated and thanks you for your time. Carlos Montenegro Silva Magí

[R] SQL & PL/SQL

2011-01-10 Thread Ramesh
Your email client cannot read this email. To view it online, please go here: http://email.careermailer.com:2020/display.php?M=161372&C=63b37a209d9dced6e8262a1862c616e4&S=552&L=5&N=559 To stop receiving these emails:http://email.careermailer.com:2020/unsubscribe.php?M=161372&C=63b37a209d9dced6e826

[R] memory location of object?

2011-01-10 Thread maddox
Hi, I haven't found a way to display the memory location of an object in R. Is there one? (I want to see whether some code 'grows' an object, and an ever-changing memory location for the object would presumably confirm this) Thanks m -- View this message in context: http://r.789695.n4.nabble

Re: [R] From vector to a step function

2011-01-10 Thread Greg Snow
?approxfun -- 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 Alaios > Sent: Monday, January 10, 2011 9:43 AM >

Re: [R] write.table equivalent for lists?

2011-01-10 Thread Greg Snow
How about dput and dget in the base package? -- 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 Rainer M Krug >

[R] Meaning of pterms in survreg object?

2011-01-10 Thread Johannes Huesing
I am trying to model survival data with a Weibull distribution using survreg. Units are clustered two apiece, sometimes receiving the same treatment and so

Re: [R] Assumptions for ANOVA: the right way to check the normality

2011-01-10 Thread Mike Marchywka
I can't get hotmail to indicate the original text so I'm going to top post. There seems to be a lot of back and forth here, let me see if these comment help guide discussion a bit. I tried to run some histograms of your experiment (prior to a bunch of other things ) and IIRC in many cases you h

Re: [R] how to run linear regression models at once

2011-01-10 Thread David Winsemius
On Jan 10, 2011, at 1:29 PM, wangwallace wrote: hey, Dennis, I applied your syntax into my data frame with different variable names. Specifically, I replaced y1 and y2, with ocbi and ocbo. I got the following error message. Could you please explain why would this happen? Again, thanks!

Re: [R] Error on loading libraries -

2011-01-10 Thread Brian Diggs
On 1/8/2011 12:29 PM, primozv wrote: Hello everyone! I'm working this school project in R and everything was fine until I moved to other computer. The problem is that I can't load few libraries like "Snowball" or "openNLP". Like I said, everything was fine on other computers, but at the moment

Re: [R] how to run linear regression models at once

2011-01-10 Thread wangwallace
hey, Dennis, I applied your syntax into my data frame with different variable names. Specifically, I replaced y1 and y2, with ocbi and ocbo. I got the following error message. Could you please explain why would this happen? Again, thanks! > for(i in 1:5){fm1<-as.formula(paste('ocbi',ms[i],sep='

[R] gamlss & multcomp

2011-01-10 Thread tdenes
Dear Experts, We conducted an experiment with 2 within-subject factors. We have very good reason to use gamlss, which works fine for our dataset, but unfortunately in the final model the vcov matrix can not be produced. This possibility is documented in the gamlss manual, but no hint is given how

Re: [R] Assumptions for ANOVA: the right way to check the normality

2011-01-10 Thread Greg Snow
What is the question you are really trying to find the answer for? Knowing that may help us give more meaningful answers. You keep wanting to test the residuals for normality, but it looks like you are doing it because some outdate recipe suggests it rather than that you understand why. It is

Re: [R] Evaluation of variable assigned to a function name

2011-01-10 Thread carol white
I want to make an abstraction of the parameters (assuming that they are unknown) for the user-defined function. Is it possible? In the bar function, if the user doesn't define any function, my.func will be invoked with known parameters (if part of the code). If the user defines his own functi

Re: [R] Evaluation of variable assigned to a function name

2011-01-10 Thread Uwe Ligges
On 10.01.2011 18:24, carol white wrote: If it doesn't make sense, how to invoke in the bar function, my.func with specified parameters with known values and how to invoke my.func.user if the user defines his own function (without specifying the parameters)? he arguments must be specified in

Re: [R] survval analysis microarray expression data

2011-01-10 Thread David Winsemius
On Jan 7, 2011, at 3:33 PM, Terry Therneau wrote: For any given pre-specified gene or short list of genes, yes the Cox model works fine. Two important caveats: 1. Remeber the rule of thumb for a Cox model of 20 events per variable (not n=20). Many microarray studies will have very marginal s

Re: [R] From vector to a step function

2011-01-10 Thread jim holtman
try this: > f.main <- function(vec){ + breaks <- seq(-3, by = 1, length = length(vec) + 1L) + function(x){ + indx <- findInterval(x, breaks) + vec[indx] + } + } > f1 <- f.main(c(3,4,5,1,2,3,4,5)) > f2 <- f.main(c(5,6,2,4,7,3,2,5)) > f3 <- f.main(c(1,2,4,7,3,1,3,5)) > >

Re: [R] select data for boxplot

2011-01-10 Thread Peter Ehlers
On 2011-01-10 07:38, David A. wrote: Dear list, havig the following matrix "Value" "Class" 13.001 12.801 11.781 11.702 11.612 11.952 11.552 12.403 11.401 12.271 12.493 11.394 11.804 12.393 12.723 12.183 11.643 11.504 12.81

Re: [R] replace values in array with means of certain values in array

2011-01-10 Thread Petr Savicky
On Mon, Jan 10, 2011 at 03:21:18PM +0100, joke R wrote: > Dear all, > > I have a problem with arrays. > Simplified, I have two arrays: > > A = > [,,1] > 1 2 3 > 4 5 6 > 7 8 9 > > [,,2] > 10 11 12 > 13 14 15 > 16 17 18 > > B= > 1 1 2 > 1 1 2 > 3 3 2 > > Basically,

Re: [R] Evaluation of variable assigned to a function name

2011-01-10 Thread carol white
If it doesn't make sense, how to invoke in the bar function, my.func with specified parameters with known values and how to invoke my.func.user if the user defines his own function (without specifying the parameters)? - Original Message From: Uwe Ligges To: carol white Cc: r-h...@st

Re: [R] Evaluation of variable assigned to a function name

2011-01-10 Thread Uwe Ligges
On 10.01.2011 16:41, carol white wrote: Note that I will call my function or user-defined function in bar function to have the value that my or user-defined function returns. So how can these function be invoked? Can it be like this? bar<- function(arglist, foo){ if(missing(foo)) {

[R] From vector to a step function

2011-01-10 Thread Alaios
Greetings R members. I have a few vectors that denote the 'steps' of different step functions v1=c(3,4,5,1,2,3,4,5) v2=c(5,6,2,4,7,3,2,5) v3=c(1,2,4,7,3,1,3,5) Here v1,v2,v3 are considered as the steps for the f1,f2,f3 step functions. For example f1 looks like that (step size is always same and

Re: [R] Using combn

2011-01-10 Thread Henrique Dallazuanna
Try this: combn(colnames(asd), 2, function(x)table(asd[x])) On Mon, Jan 10, 2011 at 2:34 PM, Patrick Hausmann < patrick.hausm...@uni-bremen.de> wrote: > Dear list, > > I want to apply the "table" function to every pair of variables in df and > the return should be a list. > > setwd(123) > asd <-

Re: [R] write.table equivalent for lists?

2011-01-10 Thread Peter Ehlers
On 2011-01-10 07:34, Rainer M Krug wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 01/10/2011 04:27 PM, Ivan Calandra wrote: I agree that the R-Core team has better things to do than that, but since it's already there, why not just add it to the base functions? Agree completely - and

[R] Using combn

2011-01-10 Thread Patrick Hausmann
Dear list, I want to apply the "table" function to every pair of variables in df and the return should be a list. setwd(123) asd <- data.frame(a1=sample(1:4, 20, replace=TRUE), a2=sample(1:4, 20, replace=TRUE), a3=sample(1:4, 20, replace=TRUE),

Re: [R] survval analysis microarray expression data

2011-01-10 Thread Unger, Kristian
Dear Terry thank you very much for this. The number of events in my data is well above the suggested size. What concerns me is the fact that a very high proportion of probes comes up as significant when I just randomly select them. This just seems not be biologically meaningful. Do you know of

[R] using Smolyak to genarate intervals

2011-01-10 Thread laleluia
Hello I am running a program from value intervals for a set of variables. I thought I could use Smolyak to get my intervals adding points as I need them , so instead of running the program for a whole interval I would run only for the most important points. I am new to Smolyak algorithm though, a

Re: [R] Basic ggplot question

2011-01-10 Thread baptiste auguie
On 10 January 2011 16:38, Santosh Srinivas wrote: > Thanks Baptiste that works but keen to know if there are other ways. > > I'm new to ggplot .. just wondering if there is no easy way to overlay the > new data i.e vol over my Close chart? Sure, ggplot2 has the concept of layers, qplot(Date, Clo

Re: [R] Evaluation of variable assigned to a function name

2011-01-10 Thread carol white
Note that I will call my function or user-defined function in bar function to have the value that my or user-defined function returns. So how can these function be invoked? Can it be like this? bar <- function(arglist, foo){ if(missing(foo)) { foo <- my.func v = my.func(

[R] select data for boxplot

2011-01-10 Thread David A.
Dear list, havig the following matrix "Value" "Class" 13.001 12.801 11.781 11.702 11.612 11.952 11.552 12.403 11.401 12.271 12.493 11.394 11.804 12.393 12.723 12.183 11.643 11.504 12.814 11.314 11.952 12.652

Re: [R] Basic ggplot question

2011-01-10 Thread Santosh Srinivas
Thanks Baptiste that works but keen to know if there are other ways. I'm new to ggplot .. just wondering if there is no easy way to overlay the new data i.e vol over my Close chart? -Original Message- From: baptiste auguie [mailto:baptiste.aug...@googlemail.com] Sent: 10 January 2011 18

Re: [R] write.table equivalent for lists?

2011-01-10 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 01/10/2011 04:27 PM, Ivan Calandra wrote: > I agree that the R-Core team has better things to do than that, but > since it's already there, why not just add it to the base functions? Agree completely - and R.utils is not such an obscure package whi

Re: [R] write.table equivalent for lists?

2011-01-10 Thread Ivan Calandra
I agree that the R-Core team has better things to do than that, but since it's already there, why not just add it to the base functions? Le 1/10/2011 16:19, Peter Ehlers a écrit : On 2011-01-10 06:45, Ivan Calandra wrote: Why isn't it in R base? Good question... I'm definitely not the one able

Re: [R] write.table equivalent for lists?

2011-01-10 Thread Peter Ehlers
On 2011-01-10 06:45, Ivan Calandra wrote: Why isn't it in R base? Good question... I'm definitely not the one able to answer to it! Maybe someone more involved in the development can? Ivan Well, I suspect that Rainer has been on this list long enough to know the answer: Because no has convince

Re: [R] how to wrap a long line in R scripts?

2011-01-10 Thread Jonathan P Daily
Oops! Good catch. I have been coding in python and R recently and now I'm mixing conventions ... R's automatic line wrapping and Python's auto-catenation given a line wrap (via '\'). A better solution would be: a <- paste("rey lo", "ong ch

Re: [R] how to wrap a long line in R scripts?

2011-01-10 Thread Keith Jewell
"Jonathan P Daily" wrote in message news:of588e803b.869e9aff-on85257814.004d298d-85257814.004d4...@usgs.gov... >a <- "rey lo >ong charrr" > > Although the indentation is just personal preference. > -- > J

Re: [R] Odp: Integration in R

2011-01-10 Thread Alaios
Thanks a lot :) Feeling embarassed ! Alex --- On Mon, 1/10/11, Petr PIKAL wrote: > From: Petr PIKAL > Subject: Odp: [R] Integration in R > To: "Alaios" > Cc: r-help@r-project.org > Date: Monday, January 10, 2011, 2:45 PM > Hi > > r-help-boun...@r-project.org > napsal dne 10.01.2011 15:12:33:

Re: [R] Integration in R

2011-01-10 Thread Ravi Varadhan
You are missing basic algebra skills! You had: myfunc<- function(x) {0.25*(9*x^4 + 6*x^2 + 1)} This should be: myfunc<- function(x) {0.25*(9*x^4 - 6*x^2 + 1)} Ravi. --- Ravi Varadhan, Ph.D. Assistant Professor, Division of Geriatric Medici

Re: [R] write.table equivalent for lists?

2011-01-10 Thread Ivan Calandra
Why isn't it in R base? Good question... I'm definitely not the one able to answer to it! Maybe someone more involved in the development can? Ivan Le 1/10/2011 15:42, Rainer M Krug a écrit : -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 01/10/2011 03:35 PM, Ivan Calandra wrote: Hi, If I u

[R] Odp: Integration in R

2011-01-10 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 10.01.2011 15:12:33: > Dear all, > > It has been ages since I studied integration in college. Right now I > try to recover all this kind of knowledge and then try to understand how > integration works. > > > > Thus I am doing some first 'experim

Re: [R] how to wrap a long line in R scripts?

2011-01-10 Thread Peter Ehlers
On 2011-01-10 02:36, Tutu2008 wrote: The guide of R Code style recommends to write script with a maximal length of 80 characters? how to break a line longer than 80 characters like filename_name<- ("/blaaa/"/ blaaa/data.csv") I would use

Re: [R] write.table equivalent for lists?

2011-01-10 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 01/10/2011 03:35 PM, Ivan Calandra wrote: > Hi, > > If I understood you correctly, you can use saveObject()/loadObject() > from package R.utils, like this: Correct - thanks - that is what I was looking for. But why is no such function in R base?

Re: [R] write.table equivalent for lists?

2011-01-10 Thread Ivan Calandra
Hi, If I understood you correctly, you can use saveObject()/loadObject() from package R.utils, like this: library(R.utils) saveObject(x, "x.Rbin") rm(x) y <- loadObject("x.Rbin") HTH, Ivan Le 1/10/2011 15:24, Rainer M Krug a écrit : -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi I am wr

[R] write.table equivalent for lists?

2011-01-10 Thread Rainer M Krug
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi I am writing simulations in R, and quite regularly, I have to save lists and objects to HDD and load it later again. So I am wondering: why is there no function to write lists (and S3, S4 objects) onto HDD WITHOUT keeping the name? What I mean is:

[R] replace values in array with means of certain values in array

2011-01-10 Thread joke R
Dear all, I have a problem with arrays. Simplified, I have two arrays: A = [,,1] 1 2 3 4 5 6 7 8 9 [,,2] 10 11 12 13 14 15 16 17 18 B= 1 1 2 1 1 2 3 3 2 Basically, B declares to which cluster the values of A belong to. Now I want an array C where for each cluster

Re: [R] how to wrap a long line in R scripts?

2011-01-10 Thread Jonathan P Daily
To elaborate, expressions and any explicit enclosures can also be simply split between lines. Often, this is done without space issues just for clarity. EX: vec <- c(LETTERS[1:5], 1:5, letters[1:5]) plot(X, Y, main = "A plot", xlab = "X Values", ylab = "Response", lty = 1,

[R] survival tree analysis using the rpart package

2011-01-10 Thread A.Grotenhuis
Dear Sir/Madam, I am a PhD student at the dept. of Epidemiology, Biostatistics and HTA of the Radboud University Nijmegen Medical Centre, Nijmegen, The Netherlands. My project is about the role of genetic variants in the prognosis of urinary bladder cancer. For my project, I'm currently analyzi

[R] Integration in R

2011-01-10 Thread Alaios
Dear all, It has been ages since I studied integration in college. Right now I try to recover all this kind of knowledge and then try to understand how integration works. Thus I am doing some first 'experiments' and I would like to request your help and comments. I have the function:

Re: [R] how to wrap a long line in R scripts?

2011-01-10 Thread Jonathan P Daily
a <- "rey lo ong charrr" Although the indentation is just personal preference. -- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 "Is the

Re: [R] Evaluation of variable assigned to a function name

2011-01-10 Thread Uwe Ligges
On 10.01.2011 14:56, carol white wrote: Let the following definitions: # my definition my.func<- function (x,y,z){ return (v) } # user-defined definition my.func<- function (x){ ... return(v) } Considering that my.func can have different parameters but always return a vector, how to us

[R] how to create and manage a matrix with vector of different length

2011-01-10 Thread zhaoxing731
Hello I have a data consisting of 245 counties, including the population, number of illness and the geographical information of each county. Fixing each county, I want to sort the other county by distance, which can make a 245*245 matrix with each cell is the corresponding index of the c

Re: [R] Changing a logical matrix into a numeric matrix

2011-01-10 Thread djhurio
Nice solution :) Another one: m <- matrix(c(T,T,F,T),nr=2) m matrix(as.integer(m), dim(m)) - -- http://djhurio.wordpress.com/ http://twitter.com/djhurio http://www.linkedin.com/in/martinsliberts http://www.csb.gov.lv/ -- View this message in context: http://r.789695.n4.nabble.com/Chang

[R] debug biglm response error on bigglm model

2011-01-10 Thread Mike Harwood
G'morning What does the error message "Error in x %*% coef(object) : non- conformable arguments" indicate when calculating the response values for newdata with a model from bigglm (in package biglm), and how can I debug it? I am attempting to do Monte Carlo simulations, which may explain the loop

Re: [R] Changing a logical matrix into a numeric matrix

2011-01-10 Thread emj83
Thanks for everyone's suggestionsI didn't realise it was so straightforward- thanks for teaching me new tricks! Emma -- View this message in context: http://r.789695.n4.nabble.com/Changing-a-logical-matrix-into-a-numeric-matrix-tp3206797p3206844.html Sent from the R help mailing list archiv

Re: [R] Shortcut key to get to beginniing of line in R?

2011-01-10 Thread djhurio
Isn't Ctrl+a used for "select all" in R GUI (under Windows)? Ctrl+e does not work for me. What editor are you using? - -- http://djhurio.wordpress.com/ http://twitter.com/djhurio http://www.linkedin.com/in/martinsliberts http://www.csb.gov.lv/ -- View this message in context: http://r.7896

Re: [R] Shortcut key to get to beginniing of line in R?

2011-01-10 Thread DrorD
djhurio wrote: > > Isn't Ctrl+a used for "select all" in R GUI (under Windows)? Ctrl+e does > not work for me. What editor are you using? > The general question seems to refer to the case of running R console directly from your operating-system's prompt-line (e.g. C:\). Well, if you are usin

[R] how to wrap a long line in R scripts?

2011-01-10 Thread Tutu2008
The guide of R Code style recommends to write script with a maximal length of 80 characters? how to break a line longer than 80 characters like filename_name <- ("/blaaa/"/ blaaa/data.csv") I did not find any answer while googling. Thank y

Re: [R] Evaluation of variable assigned to a function name

2011-01-10 Thread carol white
Let the following definitions: # my definition my.func <- function (x,y,z){ return (v) } # user-defined definition my.func <- function (x){ ... return(v) } Considering that my.func can have different parameters but always return a vector, how to use v in bar by initializing parameters whe

Re: [R] Evaluation of variable assigned to a function name

2011-01-10 Thread Uwe Ligges
On 10.01.2011 14:39, carol white wrote: In fact, what the function is returning is the most important. So knowing that the parameters and the number of parameters of my.func defined by the user could be different from one definition to another, how to use what my.func returns in other functions

  1   2   >