Re: [R] R TERMINAL Vs R GUI

2009-07-04 Thread jim holtman
I just ran a test with a couple of my scripts and they took the same amount of CPU time in both Rterm and RGUI. (37.2 CPU sec on Rterm and 37.1 CPU sec on RGUI). Elapsed times were the same and memory usage was similar. It would be helpful to provide some more information. For example, do the fo

Re: [R] R TERMINAL Vs R GUI

2009-07-04 Thread vinay_rk
Hi I send commands to R using an IDE. Configured a few hotkeys to send the commands to R. I am using Tinn-R and it has options to open a RGUI or RTerm. My datasets are in the range of 600 MB - 2GB and I generally use scan() or filehash to work on such data sets. However there are times when I

[R] useR in cincy area?

2009-07-04 Thread Wensui Liu
Dear Folks, Jim Holtman and I are wondering if there is a useR group in cincy area (OH in USA) or not. If not, how many on this list in cincy area would like to have a useR group in cincy area? Thank you so much! __ R-help@r-project.org mailing list http

Re: [R] R TERMINAL Vs R GUI

2009-07-04 Thread jim holtman
Exactly what are you doing and how are you 'sending' in the commands? Are you doing a cut/paste to the RGUI? If so, have you tried 'source'? I use RGUI all the time and have no performance/memory problems with executing scripts; I always 'source' in most of the scripts. Some more detail on exact

Re: [R] OK - I got the data - now what? :-)

2009-07-04 Thread jim holtman
See if this example helps; show how to either plot the row or columns of a data frame: > test <- data.frame(C1=runif(10), C2=runif(10), C3=runif(10)) > test C1C2C3 1 0.91287592 0.3390729 0.4346595 2 0.29360337 0.8394404 0.7125147 3 0.45906573 0.3466835 0.344 4 0.

[R] OK - I got the data - now what? :-)

2009-07-04 Thread Mark Knecht
OK, I guess I'm getting better at the data part of R. I wrote a program outside of R this morning to dump a bunch of experimental data. It's a sort of ragged array - about 700 rows and 400 columns, but the amount of data in each column varies based on the length of the experiment. The real data end

Re: [R] help with dealing with integer(0) returns from grep used within a conditional loop

2009-07-04 Thread Mark Kimpel
Thanks, embarrased that I didn't think of that myself :) Mark W. Kimpel MD ** Neuroinformatics ** Dept. of Psychiatry Indiana University School of Medicine 15032 Hunter Court, Westfield, IN 46074 (317) 490-5129 Work, & Mobile & VoiceM

Re: [R] Incidence Function Model in R help

2009-07-04 Thread David Winsemius
On Jul 4, 2009, at 6:15 PM, sjkimble wrote: R Help: Another question: My data are: x.crd y.crd A p 1 361762 1034052 3.414 0 2 361763 1034071 94.169 0 3 370325 1027277 127.642 1 4 370416 1027166 127.961 0 5 370471 10271481804.846 1 6 369050 1031312

Re: [R] help with dealing with integer(0) returns from grep used within a conditional loop

2009-07-04 Thread Duncan Murdoch
On 04/07/2009 6:09 PM, Henrique Dallazuanna wrote: You cas use isTRUE: isTRUE(grep("a", "") > 0) Not really. If there are multiple hits, that returns FALSE. You want to use length(grep(...)) to detect any hits. Duncan Murdoch On Sat, Jul 4, 2009 at 2:56 PM, Mark Kimpel wrote: I

Re: [R] Plot 2-d Polynomial without solving it

2009-07-04 Thread Hao Jiang
Thanks a lot! I got it! I haven't set the level before.Hao On Sat, Jul 4, 2009 at 6:33 PM, Duncan Murdoch wrote: > On 04/07/2009 3:31 PM, Hao Jiang wrote: > >> Hi Duncan,Thanks! >> >> But I still get a little confused about outer() func. Would give me a >> simple >> example to contour it? Just l

Re: [R] Incidence Function Model in R help

2009-07-04 Thread sjkimble
R Help: Another question: My data are: x.crd y.crd A p 1 361762 1034052 3.414 0 2 361763 1034071 94.169 0 3 370325 1027277 127.642 1 4 370416 1027166 127.961 0 5 370471 10271481804.846 1 6 369050 10313121790.493 0 7 370799 1026557 103.994 0

Re: [R] Plot 2-d Polynomial without solving it

2009-07-04 Thread Duncan Murdoch
On 04/07/2009 3:31 PM, Hao Jiang wrote: Hi Duncan,Thanks! But I still get a little confused about outer() func. Would give me a simple example to contour it? Just like the formula x^2 + y^2 + x + y -5 = 0. (Sorry I am a newbie to R, found really hard to use the R manual) > x <- seq(-6,6,len=10

Re: [R] help with dealing with integer(0) returns from grep used within a conditional loop

2009-07-04 Thread Henrique Dallazuanna
You cas use isTRUE: isTRUE(grep("a", "") > 0) On Sat, Jul 4, 2009 at 2:56 PM, Mark Kimpel wrote: > I am using grep to locate colnames to automate a report build and have > run into a problem when a colname is not found. The use of integer(0) > in a conditional statement seems to be a no no

Re: [R] help with dealing with integer(0) returns from grep used within a conditional loop

2009-07-04 Thread hadley wickham
On Sat, Jul 4, 2009 at 7:56 PM, Mark Kimpel wrote: > I am using grep to locate colnames to automate a report build and have > run into a problem when a colname is not found. The use of integer(0) > in a conditional statement seems to be a no no as it has length 0. > Below is a self-contained trivia

[R] R TERMINAL Vs R GUI

2009-07-04 Thread vinay_rk
Hello everyone, This is my first post on this forum and I hope I communicate my problem correctly. I have been using R for sometime and have always used RGUI to send commands to R. However recently I had to work on large data sets and memory was an issue. I have started using R terminal and the

[R] I can't load my database

2009-07-04 Thread Grześ
Hi, I have a problem in R - I can't load my database. When I use Gentoo everything is ok but in Ubuntu I get a message: Error in make.names(col.names, unique = TRUE) : invalid multibyte string 5 -- View this message in context: http://www.nabble.com/I-can%27t-load-my-database-tp24337284p2433

Re: [R] Date code conversion

2009-07-04 Thread Mark Knecht
On Sat, Jul 4, 2009 at 12:24 PM, Mark Knecht wrote: > On Sat, Jul 4, 2009 at 12:10 PM, Allan Engelhardt wrote: >> Try help("strptime").  Example >> >> strptime(1080103L + 19e6L, "%Y%m%d") >> # [1] "2008-01-03" >> >> (This assumes your input is an integer but you can just drop the L if you >> want)

Re: [R] Plot 2-d Polynomial without solving it

2009-07-04 Thread Hao Jiang
Hi Duncan,Thanks! But I still get a little confused about outer() func. Would give me a simple example to contour it? Just like the formula x^2 + y^2 + x + y -5 = 0. (Sorry I am a newbie to R, found really hard to use the R manual) Thanks, Hao On Sat, Jul 4, 2009 at 7:10 AM, Duncan Murdoch wrot

Re: [R] Date code conversion

2009-07-04 Thread Mark Knecht
On Sat, Jul 4, 2009 at 12:10 PM, Allan Engelhardt wrote: > Try help("strptime").  Example > > strptime(1080103L + 19e6L, "%Y%m%d") > # [1] "2008-01-03" > > (This assumes your input is an integer but you can just drop the L if you > want) > > > On 04/07/09 19:37, Mark Knecht wrote: > > Hi, >Is t

Re: [R] Date code conversion

2009-07-04 Thread Allan Engelhardt
Try help("strptime"). Example strptime(1080103L + 19e6L, "%Y%m%d") # [1] "2008-01-03" (This assumes your input is an integer but you can just drop the L if you want) On 04/07/09 19:37, Mark Knecht wrote: > Hi, > Is there a function that will convert this sort of date code which > looks li

Re: [R] Deos anyone know of a summary of conformability rules? along with a specific problem

2009-07-04 Thread David Winsemius
On Jul 3, 2009, at 1:29 PM, Steven Rytina wrote: The rules for conformability of objects required for various operators remain a mystery as do some related problems like the rules for recycling in creating arrays etc. Would someone be able to direct me to where such rules are stated?

Re: [R] breaking a loop in R

2009-07-04 Thread Allan Engelhardt
The break command can only break the innermost loop (the b loop in your case). Rewrite the loop control logic. Here is one example end.a <- FALSE; for (a in 1:10) { print(a); for (b in 1:20) { if (a > 5 && b > 5 ) { end.a <- TRUE; break; # Breaks the b loop } };

Re: [R] help with dealing with integer(0) returns from grep used within a conditional loop

2009-07-04 Thread Allan Engelhardt
On 04/07/09 18:56, Mark Kimpel wrote: I am using grep to locate colnames to automate a report build and have run into a problem when a colname is not found. The use of integer(0) in a conditional statement seems to be a no no as it has length 0. Below is a self-contained trivial example. I woul

[R] Date code conversion

2009-07-04 Thread Mark Knecht
Hi, Is there a function that will convert this sort of date code which looks like "years from 1900 + month_number + day_number" with no spaces? As an example Jan. 3rd 2008 would be written as 1080103. Thanks, Mark __ R-help@r-project.org mailing list

[R] help with dealing with integer(0) returns from grep used within a conditional loop

2009-07-04 Thread Mark Kimpel
I am using grep to locate colnames to automate a report build and have run into a problem when a colname is not found. The use of integer(0) in a conditional statement seems to be a no no as it has length 0. Below is a self-contained trivial example. I would like to get something like "NA" or -1 fo

Re: [R] newby question

2009-07-04 Thread Paul Evans
Hi all, Thanks very much for the prompt responses! All the suggestions worked :) Paul From: Martin Morgan Cc: r-h...@stat.math.ethz.ch Sent: Saturday, July 4, 2009 1:01:16 PM Subject: Re: [R] newby question Hi Paul -- Paul Evans wrote: > Hi, > > I work w

Re: [R] 'singularity' between fixed effect and random factor in mixed model

2009-07-04 Thread Douglas Bates
On Thu, Jul 2, 2009 at 1:52 AM, Thomas Mang wrote: > Hi, > I just came across the following issue regarding mixed effects models: > In a longitudinal study individuals (variable ind) are observed for some > response variable. One explanatory variable, f, entering the model as fixed > effect, is a

Re: [R] newby question

2009-07-04 Thread Martin Morgan
Hi Paul -- Paul Evans wrote: > Hi, > > I work with bio-conductor, but this is probably a basic R question. > > I want to emulate the GOBPOFFSPRING$"GO:0008150" command: > > >> allBP <- GOBPOFFSPRING$"GO:0008150" >> class(allBP) > [1] "character" >> length(allBP) > [1] 16066 > > I want to crea

Re: [R] newby question

2009-07-04 Thread jim holtman
You probably want: str <- "GO:0008150" ifunc <- function(str){ allBP <- GOBPOFFSPRINGS[[str]] return(allBP) } On Sat, Jul 4, 2009 at 12:38 PM, Paul Evans wrote: > Hi, > > I work with bio-conductor, but this is probably a basic R question. > > I want to emulate the GOBPOFFSPRING$"GO:0008150" comma

Re: [R] newby question

2009-07-04 Thread Henrique Dallazuanna
Try this: ifunc <- function(str){ allBP <- GOBPOFFSPRING[[str]] return(allBP)} On Sat, Jul 4, 2009 at 1:38 PM, Paul Evans wrote: > Hi, > > I work with bio-conductor, but this is probably a basic R question. > > I want to emulate the GOBPOFFSPRING$"GO:0008150" command: > > > > allBP <- GO

Re: [R] R on flash

2009-07-04 Thread John Kane
I have R on a couple of USB drives for Windows XP, I simply download the .exe file to my hard drive and install the program on the USB drive. It runs off the USB just as it would if installed on a hard drive. --- On Fri, 7/3/09, Raphael Saldanha wrote: > From: Raphael Saldanha > Subject: [R

[R] newby question

2009-07-04 Thread Paul Evans
Hi, I work with bio-conductor, but this is probably a basic R question. I want to emulate the GOBPOFFSPRING$"GO:0008150" command: > allBP <- GOBPOFFSPRING$"GO:0008150" > class(allBP) [1] "character" > length(allBP) [1] 16066 > I want to create a function so that I can execute the command by p

Re: [R] matrix problem

2009-07-04 Thread Henrique Dallazuanna
Try this: foo <- function(x, nrow, ncol){ m <- matrix(0, nrow = nrow, ncol = ncol) m[cbind(unlist(lapply(0:(ncol - 1), `+`, seq(x))),rep(1:ncol, each = length(x)))] <- x m } foo(c(2, 1, 1, 1), nrow = 5, ncol = 2) On Sat, Jul 4, 2009 at 1:26 PM, William Simpson wrote: > Doesn't wor

Re: [R] is AIC always 100% in evaluating a model?

2009-07-04 Thread Frank E Harrell Jr
Tal Galili wrote: Hello Frank, Thank you for the extension and remarks. The basic weakness of stepwise regression VS going through all-subsets is very much agreed upon. Although from what I gather there is one case where all subsets will be a problem to implement, that is for very LARGE dat

Re: [R] matrix problem

2009-07-04 Thread William Simpson
Doesn't work: > Make(x=c(2,1,1,1),nR=5,nC=2) [,1] [,2] [1,]20 [2,]12 [3,]01 [4,]00 [5,]00 should be [,1] [,2] [1,]20 [2,]12 [3,]11 [4,]11 [5,]01 On Sat, Jul 4, 2009 at 5:04 PM, Jorge Ivan Velez wrote: > D

Re: [R] skip the error to continue the logistic regression in a loop

2009-07-04 Thread Juliet Hannah
Here are two things to try. First check the data. There may be a factor that does not have variation in the sample. For example, if you had a predictor such as 'present'/'absent', in the current sample, all of them may be 'present'. Second, you can put a 'try' statement in your function. try(

Re: [R] matrix problem

2009-07-04 Thread David Winsemius
On Jul 4, 2009, at 11:59 AM, William Simpson wrote: Thanks everyone for the help. I should have said that I want to do this generally, not as a one-off. So I want a function to do it. Like this tp<-function(x, nr, nc) { matrix( c(x,rep(0, nr-length(x)+1)), nrow=nr, ncol=nc) } tp(x=c(1,2), n

Re: [R] matrix problem

2009-07-04 Thread Jorge Ivan Velez
Dear William, Here is one way using Henrique's solution: Make <- function(x, nR, nC){ m <- matrix(0, nrow = nR, ncol = nC) diag(m) <- x[1] diag(m[-1,]) <- x[2] m } Make(x = c(1,2), nR = 5, nC = 4) HTH, Jorge On Sat, Jul 4, 2009 at 11:59 AM, William Simpson < william.a

Re: [R] matrix problem

2009-07-04 Thread Charles C. Berry
On Sat, 4 Jul 2009, William Simpson wrote: Can anybody please tell me a good way to do the following? Not sure how you want cases like x = 1:3, nrow=2 , ncol=7 to be handled, but for the example you give, this works: mat <- matrix(0,nr=nrow,nc=ncol) indx <- outer( seq( from=

Re: [R] matrix problem

2009-07-04 Thread William Simpson
Thanks everyone for the help. I should have said that I want to do this generally, not as a one-off. So I want a function to do it. Like this tp<-function(x, nr, nc) { matrix( c(x,rep(0, nr-length(x)+1)), nrow=nr, ncol=nc) } tp(x=c(1,2), nr=5, nc=4) This one looks good -- the warning message i

Re: [R] comparision among multiple subgroups

2009-07-04 Thread David Winsemius
On Jul 4, 2009, at 11:36 AM, sdzhangping wrote: Dear R users: In my recent works, I compared the cumulative incidences among three different treatment groups. The cuminc function (cmprsk package ) yielded a graph (refer to figure 1) No figure attached. Perhaps it did not conform to th

Re: [R] matrix problem

2009-07-04 Thread David Winsemius
On Jul 4, 2009, at 11:17 AM, William Simpson wrote: Can anybody please tell me a good way to do the following? Given a vector, number of rows and number of columns, return a matrix as follows. Easiest to give an example: x=c(1,2), nrow=5, ncol=4 You ought to separate those assignments with

Re: [R] matrix problem

2009-07-04 Thread Henrique Dallazuanna
Try this: m <- matrix(0, nrow = 5, ncol = 4) diag(m) <- x[1] diag(m[-1,]) <- x[2] On Sat, Jul 4, 2009 at 12:17 PM, William Simpson < william.a.simp...@gmail.com> wrote: > Can anybody please tell me a good way to do the following? > > Given a vector, number of rows and number of columns, return a

[R] comparision among multiple subgroups

2009-07-04 Thread sdzhangping
Dear R users: In my recent works, I compared the cumulative incidences among three different treatment groups. The cuminc function (cmprsk package ) yielded a graph (refer to figure 1) and a p value (p = 0.0007). I don’t know how to interpret the meaning of the p value ( one p value and thr

Re: [R] A problem on zoo object

2009-07-04 Thread David Winsemius
I looked at the question and Gabor's reply and could not figure out why you were not simply replacing the function list() for head() in the second line of his example. Or perhaps you were, and the result was not what you wanted, in which case it would be of you not being clear about the des

Re: [R] Skeleton Package to Flesh Out?

2009-07-04 Thread Gabor Grothendieck
Try: ?package.skeleton ?prompt On Sat, Jul 4, 2009 at 10:59 AM, Jason Rupert wrote: > > By any chance is there a skeleton package to use as a template to develop an > R package? > > I downloaded "Writing R Extensions", which was evidently updated pretty > recently, but I did not see any referen

[R] matrix problem

2009-07-04 Thread William Simpson
Can anybody please tell me a good way to do the following? Given a vector, number of rows and number of columns, return a matrix as follows. Easiest to give an example: x=c(1,2), nrow=5, ncol=4 return the matrix: 1 0 0 0 2 1 0 0 0 2 1 0 0 0 2 1 0 0 0 2 Thanks very much for any h

Re: [R] is AIC always 100% in evaluating a model?

2009-07-04 Thread Tal Galili
Hello Frank, Thank you for the extension and remarks. The basic weakness of stepwise regression VS going through all-subsets is very much agreed upon. Although from what I gather there is one case where all subsets will be a problem to implement, that is for very LARGE datasets - especially in th

[R] Skeleton Package to Flesh Out?

2009-07-04 Thread Jason Rupert
By any chance is there a skeleton package to use as a template to develop an R package? I downloaded "Writing R Extensions", which was evidently updated pretty recently, but I did not see any references (and of course I may have totally missed it) to a package template to use as a go by. Do

Re: [R] A problem on zoo object

2009-07-04 Thread stephen sefick
Try some reproducible example and why you want this list. I don't understand why you are trying to do what you want to do. On Sat, Jul 4, 2009 at 2:51 AM, Bogaso wrote: > > No reply yet. Is my question not clear? Please let me know. > > Thanks > > > Bogaso wrote: >> >> Thanks Gabor for this reply

Re: [R] is AIC always 100% in evaluating a model?

2009-07-04 Thread Frank E Harrell Jr
Ravi Varadhan wrote: But you are still left with the problem of choosing the regularization parameter, i.e. how much to shrink the coefficients? In other words, there is no free ride. Ravi. Ravi, Choosing a penalty factor is extremely easy compared to variable selection. There is a uniqu

Re: [R] table () for more variables

2009-07-04 Thread Marc Schwartz
On Jul 3, 2009, at 12:10 PM, John Lipkins wrote: Dear All, I want to create a table for several variables. As example. I have a dataframe with following data: Gendertransport driving 1 0 1 0 1 0 1

Re: [R] table () for more variables

2009-07-04 Thread David Winsemius
On Jul 3, 2009, at 1:10 PM, John Lipkins wrote: Dear All, I want to create a table for several variables. As example. I have a dataframe with following data: Gendertransport driving 1 0 1 0 1 0 1

Re: [R] is AIC always 100% in evaluating a model?

2009-07-04 Thread Ravi Varadhan
But you are still left with the problem of choosing the regularization parameter, i.e. how much to shrink the coefficients? In other words, there is no free ride. Ravi. Ravi Varadhan, Ph.D. Assistant Professor, Division of G

Re: [R] A question built on How to sum one column in a data frame keyed on other columns

2009-07-04 Thread David Winsemius
On Jul 4, 2009, at 6:21 AM, Vincent Vinh-Hung wrote: Dear List: I have a question related to a previous discussion How to sum one column in a data frame keyed on other columns https://stat.ethz.ch/pipermail/r-help/2006-December/122141.html (George Nachman, Bill Venables) The original query wa

Re: [R] is AIC always 100% in evaluating a model?

2009-07-04 Thread Frank E Harrell Jr
Tal Galili wrote: Hi Ben, I just wished to give a small remark about your claim: "it's best not to consider hypothesis testing (statistical significance) and AIC in the same analysis." Since in the case of forward selection for orthogonal matrix's, it can be shown that AIC is like using a P to e

Re: [R] Simple one

2009-07-04 Thread jim holtman
mean(x[x[,'region'] == 'south', 'profit']) or if dataframe mean(x$profit[x$region == 'south']) or for all regions tapply(x$profit, x$region, mean) On Fri, Jul 3, 2009 at 6:55 PM, JoK LoQ wrote: > > Just a quickly beginner's question. > > I wanna find the mean only from the values from a column

Re: [R] Plot 2-d Polynomial without solving it

2009-07-04 Thread Duncan Murdoch
Hao Jiang wrote: Hi, I want to plot a polynomial in the form like ax^2 + bxy + cy^2 + dx + ey + f =0 without solving it(since I may have 3 or 4 dimensional polynomial and it's really hard to solve). Is there any way to plot this kind of polynomial? Thanks a lot! There are lots of ways. A c

Re: [R] is AIC always 100% in evaluating a model?

2009-07-04 Thread Ben Bolker
Tal Galili wrote: > Hi Ben, > I just wished to give a small remark about your claim: > "it's best not to consider hypothesis testing (statistical significance) and > AIC in the same analysis." > > Since in the case of forward selection for orthogonal matrix's, it can be > shown that AIC is like

[R] A question built on How to sum one column in a data frame keyed on other columns

2009-07-04 Thread Vincent Vinh-Hung
Dear List: I have a question related to a previous discussion How to sum one column in a data frame keyed on other columns https://stat.ethz.ch/pipermail/r-help/2006-December/122141.html (George Nachman, Bill Venables) The original query was to calculate the sum of visits for each unique tuple of

Re: [R] Confidence Limits for a Cross-Product Ratio

2009-07-04 Thread Peter Dalgaard
francogrex wrote: Data from Fisher's paper: Confidence Limits for a Cross-Product Ratio. y col1 col2 [1,] 103 [2,]2 15 fisher.test(y) Fisher's Exact Test for Count Data data: y p-value = 0.0005367 alternative hypothesis: true odds ratio is not equal to 1 95 perce

Re: [R] Deos anyone know of a summary of conformability rules? along with a specific problem

2009-07-04 Thread Peter Dalgaard
Steven Rytina wrote: The rules for conformability of objects required for various operators remain a mystery as do some related problems like the rules for recycling in creating arrays etc. Would someone be able to direct me to where such rules are stated? In a related vein, there ar

[R] fisher.test CIs

2009-07-04 Thread francogrex
The reason I had asked how and what method was used to calculated the confidence intervals of the odds ratio in the fisher.test is because I don't think it's the exact method based on permutations. It seems that the exact method is not implemented in R or anywhere else: "In a tactic originally sug

Re: [R] Shading the area between lines

2009-07-04 Thread Jim Lemon
Hannu Kahra wrote: Hi, I have a graph with seven parallel horizontal lines. Is it possible to shade the area between two adjacent lines? Hi Hannu, Easy if you know the endpoints of the lines. plot(rep(1,2),type="l",ylim=c(0,8)) for(i in 1:6) { lines(rep(i+1,2)) polygon(c(1,1,2,2),c(i,i+1,i

Re: [R] Shading the area between lines

2009-07-04 Thread baptiste auguie
Hi, You could use ?rect x = 1:5 y=1:5 plot(x,y,t="n",xaxs="i") abline(h=y) xlims = range(x) y.rect = matrix(rep(y,each=2)[-c(1, 2*length(y))], ncol=2, byrow=T) x.rect = matrix(rep(xlims), ncol=2,nrow=nrow(y.rect), byrow=T) cols = 1:4 rect(x.rect[,1], y.rect[,1], x.rect[,2], y.rect[,2],col=

Re: [R] Color of ecdf plots

2009-07-04 Thread roger koenker
having been bitten by this behavior many times, could I register a plea for allowing a col argument to plot.stepfun that would deal with both the horizontal and vertical segments -- I rather doubt that it is often desirable to have different colors for these. Note that verticals = TRUE is t

[R] Deos anyone know of a summary of conformability rules? along with a specific problem

2009-07-04 Thread Steven Rytina
The rules for conformability of objects required for various operators remain a mystery as do some related problems like the rules for recycling in creating arrays etc. Would someone be able to direct me to where such rules are stated? In a related vein, there are all manner of operati

Re: [R] breaking a loop in R

2009-07-04 Thread NatsS
Hello, Please could someone explain break and next?? Is there a way to break a loop that is not the innermost loop?? for example: #= dim A = 1000 x 3 dim B = 2000 x 3 for (a in 1:1000){ for (b in 1:2000){ expr = intersect(A[a,1]:A[a,2],B[b,1]:B[b,2])

[R] Simple one

2009-07-04 Thread JoK LoQ
Just a quickly beginner's question. I wanna find the mean only from the values from a column related to specific values from another one. Like, theres a 'region' column, i want the mean of the value on 'profit' column only from "south" sells from 'region' column -- View this message in context:

[R] table () for more variables

2009-07-04 Thread John Lipkins
Dear All, I want to create a table for several variables. As example. I have a dataframe with following data: Gendertransport driving 1 0 1 0 1 0 1 0 1 Now I want to crea