[R] kalaii...@gmail.com

2009-11-03 Thread kalaiinfo
i am using R, haplo.stats package. i am working in liux, redhat 5. I run this many times, but suddenly its showing 0xf42418, cause 'memory not mapped'. i run again again its showing the same problem. Can you help me to solve the problem. thank you in advance kalai ___

Re: [R] Plotting an interaction with error bars

2009-11-03 Thread Dror D Lev
Thank you Jim. brkdn.plot() seems to be just the function I need. Still, I wonder if there are lists of labels of the different measures of central tendency (mct argument) and measures of dispersion (md)? dror - On Wed, Nov 4, 2009 at 7:41 AM, Jim Lemon wrote: > On

Re: [R] how can I convert .csv format to matrix???

2009-11-03 Thread bbslover
thank you for your help,it is a good way. Steven Kang wrote: > > can try > > matrix.x <- as.matrix(x) > > On Mon, Nov 2, 2009 at 8:38 PM, bbslover wrote: > >> >> In my disk C:/ have a a.csv file, I want to read it to R, importantly, >> when >> I use x=read.csv("C:/a.csv") ,the x format

Re: [R] [R-SIG-Finance] Sequential MLE on time series with rolling window

2009-11-03 Thread Ajay Shah
On Tue, Nov 03, 2009 at 11:54:52PM -0500, R_help Help wrote: > Hi, > > Assuming I have a time series on which I will perform rolling-window > MLE. In other words, if I stand at time t, I'm using points t-L+1 to t > for my MLE estimate of parameters at time t (here L is my rolling > window width).

Re: [R] R 2.10.0: Error in gsub/calloc

2009-11-03 Thread Richard R. Liu
I am using gsubfn 0.5-0. When I do not specify perl = TRUE I now get the following error on the same document: Error in structure(.External("dotTcl", ..., PACKAGE = "tcltk"), class = "tclObj") : [tcl] bad index "1e+05": must be integer?[+-]integer? or end? [+-]integer?. Regards, Richard

[R] simulated data

2009-11-03 Thread assaedi76 assaedi76
R users. Thanks in advance.   I would  be glad if someone could tell me how to get a simulated data from AR(1), MA(1)   My email is : assaed...@yahoo.com    Thanks [[alternative HTML version deleted]] __ R-help@r-project.org mailing l

Re: [R] R 2.10.0: Error in gsub/calloc

2009-11-03 Thread Prof Brian Ripley
This seems to be simply integer overflow in a calculation. Changed in R-patched to use doubles. The issue I patched for Kenneth Roy Cabrera was for perl = FALSE only. On Tue, 3 Nov 2009, William Dunlap wrote: Here is a more self-contained way to reproduce the problem in 2.10.0 using the prebui

Re: [R] one long column of data -> three small columns

2009-11-03 Thread Patrick Connolly
On Tue, 03-Nov-2009 at 12:26PM -0800, frenchcr wrote: |> > How do i do this? |> > |> |> ok, so matrix(x, 3, 3) works. |> |> what if i have |> |> a |> b |> c |> a |> c |> a |> c |> |> and want |> |> a b c |> a c |> a c |> |> ?? Hint 1: A matrix can use characters or numerics Hint 2: "

Re: [R] RandomForest & PMML

2009-11-03 Thread Graham Williams
2009/11/4 NCS : > I cannot seem to write a randomforest model in PMML - either through calling > PMML(model) or through Rattle.  It appears that it is not yet supported. > Randomsurvivalforest is, but not randomforest.  Any ideas on possible > workarounds for this? > > Thanks > ncs It is not yet i

Re: [R] Plotting an interaction with error bars

2009-11-03 Thread Jim Lemon
On 11/03/2009 10:15 PM, Dror D Lev wrote: Hello. I need to plot a two-way interaction (5 levels X 3) with error bars. The x.factor will be the five-levels var and the trace.factor will be the three level var. I was able to find functions that draw error bars, but still couldn't find a way to dr

[R] Join points with arrows based a TIME variable

2009-11-03 Thread zhijie zhang
Hi, I have a data set with three variables,X Y and Time. X and Y are the coordinates of points, i want to join these points according to the Time sequence using arrows? Demo Example data: > x<-c(1:6) > y<-c(1:6) > time<-c(6:1) > data<-cbind(x,y,time) > data x y time [1,] 1 16 [2,] 2 2

[R] Conditional read-in of data

2009-11-03 Thread mnstn
Hello All, I have a 40k rows long data set that is taking a lot of time to be read-in. Is there a way to skip reading even/odd numbered rows or read-in only rows that are multiples of, say, 10? This way I get the general trend of the data w/o actually reading the entire thing. The option 'skip' in

[R] Sequential MLE on time series with rolling window

2009-11-03 Thread R_help Help
Hi, Assuming I have a time series on which I will perform rolling-window MLE. In other words, if I stand at time t, I'm using points t-L+1 to t for my MLE estimate of parameters at time t (here L is my rolling window width). Next, at t+1, I'll do the same. My question is that is there anyway to a

Re: [R] bargraph.ci - CI and color question.

2009-11-03 Thread Michael Just
Thank you. On Tue, Nov 3, 2009 at 3:08 PM, Manuel Morales wrote: > On Tue, 2009-11-03 at 10:20 -0600, Michael Just wrote: >> Hello, >> >> Thanks for the responses.  Yes, I did try to use ?bargraph.CI for the >> colors. When I said bars,  I meant the main bars on the graph not the >> error bars. H

Re: [R] R 2.10.0: Error in gsub/calloc

2009-11-03 Thread Gabor Grothendieck
Note that you don't need perl = T since by default strapply uses tcl regular expressions and they support \w. What happens if you omit the perl = T? Also please specify the version of gsubfn you are using and if its not the latest then try it with the latest version. On Tue, Nov 3, 2009 at 11:0

Re: [R] R 2.10.0: Error in gsub/calloc

2009-11-03 Thread William Dunlap
Here is a more self-contained way to reproduce the problem in 2.10.0 using the prebuilt Windows executable. Putting a trace on gsub in the call to strapply showed that it died in the first call to gsub when the replacement included "\\1" and the string was about 90 characters long (and include

Re: [R] help with SSOAP (can't find working examples)

2009-11-03 Thread Duncan Temple Lang
Hi Steffen et al. The development version of SSOAP and XMLSchema I have on my machine does complete the processWSDL() call without errors. I have to finish off some tests before releasing these. It may take a few days before I have time to work on this, but hopefully soon. Thanks for the info.

Re: [R] Stacked barplot: specifying individual bar hue/luminance

2009-11-03 Thread Uwe Ligges
chaski01 wrote: Hi all, I'm trying to generate barplots from simple but long (~10-row) data files, in which each bar will comprise two stacked 'sub-bars'. All the upper sub-bars will have the same hue, and all the lower bars will, likewise, have another uniform hue. However, I wish to sp

Re: [R] R 2.10.0: Error in gsub/calloc

2009-11-03 Thread Richard R. Liu
Kenneth, Thanks for the hint. I downloaded and installed the latest patch, but to no avail. I can reproduce the error on a single sentence, the longest in the document. It contains 743,393 characters. It isn't a true sentence, but since it is more than three standard deviations longer

Re: [R] "object not found" within function

2009-11-03 Thread Thushyanthan Baskaran
Hi Thomas, sorry, I should have mentioned that I was using the survey package. But thank you very much for your quick response. Your first solution worked perfectly. Best, Thushyanthan tlum...@u.washington.edu wrote: On Mon, 2 Nov 2009, Thushyanthan Baskaran wrote: Hi, I am trying to

[R] Revolutions blog: October roundup

2009-11-03 Thread David M Smith
I write about R every weekday at the Revolutions blog: http://blog.revolution-computing.com . In case you missed them, here are some articles from last month of particular interest to R users. http://bit.ly/16wIdo offered a sneak peek of the debugger we've since released for subscribers of REvolu

[R] reshaping pairs of columns

2009-11-03 Thread Michael Friendly
Given a data frame consisting of a pointID and 12 pairs of (lat, long) variables, with names latA, longA, latB, longB, ... latL, longL, I want to reshape it into a data frame with the structure point source lat long 1A ... ... 1B ...... I've looked at resha

Re: [R] avoiding loop

2009-11-03 Thread parkbomee
Thanks for your help. > Date: Mon, 2 Nov 2009 18:50:42 -0500 > Subject: Re: [R] avoiding loop > From: jholt...@gmail.com > To: bbom...@hotmail.com > CC: mtmor...@fhcrc.org; r-help@r-project.org > > The first thing I would suggest is convert your dataframes to matrices > so that you are not hav

Re: [R] Weird operator behaviour

2009-11-03 Thread Jorge Ivan Velez
Hi Jim, Take a look at ?"%in%", especially its first example. HTH, Jorge On Tue, Nov 3, 2009 at 5:02 PM, jimdare <> wrote: > > Hi, > > I have a dataset called 'fish'. fish$Species returns extract 1. When I > use > fish$Species != c("CRA","PHC"), i.e. I want all species except "CRA" and > "PH

[R] Two questions about cloud().

2009-11-03 Thread Rolf Turner
(1) Is there a (simple) way of getting cloud() to do *both* type="p" and type="h"? I.e. of getting it to plot the points as points *and* drop a perpendicular line to the underlying plane? (2) Is there a way of telling cloud() to drop its lines to the floor of the bounding box, rather than to t

Re: [R] reshaping pairs of columns

2009-11-03 Thread jim holtman
Try this: > require(reshape) > # melt the data > x <- melt(maps, id='point') > # split out the labels > labels <- do.call(rbind, strsplit(sub("(.*)(.)", "\\1 \\2", x$variable), ' ')) > x$source <- labels[, 2] > x$variable <- labels[, 1] > cast(x, point + source ~ variable) point sourcelat

[R] Setting column widths in heatmap

2009-11-03 Thread Ken Termiso
Hello, I cannot figure out how to set the column widths (either relative or absolute) for the heatmap function - the full manual hints that layout and lcm will control this, but I haven't had any luck. This is in R 2.9.2 compiled for either FC10 or SUSE11.1 (x86_64)... and am sending the out

[R] Weird operator behaviour

2009-11-03 Thread jimdare
Hi, I have a dataset called 'fish'. fish$Species returns extract 1. When I use fish$Species != c("CRA","PHC"), i.e. I want all species except "CRA" and "PHC", I get extract 2 which is blatantly wrong. Can anyone see what I'm doing wrong? Regards, James EXTRACT 1 > fish$Species [1] ALB

Re: [R] reshaping pairs of columns

2009-11-03 Thread Phil Spector
Michael - I think this call to reshape gets you pretty close: reshape(maps,direction='long', + varying=list(grep('lat',names(dat),value=TRUE), + grep('long',names(dat),value=TRUE)), + times=LETTERS[1:12]) point time latA longA id 1.A 1A 4

Re: [R] R 2.10.0: Error in gsub/calloc

2009-11-03 Thread Bert Gunter
Try: tokens <- strsplit(d,"[^[:space:]]+") This splits each "sentence" in your vector into a vector of groups of whitespace characters that you can then play with as you described, I think (The results is a list of such vectors -- see strsplit()). ## example: > x <- "xx xdfg; *&^%kk" > st

Re: [R] R 2.10.0: Error in gsub/calloc

2009-11-03 Thread Richard R. Liu
I apologize for not being clear. d is a character vector of length 158908. Each element in the vector has been designated by sentDetect (package: openNLP) as a sentence. Some of these are really sentences. Others are merely groups of meaningless characters separated by white space. str

Re: [R] one long column of data -> three small columns

2009-11-03 Thread Jorge Ivan Velez
Hi french, Here is a suggestion: x <- c(2, 3, 4, 2, 1, 6, 6, 4, 7) matrix(x, ncol = 3) # [,1] [,2] [,3] # [1,]226 # [2,]314 # [3,]467 with x the column of data you have. HTH, Jorge On Tue, Nov 3, 2009 at 2:05 PM, frenchcr <> wrote: > > say i have a colu

Re: [R] creating mulptiple new variables from one data.frame according to columns and rows in that frame

2009-11-03 Thread jim holtman
try this: > x <- read.table(textConnection(" Age(yrs) country mu sigma + 1 0. Bolivia 11.42168 0.1014872 + 2 0.0833 Bolivia 11.33625 0.1053837 + 3 0.1667 Bolivia 11.28417 0.1070594 + 4 0.2500 Bolivia 11.21125 0.1083872 + 5 0. Boliv

Re: [R] need help in using Hessian matrix

2009-11-03 Thread Uwe Ligges
Laila Alkhalfan wrote: Hi I need to find the Hessian matrix for a complicated function from a certain kind of data but i keep getting this error Error in f1 - f2 : non-numeric argument to binary operator the data is given by U<-runif(n) Us<-sort(U) tau1<- 2

Re: [R] "object not found" within function

2009-11-03 Thread Uwe Ligges
Thushyanthan Baskaran wrote: Hi, I am trying to write a function to compute many cross-tabulations with the -svytable- command. Here is a simplified example of the structure of my code (adapted from the -svytable- help file): data(api) func.example<-function(variable){ dclus1<-svydesign(

Re: [R] bargraph.ci - CI and color question.

2009-11-03 Thread Manuel Morales
On Tue, 2009-11-03 at 10:20 -0600, Michael Just wrote: > Hello, > > Thanks for the responses. Yes, I did try to use ?bargraph.CI for the > colors. When I said bars, I meant the main bars on the graph not the > error bars. However, this "col=c("color", "color")" is what I was > needed and while i

Re: [R] Create Artificial Binary Matrix based on probability

2009-11-03 Thread Tony Plate
x <- matrix(sample(0:1, 1200, replace=T, prob=c(0.952, 0.048)), ncol=30) table(x) x 01 1131 69 x <- matrix(sample(0:1, 1200, replace=T, prob=c(0.952, 0.048)), ncol=30) table(x) x 01 1151 49 bikemike42 wrote: Dear All, I am trying to create an artificial binary matrix

[R] one long column of data -> three small columns

2009-11-03 Thread frenchcr
say i have a column of data like this... 2 3 4 2 1 6 6 4 7 and i want it in three columns like this 226 314 467 ...so i can make a contour plot. How do i do this? -- View this message in context: http://old.nabble.com/one-long-column-of-data--%3E-three-small-columns-tp26163165p26163165.htm

Re: [R] one long column of data -> three small columns

2009-11-03 Thread Jorge Ivan Velez
Hi french, Here is a suggestion: x <- c(2, 3, 4, 2, 1, 6, 6, 4, 7) matrix(x, ncol = 3) # [,1] [,2] [,3] # [1,]226 # [2,]314 # [3,]467 HTH, Jorge On Tue, Nov 3, 2009 at 2:05 PM, frenchcr <> wrote: > > say i have a column of data like this... > > 2 > 3 > 4

[R] Maximum Likelihood Estimation

2009-11-03 Thread Andre Barbosa Oliveira
Hi, I would like estimate a model for function of production's Coob-Douglas using maximum likelihood. The model is log(Y)= beta[1]+beta[2]*log(L)+beta[3]*log(K). I tried estimate this model using the tools nlm ( ) and optim ( ) using the log-likelihood function below: > mloglik <- fu

[R] odfweave table styles

2009-11-03 Thread Colin Robertson
Hello List, Does anyone have examples of custom formatting of tables in odfweave? I know there is an example of this in the formatting.odt file that comes with the package, but running that through odfweave gives the following error: Error: chunk 13 (label=showTableStyles) Error in names(x) <- v

[R] multivariate numerical integration.

2009-11-03 Thread Jeroen Ooms
I am currently using the package 'adapt' for multivariate integration. However this package seems to be removed from CRAN (It is still referred to in the help file for integrate(stats) though). I assume it has been deprecated for a reason? Is there an alternative for multivariate numerical integr

Re: [R] reference on p.adjust()

2009-11-03 Thread Marc Schwartz
On Nov 3, 2009, at 2:52 PM, Peng Yu wrote: 2009/11/3 Uwe Ligges : Peng Yu wrote: I'm wondering if there is a textbook that summarize the methods on adjusting p-values for multiple comparisons. Most of the references on p.adjust() are over 10 years old. Being 10 years old does not mean

Re: [R] one long column of data -> three small columns

2009-11-03 Thread frenchcr
frenchcr wrote: > > say i have a column of data like this... > > 2 > 3 > 4 > 2 > 1 > 6 > 6 > 4 > 7 > > and i want it in three columns like this > > 226 > 314 > 467 > > ...so i can make a contour plot. > > > How do i do this? > ok, so matrix(x, 3, 3) works. what if i have a b c a c a

Re: [R] Passing Command to Optim in factanal

2009-11-03 Thread Ravi Varadhan
Hi, The function `factanal' calls `factanal.fit.mle' to perform the likelihood maximization. You can take a look at this function by saying: getAnywhere("factanal.fit.mle") If you do this, you will see that there is a call to `optim' and there you will see that the only method used is "L-BFGS-B"

Re: [R] how to display a string containing greek chrs and variables

2009-11-03 Thread Peter Ehlers
j.delashe...@ed.ac.uk wrote: Quoting Peter Ehlers : j.delashe...@ed.ac.uk wrote: Quoting baptiste auguie : Hi, try this, plot.new() x=0.8 text(0.5, 0.5, bquote(rho == .(x))) HTH, baptiste Aha! That does exactly what i wanted! Thanks! Jose But does it do what it should? It's custo

Re: [R] one long column of data -> three small columns

2009-11-03 Thread Peter Alspach
Tena koe ?matrix The exact syntax will depend on the class of your 'column of data'. If it is a dataframe, for example, then try matrix(yourData[,1], 3, 3) HTH ... Peter Alspach > -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Be

Re: [R] package lme4

2009-11-03 Thread Douglas Bates
On Tue, Nov 3, 2009 at 9:11 AM, wenjun zheng wrote: > May be I can calculate p value by t testing approximately: >  1-qnorm(Variance/Std.Dev.) That would be a z test, not a t test, wouldn't it? And it would only be meaningful if the distribution of the estimator is approximately normal, which we

Re: [R] how to display a string containing greek chrs and variables

2009-11-03 Thread J . delasHeras
Quoting Peter Ehlers : j.delashe...@ed.ac.uk wrote: Quoting baptiste auguie : Hi, try this, plot.new() x=0.8 text(0.5, 0.5, bquote(rho == .(x))) HTH, baptiste Aha! That does exactly what i wanted! Thanks! Jose But does it do what it should? It's customary to use "rho" for a _popul

Re: [R] package lme4

2009-11-03 Thread Douglas Bates
On Tue, Nov 3, 2009 at 8:08 AM, wenjun zheng wrote: > Thanks,Douglas, > It really helps me a lot, but is there any other way if I want to show > whether a random effect is significant in text file, like P value or other >  index. > Thanks very much again. > Wenjun. Well there are p-values from th

Re: [R] Re place only first NA in column

2009-11-03 Thread Mike Treglia
Erik and Steve, Thanks again for your help, both solutions do exactly what I need. Cheers, Mike Steve Lianoglou wrote: Hi, On Nov 3, 2009, at 3:58 PM, bikemike42 wrote: Dear All, I am trying to fill in a blank vector ("a") with one value at a time, with the value of the number of rows in

Re: [R] OpenOffice Calc ODBC equivalent (SOLVED)

2009-11-03 Thread Kenneth Roy Cabrera Torres
Thank you Dr. Schwartz: I did not read this post before, > See this post from late 2007: > >http://tolstoy.newcastle.edu.au/R/e3/help/07/12/6478.html > > As far as I know, nothing has changed vis-a-via ODBC connectivity TO > OpenOffice files. You can use ODBC FROM OpenOffice to connect to

Re: [R] design matrix construction question

2009-11-03 Thread Greg Snow
Try this: dd$i <- with(dd,interaction(z,x>0)) contrasts(dd$i,2) <- rbind( c(0,0),c(0,0),c(1,0),c(0,1) ) model.matrix( ~i, dd )[,-1] -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -Original Message- > From: r-help-bou

[R] ROC

2009-11-03 Thread carol white
My question would be related more to time-dependent ROC (survivalROC package): I would like to know how true positives (TP) and false positives (FP) are related to the order of survival times and diagnostic markers. That is, having the a set of TP and FP, each of them is calculated from which di

[R] Re place only first NA in column

2009-11-03 Thread bikemike42
Dear All, I am trying to fill in a blank vector ("a") with one value at a time, with the value of the number of rows in a randomized dataset with rowSums=0. Below is the code I've got so far, but what I want to be as the last line is " a[1st NA,]=nz" such that this will run until all of my NAs a

[R] Passing Command to Optim in factanal

2009-11-03 Thread Ali Torkamani
Hi, I am currently trying to execute the following command: f<-factanal(factors=k$Components$nparallel,covmat=m,n.obs=2287,rotation="varimax",control=list(opt=list(method=c("BFGS" but keep getting the error: L-BFGS-B needs finite values of 'fn' I can't figure out what I am doing wrong here,

[R] Create Artificial Binary Matrix based on probability

2009-11-03 Thread bikemike42
Dear All, I am trying to create an artificial binary matrix such that each cell has a probability of 0.048 of having a 1. So far the closest I've come is us by using a random poisson distribution with a mean of 0.048, but I can't figure out how to limit the max value to 1. Otherwise that would

Re: [R] "object not found" within function

2009-11-03 Thread tlumley
On Mon, 2 Nov 2009, Thushyanthan Baskaran wrote: Hi, I am trying to write a function to compute many cross-tabulations with the -svytable- command. Here is a simplified example of the structure of my code (adapted from the -svytable- help file): In the 'survey' package -- if you say what pa

[R] Create Artificial Binary Matrix based on probability

2009-11-03 Thread bikemike42
Dear All, I am trying to create an artificial binary matrix such that each cell has a probability of 0.048 of having a 1. So far the closest I've come is us by using a random poisson distribution with a mean of 0.048, but I can't figure out how to limit the max value to 1. Otherwise that would

Re: [R] Issue with %in% - not matching identical rows in data frames

2009-11-03 Thread Charles C. Berry
Kaushik, The documentation doesn't quite tell (me, anyway) how the function behaves when 'target' is a list (or data.frame). You'll need to dig into match.c or experiment with match() or %in% to see what it is actually doing. But it looks like it is matching whole columns of the data.frame

Re: [R] Create Artificial Binary Matrix based on probability

2009-11-03 Thread Mike Treglia
Thanks a lot Erik and Tony! Both of your suggestions accomplish what I need. Cheers, Mike Erik Iverson wrote: Try matrix(rbinom(100, 1, prob = 0.048), nrow = 10) -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of bikemike42

Re: [R] help with SSOAP (can't find working examples)

2009-11-03 Thread Steffen Neumann
Hi, I can confirm this, just today I tried to write a web service client. Affected are both SSOAP-0.5-4 and SSOAP_0.4-6. I can't access anonymous CVS atm. to check for recent fixes. I am unable to map the error message to any of the items in http://www.omegahat.org/SSOAP/Todo.html , is this alr

Re: [R] Re place only first NA in column

2009-11-03 Thread Steve Lianoglou
Hi, On Nov 3, 2009, at 3:58 PM, bikemike42 wrote: Dear All, I am trying to fill in a blank vector ("a") with one value at a time, with the value of the number of rows in a randomized dataset with rowSums=0. Below is the code I've got so far, but what I want to be as the last line is "

Re: [R] Weird operator behaviour

2009-11-03 Thread Peter Alspach
Tena koe James Have you tried something like !fish$Species%in%c('CRA','PHC')? HTH Peter Alspach > -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of jimdare > Sent: Wednesday, 4 November 2009 11:02 a.m. > To: r-help@r-proj

Re: [R] Weird operator behaviour

2009-11-03 Thread Erik Iverson
Argument recycling is coming into play here with !=. I am guessing you want ! fish$Species %in% c("CRA", "PHC") ? Best Regards, Erik Iverson > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of jimdare > Sent: Tuesday, November

Re: [R] lmer and estimable

2009-11-03 Thread Park-Ng, Zaneta
Hi Ista, Thanks so much :-) I hadn't clicked that mcmc sampling was used to determine the estimates! Now it all makes sense! Do you know if one would one usually test out several values of nsim to find a number which is high enough that different runs get very similar results? And do you kn

Re: [R] R 2.10.0: Error in gsub/calloc

2009-11-03 Thread Kenneth Roy Cabrera Torres
Try the patch version... Maybe is the same problem I had with large database when using gsub() HTH El mar, 03-11-2009 a las 20:31 +0100, Richard R. Liu escribió: > I apologize for not being clear. d is a character vector of length > 158908. Each element in the vector has been designated by s

Re: [R] Create Artificial Binary Matrix based on probability

2009-11-03 Thread Erik Iverson
Try matrix(rbinom(100, 1, prob = 0.048), nrow = 10) > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of bikemike42 > Sent: Tuesday, November 03, 2009 11:49 AM > To: r-help@r-project.org > Subject: [R] Create Artificial Binary Ma

Re: [R] reference on p.adjust()

2009-11-03 Thread Uwe Ligges
Peng Yu wrote: 2009/11/3 Uwe Ligges : Peng Yu wrote: I'm wondering if there is a textbook that summarize the methods on adjusting p-values for multiple comparisons. Most of the references on p.adjust() are over 10 years old. Being 10 years old does not mean the calculus behind those methods

[R] Help with R and Webserver (SOAP)

2009-11-03 Thread Ravi Chandra
Hello all... We are trying to use the analytical power of R in a Web based environment, and are seeking the optimal ways of accomplishing the same. We need R to accept requests from clients, perform analysis on the data as required by the users and return the results ( formatted text, graphs, etc)

Re: [R] Re place only first NA in column

2009-11-03 Thread Erik Iverson
Mike, Is this what you're trying to do, it avoids the awkward use of a while loop, taking advantage of the ability to vectorize R functions. fun <- function() { z <- matrix(rbinom(832, 1, prob = 0.048), nrow = 32) sum(rowSums(z) == 0) } a <- as.matrix(replicate(1000, fun())) > -Orig

Re: [R] R 2.10.0: Error in gsub/calloc

2009-11-03 Thread Uwe Ligges
richard@pueo-owl.ch wrote: I'm running R 2.10.0 under Mac OS X 10.5.8; however, I don't think this is a Mac-specific problem. I have a very large (158,908 possible sentences, ca. 58 MB) plain text document d which I am trying to tokenize: t <- strapply(d, "\\w+", perl = T). I am encounte

Re: [R] reference on p.adjust()

2009-11-03 Thread Uwe Ligges
Peng Yu wrote: I'm wondering if there is a textbook that summarize the methods on adjusting p-values for multiple comparisons. Most of the references on p.adjust() are over 10 years old. Being 10 years old does not mean the calculus behind those methods has changed. I feel it would be b

Re: [R] reference on p.adjust()

2009-11-03 Thread Peng Yu
2009/11/3 Uwe Ligges : > > > Peng Yu wrote: >> >> I'm wondering if there is a textbook that summarize the methods on >> adjusting p-values for multiple comparisons. Most of the references on >> p.adjust() are over 10 years old. > > Being 10 years old does not mean the calculus behind those methods

Re: [R] AR Simulation with non-normal innovations - Correct

2009-11-03 Thread Ricardo Gonçalves Silva
Thanks Andreas. This is just the start point I was needing. Best, Rick From: Andreas Hary Sent: Tuesday, November 03, 2009 7:19 AM To: Ricardo Gonçalves Silva Subject: Re: [R] AR Simulation with non-normal innovations - Correct Have a look at function arima.sim. It allows you to specify a r

Re: [R] Issue with %in% - not matching identical rows in data frames

2009-11-03 Thread Sundar Dorai-Raj
?"%in%" says "x" and "table" must be vectors. You supplied data.frames. So %in% is coercing your today.sequence to a vector using as.character(today.sequence) Perhaps you should paste the columns together first: x <- do.call("paste", c(sequence, sep = "::")) table <- do.call("paste", c(today.seq

[R] Stacked barplot: specifying individual bar hue/luminance

2009-11-03 Thread chaski01
Hi all, I'm trying to generate barplots from simple but long (~10-row) data files, in which each bar will comprise two stacked 'sub-bars'. All the upper sub-bars will have the same hue, and all the lower bars will, likewise, have another uniform hue. However, I wish to specify the luminance

[R] R 2.10.0: Error in gsub/calloc

2009-11-03 Thread richard . liu
I'm running R 2.10.0 under Mac OS X 10.5.8; however, I don't think this is a Mac-specific problem. I have a very large (158,908 possible sentences, ca. 58 MB) plain text document d which I am trying to tokenize: t <- strapply(d, "\\w+", perl = T). I am encountering the following error: Error in

[R] Issue with %in% - not matching identical rows in data frames

2009-11-03 Thread Kaushik Krishnan
Hi folks I have two data frames. I know that the nth (let's say the 7th) row in the first data frame (sequence) is there in the second (today.sequence). When I try to check that by doing 'sequence[7,] %in% today.sequence', I get all FALSE when it should be all TRUE. I'm certain I'm making some

[R] Stacked barplot: specifying individual bar hue/luminance

2009-11-03 Thread chaski01
Hi all, I'm trying to generate barplots from simple but long (~10-row) data files, in which each bar will comprise two stacked 'sub-bars'. All the upper sub-bars will have the same hue, and all the lower bars will, likewise, have another uniform hue. However, I wish to specify the luminance

[R] creating mulptiple new variables from one data.frame according to columns and rows in that frame

2009-11-03 Thread Hayes, Daniel
Dear R-helpers, I have a data.frame (bcpe.lat.m) containing 13 countries, ages 0-50yrs per month, and the corresponding mu&sigma (see below). *I would like to limit the age range to include all 12 months for the 1st 5 years and only whole years for all ages thereafter for each of the c

Re: [R] how to display a string containing greek chrs and variables

2009-11-03 Thread Peter Ehlers
j.delashe...@ed.ac.uk wrote: Quoting baptiste auguie : Hi, try this, plot.new() x=0.8 text(0.5, 0.5, bquote(rho == .(x))) HTH, baptiste Aha! That does exactly what i wanted! Thanks! Jose But does it do what it should? It's customary to use "rho" for a _population_ correlation coeffi

Re: [R] about the cox result

2009-11-03 Thread Terry Therneau
To extract various portions of the coxph standard printout, look at summary.coxph help('summary.coxph') fit <- coxph(... sfit <- summary(fit) Terry Therneau __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do r

Re: [R] How to display full name for the coefficients/factors in summary()?

2009-11-03 Thread Kingsford Jones
By default orthogonal polynomial contrasts are used for ordered factors. Drop the 'ordered = TRUE' and you will get treatment contrasts. hth, Kingsford Jones On Tue, Nov 3, 2009 at 8:52 AM, Jen-Chien Chang wrote: > Hi, > > I am wondering if there is a way to display the full anme of the regressi

[R] Invitation to connect on LinkedIn

2009-11-03 Thread Konrad Banachewicz
LinkedIn Konrad Banachewicz requested to add you as a connection on LinkedIn: -- Arnaud, I'd like to add you to my professional network on LinkedIn. - Konrad Accept invitation from Konrad Banachewicz http://www.linkedin.com/e/qlt6CtWzi7sEoE_

Re: [R] Change negative values in column

2009-11-03 Thread Steve Lianoglou
Hi Joel, On Nov 3, 2009, at 11:30 AM, Joel Fürstenberg-Hägg wrote: > > However, I get the following error: > > > > Error in if (x[i] < 0) { : argument is of length zero > > This is telling you that x[i] is a zero length object, so you're > indexing is wrong > Doesn't x[i] means index i in vecto

Re: [R] how to display a string containing greek chrs and variables

2009-11-03 Thread J . delasHeras
Quoting baptiste auguie : Hi, try this, plot.new() x=0.8 text(0.5, 0.5, bquote(rho == .(x))) HTH, baptiste Aha! That does exactly what i wanted! Thanks! Jose -- The University of Edinburgh is a charitable body, registered in Scotland, with registration number SC005336. __

Re: [R] bargraph.ci - CI and color question.

2009-11-03 Thread Michael Just
Hello, Thanks for the responses. Yes, I did try to use ?bargraph.CI for the colors. When I said bars, I meant the main bars on the graph not the error bars. However, this "col=c("color", "color")" is what I was needed and while it didn't find in the ?bargraph.ci help, I suspect its a more funda

[R] How to display full name for the coefficients/factors in summary()?

2009-11-03 Thread Jen-Chien Chang
Hi, I am wondering if there is a way to display the full anme of the regression coeffients/factors in the summary? Suppose I have a bogus data set using weekday as factor which has 7 levels such as: mydata <- sample(364) wk <- rep(1:7, 52) weekday <- factor(wk,1:7,c("Mon","Tue","Wed","Thu"

Re: [R] Calculate Averages for time data

2009-11-03 Thread Sunita Patil
Thank you so much it did solve my purpose. Regards Our Thoughts have the Power to Change our Destiny. Sunita On Tue, Nov 3, 2009 at 9:15 PM, Gabor Grothendieck wrote: > Next time please provide sample input. > > library(chron) > > # input > ch <- c("02:24:00", "04:48:00", "07:12:00", "09:36:00

Re: [R] R2WinBUGS not working?

2009-11-03 Thread Uwe Ligges
Paul Heinrich Dietrich wrote: This weekend I noticed that my R2WinBUGS connection was no longer working on my Windows computer at work AND my Ubuntu linux computer at home. As soon as WinBUGS opens, the message reads Index Out Of Range. I have un-installed Yes, thanks, problem known for R-2

Re: [R] Change negative values in column

2009-11-03 Thread Steve Lianoglou
Hi, On Nov 3, 2009, at 9:56 AM, Joel Fürstenberg-Hägg wrote: Hi all, I'm trying to write a script that changes all negative values in a data frame column to a small positive value, based on the the minimum value of the column. However, I get the following error: Error in if (x[i] < 0) {

Re: [R] Calculate Averages for time data

2009-11-03 Thread Gabor Grothendieck
Next time please provide sample input. library(chron) # input ch <- c("02:24:00", "04:48:00", "07:12:00", "09:36:00", "12:00:00", "14:24:00", "16:48:00", "19:12:00", "21:36:00") # convert to times tt <- times(ch) # calculate mean mean(tt) On Tue, Nov 3, 2009 at 10:35 AM, Sunita22 wrote: > >

[R] Calculate Averages for time data

2009-11-03 Thread Sunita22
Hello I have time data which is in hh:mm:ss format and I need to calculate averages for this data. I tried converting the data as integer so that I could calculate the average, but it doesn't serve the purpose. I tried using Chron package also. But I am stuck up as to how to deal with the time da

Re: [R] about the cox result

2009-11-03 Thread Yihui Xie
coef(summary(fit_cox)) should give you what you wanted. Regards, Yihui -- Yihui Xie Phone: 515-294-6609 Web: http://yihui.name Department of Statistics, Iowa State University 3211 Snedecor Hall, Ames, IA On Tue, Nov 3, 2009 at 12:31 AM, 孟欣 wrote: > Hi all: > I finished cox analysis like this:

[R] RandomForest & PMML

2009-11-03 Thread NCS
I cannot seem to write a randomforest model in PMML - either through calling PMML(model) or through Rattle. It appears that it is not yet supported. Randomsurvivalforest is, but not randomforest. Any ideas on possible workarounds for this? Thanks ncs

Re: [R] mac question

2009-11-03 Thread Steve Lianoglou
Hi, On Nov 3, 2009, at 2:41 AM, Antje wrote: Hi there, currently, I've updated R on my Mac (OS X) to version 2.10. I was wondering if I have to install all additional packages again??? In Windows, I just needed to copy the library folder of the old installation but how does it work with Ma

Re: [R] package lme4

2009-11-03 Thread wenjun zheng
May be I can calculate p value by t testing approximately: 1-qnorm(Variance/Std.Dev.) But which function can help me to extract Variance and Std.Dev values from the results below: >print(fm2 <- lmer(Yield ~ 1 + (1|Stand) + (1|Variety) + (1|Variety:Stand),Rice)) Linear mixed model fit by REML For

[R] Change negative values in column

2009-11-03 Thread Joel Fürstenberg-Hägg
Hi all, I'm trying to write a script that changes all negative values in a data frame column to a small positive value, based on the the minimum value of the column. However, I get the following error: Error in if (x[i] < 0) { : argument is of length zero As well, I would "minimum

Re: [R] how to display a string containing greek chrs and variables

2009-11-03 Thread baptiste auguie
Hi, try this, plot.new() x=0.8 text(0.5, 0.5, bquote(rho == .(x))) HTH, baptiste 2009/11/3 : > > I'm trying something that I thought would be pretty simple, but it's proving > quite frustrating... > > I want to display, for instance, the correlation coefficient "rho" in a > graph. > > I can d

  1   2   >