Re: [R] Encoding() and strsplit()

2008-11-07 Thread Prof Brian Ripley
See the 'R Internals' manual. ASCII characters are not marked as Latin-1 nor UTF-8. On Fri, 7 Nov 2008, Heinz Tuechler wrote: Dear All, Encoding() goes beyond my understanding. See the example. I would expect from reading the help for Encoding() that strsplit preserves the encoding for each

Re: [R] FW: [rkward-devel] questions on RKWard

2008-11-07 Thread Donatas G.
To get output going into the Output tab, your either have to work through the rkward menus, or you have to wrap up your commands in rkward-specific code; you can get examples of the code by running any statistical operation through the menus and checking the code produced by rkward (it is shown

Re: [R] Efficient way to fill a matrix

2008-11-07 Thread Philipp Pagel
Thank you Phil and Bert! I was sure there must be an efficient way using some kind of indexing trick but totally did not see the as.matrix solution. Thanks again Philipp On Wed, Nov 05, 2008 at 02:59:20PM -0800, Phil Spector wrote: Philipp - res = matrix(NA,5,3)

Re: [R] How to manipulate the time data without the date?

2008-11-07 Thread Barry Rowlingson
2008/11/7 tedzzx [EMAIL PROTECTED]: The problem is that: There is some rounding problems, for example Library(chron) any(times(4:00:01)==times(4:00:00)+times(00:00:01))) False But,it should be true FAQ 7.31 in disguise! chron stores date-times as fractions, so you're comparing two

Re: [R] Encoding() and strsplit()

2008-11-07 Thread Heinz Tuechler
At 09:15 07.11.2008, Prof Brian Ripley wrote: See the 'R Internals' manual. Thank you, now I understand a little more. My real problem, however is a data frame produced by spss.get(). Is there a simple possibility to mark all characters in that data.frame (except ASCII characters),

[R] is there any way to run R method as a background process from R interface

2008-11-07 Thread Kurapati, Ravichandra (Ravichandra)
Hi , can some body tell to me how to run a R method /function as a background process from R interface Thanks K.Ravichandra [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

[R] method to return rgb values from pixels of an image

2008-11-07 Thread Hans-Joachim Klemmt
hello, i am looking for a method to return rgb-values of predifined pixels of jpg images. can anybody help me? thank you very much best regards hans-joachim klemmt -- -- Dr. Hans-Joachim Klemmt Forstoberrat Organisationsprogrammierer IHK Bayerische Landesanstalt

[R] Odp: 2^2 factorial design question

2008-11-07 Thread Petr PIKAL
Are you looking for expand.grid? expand.grid(1:2, letters[1:2]) Petr Pikal [EMAIL PROTECTED] 724008364, 581252140, 581252257 [EMAIL PROTECTED] napsal dne 07.11.2008 01:53:56: Dear R Gurus: How do you put together a 2^2 (or even 2^k) factorial problem, please? Since you have 2 levels

Re: [R] Umlaut read from csv-file

2008-11-07 Thread Peter Dalgaard
Heinz Tuechler wrote: Dear Prof.Ripley! Thank you very much for your attention. In the given example Encoding(), or the encoding parameter of read.csv solve the problem. I hope your patch will solve also the problem, when I read a spss file by spss.get(), since this function has no encoding

Re: [R] Agent-based social simulation and R

2008-11-07 Thread Tom Backer Johnsen
Simone Gabbriellini wrote: Tom, I don't know if there are better ways, but this is the way I do: I use Python for building the AB model, and RPy as an interface to R for statistical analysis. One of the best package for SNA in R is igraph, which has a nice Python version. But if you prefere

[R] Bootstrapping gnls models

2008-11-07 Thread Christoph Scherber
Dear all, I am trying to bootstrap predictions from gnls models using the following code: # a is the dataframe with which I am working; it contains the variables # response.variable,LD,L,G,P and F ### model=gnls(response.variable ~ a * LD/(b + LD), params = list(a + b ~ L), start =

[R] Unexpected behavior of clocktime related to daylight savings time

2008-11-07 Thread Dennis Fisher
Colleagues, I submitted this several days ago and no one responded, so I am trying again, trying a different subject line: I just encountered some unexpected behavior of difftime in relationship to the change from daylight savings to standard time. My understanding is that DST and ST take

Re: [R] Election Maps

2008-11-07 Thread Duncan Murdoch
On 11/7/2008 8:31 AM, roger koenker wrote: Those of you with an interest in the US election and/or statistical graphics may find the maps at: http://www-personal.umich.edu/~mejn/election/2008/ interesting. Nice stuff. Do you know if anyone has ported the cartogram code to R? I see

Re: [R] Applying a function to a list of arguments ...

2008-11-07 Thread Gabor Grothendieck
Try this: func - function(f, ...) f(...) # e.g. func(sin, 0) # same as sin(0) func(max, 1, 2) # same as max(1, 2) On Fri, Nov 7, 2008 at 5:21 AM, [EMAIL PROTECTED] wrote: How can I apply function f, that I get as an argument as in func - function(f, ...) { . . . } to a list of

Re: [R] Agent-based social simulation and R

2008-11-07 Thread Simone Gabbriellini
Tom, I don't know if there are better ways, but this is the way I do: I use Python for building the AB model, and RPy as an interface to R for statistical analysis. One of the best package for SNA in R is igraph, which has a nice Python version. But if you prefere statnet (which is great

[R] two kind of Hosmer and Lemeshow’s test

2008-11-07 Thread leo_wa
I know that there are two method to apply the Hosmer and Lemeshow’s. One of them is calculated based on the fixed and pre-determined cut-off points of the estimated probability of success. One of them is calculated based on the percentiles of estimated probabilities. In the previous post,i

Re: [R] Umlaut read from csv-file

2008-11-07 Thread Heinz Tuechler
At 13:34 07.11.2008, Peter Dalgaard wrote: Heinz Tuechler wrote: Dear Prof.Ripley! Thank you very much for your attention. In the given example Encoding(), or the encoding parameter of read.csv solve the problem. I hope your patch will solve also the problem, when I read a spss file by

Re: [R] Election Maps

2008-11-07 Thread hadley wickham
On Fri, Nov 7, 2008 at 7:53 AM, Duncan Murdoch [EMAIL PROTECTED] wrote: On 11/7/2008 8:31 AM, roger koenker wrote: Those of you with an interest in the US election and/or statistical graphics may find the maps at: http://www-personal.umich.edu/~mejn/election/2008/ interesting.

[R] x axe values

2008-11-07 Thread Laura Poggio
Dear list, I have to draw a simple plot. On y axe some numerical values that correspond to various categories on axe x. The table I am reading looks like: cat Obj1 Obj2 Obj3 max 23 27 34 ave 21 25 32 min 19 23 30 In order to avoid that the first column is reordered alphabetically I used: (found

[R] [newbie] scatterplot with marginal histograms (done) and axes labels

2008-11-07 Thread KarstenW
Hello, I am stuck when I want to add axes labels to my scatterplot with histograms. I guess it must be something with par(mar=) or so, but could someone give me a hint? Here is what I got so far: # adapted from http://www.stat.ucl.ac.be/ISdidactique/comment/fichiers/r/scatterhist.rs and from

Re: [R] Umlaut read from csv-file

2008-11-07 Thread Prof Brian Ripley
On Fri, 7 Nov 2008, Peter Dalgaard wrote: Heinz Tuechler wrote: Dear Prof.Ripley! Thank you very much for your attention. In the given example Encoding(), or the encoding parameter of read.csv solve the problem. I hope your patch will solve also the problem, when I read a spss file by

[R] clogit and small sample sizes: what to do?

2008-11-07 Thread Johannes Elias
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Conditional logistic regression and small sample sizes: what to do? Dear R-Gurus, [I run R 2.8.0 on WinXP. I have no formal training in statistics.] Please feel free to skip the 'Blah blah part' for questions below. - ---Blah blah part Why

Re: [R] Unexpected behavior of clocktime related to daylight savings time

2008-11-07 Thread Prof Brian Ripley
On Fri, 7 Nov 2008, Dennis Fisher wrote: Colleagues, I submitted this several days ago and no one responded, so I am trying again, trying a different subject line: Well, you posted something that indicated you had not studied the relevant help pages, without the information requested in the

Re: [R] Bootstrapping gnls models

2008-11-07 Thread Prof Brian Ripley
On Fri, 7 Nov 2008, Christoph Scherber wrote: Dear all, I am trying to bootstrap predictions from gnls models using the following code: # a is the dataframe with which I am working; it contains the variables # response.variable,LD,L,G,P and F And without it your code is not reproducible.

Re: [R] Applying a function to a list of arguments ...

2008-11-07 Thread Duncan Murdoch
On 11/7/2008 5:40 AM, baptiste auguie wrote: perhaps something like, func - function(f, ...) { do.call(f, ...) } func(rnorm, list(n=3, mean=2, sd=3)) Alternatively, if the caller doesn't want to put the args in a list, your func can do it: func2 - function(f, ...) { do.call(f,

Re: [R] is there any way to run R method as a background process from R interface

2008-11-07 Thread Philippe Grosjean
Hello, Two approaches depending when you want to trigger this background calculation: 1) It is enough to trigger the background computation after each top-level instruction entered at the command line: use ?addTaskCallback 2) You want to trigger the background calculation at a given time,

[R] Updating Packages with Personal Library

2008-11-07 Thread Alan Lue
I'm having trouble running `updates.packages()' and installing into a personal library. Setup: 1. .Renviron file contains: R_LIBS_USER=~/lib/R/%p-library/%v 2. Hence personal library is: ~/lib/R/i486-pc-linux-gnu-library/2.6/ 3. Library path upon starting R: .libPaths() [1]

[R] [solved] sapply and median, possible or not ?

2008-11-07 Thread Ptit_Bleu
Thanks a lot Keith : your function does the job (but I don't understand the trick) ! Have a nice week-end (Thanks to you, I can have a good one :-)), Ptit Bleu. - median.data.frame - function(x, ...) sapply(x, median, ...) I haven't tried it, but it might work hth Keith

Re: [R] Bootstrapping gnls models

2008-11-07 Thread Christoph Scherber
Dear all, Here comes a reproducible example, with the original data added. The error message when running boot() is: Error in gnls(response.variable ~ a * LD/(b + LD), params - list(a + : Step halving factor reduced below minimum in NLS step boot() in this case only seems to work for very

Re: [R] sapply and median, possible or not ?

2008-11-07 Thread Ptit_Bleu
Unfortunately, I have the same error message. lapply(rowsplit, function(x)mean(x[,sapply(x, is.numeric)])) works but not with median. Strange, isn't it? Any other idea? Thanks in advance, Ptit Bleu. Henrique Dallazuanna wrote: Try this: lapply(l, function(x)median(x[,sapply(x,

Re: [R] [newbie] scatterplot with marginal histograms (done) and axes labels

2008-11-07 Thread KarstenW
Hello, sometimes it helps if I formulate my problem. I tried the following after I posted my previous post. scatterhist=function(x,y, xlab=, ylab=){ #oldpar = par(no.readonly = TRUE) # save default, for resetting... zones=matrix(c(2,0,1,3),ncol=2,byrow=TRUE)

[R] Vectorizing sample()

2008-11-07 Thread Stephen Collins
I am simulating sickness among a group of families. Part of the task is to randomly draw who in the family will be sick, randomly drawing from family ID's where Dad =1, Mom = 2, Kid1 = 3, Kid2 = 4., etc. My census of Dads is of the form shown below. Dad_ID Spouse (Y=1;N=0)

Re: [R] Mismatch in logical result?

2008-11-07 Thread Heinz Tuechler
Maybe this? http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-doesn_0027t-R-think-these-numbers-are-equal_003f At 11:23 07.11.2008, Shubha Vishwanath Karanth wrote: Content-Type: text/plain Content-Disposition: inline Content-length: 569 Hi R, I have certain checkings, which gives FALSE,

[R] AIC value in lmer

2008-11-07 Thread ARNAUD_MOSNIER
Dear R Users, May be this message should be directy send to Douglas Bates ... I just want to know if I can use the AIC value given in the output of an lmer model to classify my logistic models. I heard that the AIC value given in GLIMMIX output (SAS) is false because it come from a calculation

[R] ordinal logistic model with pre-defined coefficients

2008-11-07 Thread kazys . o . simutis
Hi, I'm trying to fit a proportional ordinal logistic model using function polr() (package MASS). Is there a way to fix certain betas in the regression (e.g. function arima() allows this by defining fixed ) Maybe there is another function than polr() which allows that? Thanks Kazys

Re: [R] Updating Packages with Personal Library

2008-11-07 Thread Alan Lue
Test. On Fri, Nov 7, 2008 at 2:40 AM, Alan Lue [EMAIL PROTECTED] wrote: I'm having trouble running `updates.packages()' and installing into a personal library. Setup: 1. .Renviron file contains: R_LIBS_USER=~/lib/R/%p-library/%v 2. Hence personal library is:

Re: [R] need help in plotting barchart

2008-11-07 Thread Petr PIKAL
Kurapati, Ravichandra \(Ravichandra\) [EMAIL PROTECTED] napsal dne 07.11.2008 11:06:28: Hi I want NA counts also. Well barley[5:15, 1] - NA barchart(yield ~ variety | site, data = barley, groups = year, layout = c(1,6), ylab = Barley Yield (bushels/acre),

[R] grouped and stacked plot

2008-11-07 Thread Ferry
Dear R users, Beside lattice and vcd packages, what is my option if I want to create a grouped and stacked categorical plots? With lattice, what I usually do is breaking my data from a wide form to a long form (using subset and rbind), such as: TypeID - Var 1 - Var 2 - Var 3 - Val to

Re: [R] 2^2 factorial design question

2008-11-07 Thread Ted Harding
On 07-Nov-08 00:53:56, Edna Bell wrote: Dear R Gurus: How do you put together a 2^2 (or even 2^k) factorial problem, please? I'm not clear about what you mean here, especially about put together! Can you describe what you want to end up with in more detail? Since you have 2 levels for A and

Re: [R] nls: Fitting two models at once?

2008-11-07 Thread Heather Turner
Dear Martin, You can use the same idea of concatenating the data in R. The following reproduces your example: spec - c(asfe, dias) n1 - length(asfe) n2 - length(dias) CYT - c(28 * CYTF, 24.6 * 2 * CYTB6) B559HP - c(B559HP, numeric(n2)) B559LP - c(numeric(n1), B559LP) C550 - c(numeric(n1), C550)

[R] Odp: need help in plotting barchart

2008-11-07 Thread Petr PIKAL
Hi I did not see any response and will not give you any answer too, just a hint. Your code can not be reproduced and it is also difficult to say what you really want. Eg. this is rather confusing. On a generated plot I observed that what ever records have counts as NA, those are not

[R] help with maps : center on the dateline

2008-11-07 Thread Melanie . Abecassis
Hi, I'm trying to plot a map of the pacific ocean, centered on the dateline, using the maps package. library(maps) # Basic library to draw maps library(mapdata)# Library with specialized maps library(mapproj) map(database = world, fill = TRUE, col = 1, plot = TRUE,add=F, xlim = c(120,300),

Re: [R] Applying a function to a list of arguments ...

2008-11-07 Thread baptiste auguie
perhaps something like, func - function(f, ...) { do.call(f, ...) } func(rnorm, list(n=3, mean=2, sd=3)) baptiste On 7 Nov 2008, at 10:21, [EMAIL PROTECTED] wrote: How can I apply function f, that I get as an argument as in func - function(f, ...) { . . . } to a list of arguments

Re: [R] Vectorizing sample()

2008-11-07 Thread Duncan Murdoch
On 11/7/2008 12:00 PM, Stephen Collins wrote: I am simulating sickness among a group of families. Part of the task is to randomly draw who in the family will be sick, randomly drawing from family ID's where Dad =1, Mom = 2, Kid1 = 3, Kid2 = 4., etc. My census of Dads is of the form shown

Re: [R] help with maps : center on the dateline

2008-11-07 Thread Duncan Murdoch
On 11/7/2008 12:08 PM, [EMAIL PROTECTED] wrote: Hi, I'm trying to plot a map of the pacific ocean, centered on the dateline, using the maps package. library(maps) # Basic library to draw maps library(mapdata)# Library with specialized maps library(mapproj) map(database = world, fill = TRUE,

Re: [R] How to manipulate the time data without the date?

2008-11-07 Thread Gabor Grothendieck
On Fri, Nov 7, 2008 at 3:32 AM, Barry Rowlingson [EMAIL PROTECTED] wrote: 2008/11/7 tedzzx [EMAIL PROTECTED]: The problem is that: There is some rounding problems, for example Library(chron) any(times(4:00:01)==times(4:00:00)+times(00:00:01))) False But,it should be true FAQ 7.31 in

[R] Applying a function to a list of arguments ...

2008-11-07 Thread roby . brunelli
How can I apply function f, that I get as an argument as in func - function(f, ...) { . . . } to a list of arguments list(a, b, c) (eg the ... argument of func above) in order to obtain f(a, b, c) Thanks a lot, Roberto [[alternative HTML version deleted]]

Re: [R] sapply and median, possible or not ?

2008-11-07 Thread Henrique Dallazuanna
You can provide a example of your data? On Fri, Nov 7, 2008 at 9:14 AM, Ptit_Bleu [EMAIL PROTECTED] wrote: Unfortunately, I have the same error message. lapply(rowsplit, function(x)mean(x[,sapply(x, is.numeric)])) works but not with median. Strange, isn't it? Any other idea? Thanks in

Re: [R] sapply and median, possible or not ?

2008-11-07 Thread Keith Jewell
I haven't looked at the detail, but I guess the answer is that mean works on a data frame while median doesn't. ?mean snip For a data frame, a named vector with the appropriate method being applied column by column. - I guess to use median you'll need nested '[l/s]apply's, the

Re: [R] Vectorizing sample()

2008-11-07 Thread Kenn Konstabel
Hi, I'm not quite sure I understood everything but is this something close? d - read.table(textConnection(Dad_ID SpouseYN NKids NSick 1 10 1 2 02 2 3 10 2 4 13 3), header=TRUE) mapply(sample,

[R] Re gular Expression help

2008-11-07 Thread Rajasekaramya
hi there I have a vector with a set of data.I just wanna seperate them based on the first p and q values metioned within the data. [1] chr10p15.3 /// chr3q29 /// chr4q35 /// chr9q34.3 [2] chr1q22-q24 [3] chr1q22-q24 [4]

[R] Rmpi task-pull

2008-11-07 Thread Daniel Ferrara
Hi, I'm testing the efficiency of the Rmpi package regarding parallelization using a cluster. I've found and tried the task pull programming method, but even if it is described as the best method, it seems to cause deadlock, anyone could help me in using this method? here is the code I've found

Re: [R] Re gular Expression help

2008-11-07 Thread Peter Dalgaard
Rajasekaramya wrote: hi there I have a vector with a set of data.I just wanna seperate them based on the first p and q values metioned within the data. [1] chr10p15.3 /// chr3q29 /// chr4q35 /// chr9q34.3 [2] chr1q22-q24 [3] chr1q22-q24

[R] Sweave: How to load available colors from pkg 'color'

2008-11-07 Thread Felipe Carrillo
Hi: Is there a shorter way to color the abstract,sections subsections and page headings of a document. I am using the code below in my preamble to accomplish some of it: [EMAIL PROTECTED],dvips]{color} \else\usepackage[usenames,dvipsnames]{color} % and fix pdf colour problems

[R] sapply and median, possible or not ?

2008-11-07 Thread Ptit_Bleu
Hello, I have a list of data.frame rowsplit : List of 15 $ (0,0.025] :'data.frame': 169 obs. of 7 variables: $ (0.025,0.05]:'data.frame': 174 obs. of 7 variables: $ (0.05,0.075]:'data.frame': 92 obs. of 7 variables: $ (0.075,0.1] :'data.frame': 76 obs. of 7 variables: $

[R] Re move specific rows from a matrix

2008-11-07 Thread mentor_
Hi, imagine the following two matrix: Matrix A: a b c 1 2 3 4 5 6 7 8 9 Matrix B: a 4 7 I would like to remove those rows from matrix A which are present in both matrices. So after removing the corresponding rows the matrix A should look like this: Matrix A: a b c 1 2 3 Thanks in advance! --

Re: [R] standard errors for predict.nls?

2008-11-07 Thread Christoph Scherber
Dear all, I would like to get standard errors (or confidence intervals) for *predicted* values from an nls fit. I have tried to implement code from p.225 in MASS (bootstrapping a nls fit), but this gives only the confidence intervals of the parameter estimates, but not an overall confidence

Re: [R] chi square table

2008-11-07 Thread Peter Dalgaard
Berwin A Turlach wrote: rant on That's the problem with introductory textbook whose author think they do the students a favour by using notation as z_alpha, z_0.01, z_(alpha/2) instead of z_(1-alpha), z_0.99, z_(1-alpha/2), respectively. In my opinion this produces in the long run only

[R] Agent-based social simulation and R

2008-11-07 Thread Tom Backer Johnsen
Do anyone know anything about the use of R for agent-based social simulation? It should be possible, and would be convenient for the simple reason that there are several nice packages containing useful stuff for SNA (Social Network Analysis). Information about packages, web sites,

Re: [R] ordinal logistic model with pre-defined coefficients

2008-11-07 Thread Prof Brian Ripley
On Fri, 7 Nov 2008, [EMAIL PROTECTED] wrote: Hi, I'm trying to fit a proportional ordinal logistic model using function polr() (package MASS). Is there a way to fix certain betas in the regression (e.g. function arima() allows this by defining fixed ) Maybe there is another function than

Re: [R] Agent-based social simulation and R

2008-11-07 Thread Tom Backer Johnsen
Martin Elff wrote: Hi Tom, my package 'memisc' contains a sort of an infrastructure for doing simulations. As a fun exercise I also used it to create a 'toy' agent based simulation of Schelling's neighbourhood model. Although it is not a serious application, at least it shows that agent

[R] Mismatch in logical result?

2008-11-07 Thread Shubha Vishwanath Karanth
Hi R, I have certain checkings, which gives FALSE, but actually it is true. Why does this happen? Note that the equations that I am checking below are not even the case of recurring decimals... 1.4^2 == 1.96 [1] FALSE 1.2^3==1.728 [1] FALSE Thanks in advance, Shubha

[R] Election Maps

2008-11-07 Thread roger koenker
Those of you with an interest in the US election and/or statistical graphics may find the maps at: http://www-personal.umich.edu/~mejn/election/2008/ interesting. url:www.econ.uiuc.edu/~rogerRoger Koenker email[EMAIL PROTECTED]Department of Economics

Re: [R] method to return rgb values from pixels of an image

2008-11-07 Thread Duncan Murdoch
On 11/7/2008 3:24 AM, Hans-Joachim Klemmt wrote: hello, i am looking for a method to return rgb-values of predifined pixels of jpg images. can anybody help me? See the rimage package, with function read.jpeg. It will read the whole file into a large array, with separate red, green, blue

[R] rmpi/snow/sge/openmpi help

2008-11-07 Thread jk jk
I'm trying to snow working with openmpi and sge. Everything appears to work, except, the program only runs on 2 node. If i tell snow to run on 9 nodes, it spawns 9 processes on a single node. I'm at a loss of ideas. Any help would be appreciated. Setup: Rocks Cluster, OpenMPI, R 2.8.0, Snow,

[R] esoteric inconsistency -- intended or not?

2008-11-07 Thread Bert Gunter
Is the following intended or not? func- function(y) match.call() z - func(y =2) z func(y = 2) z[[a]] - 5 z func(y = 2, 5) ## Note that the second argument **is not** named ## BUT... z - func(y =2) z$a - 5 z func(y = 2, a = 5) ## The second argument **is** named ### End of

Re: [R] Election Maps

2008-11-07 Thread Liviu Andronic
On Fri, Nov 7, 2008 at 4:02 PM, hadley wickham [EMAIL PROTECTED] wrote: The source code (in C) for this type of cartogram (Diffusion-based method for producing density equalizing maps) is available from here: http://www-personal.umich.edu/~mejn/cart/download/ From the documentation [1]: If you

Re: [R] rmpi/snow/sge/openmpi help

2008-11-07 Thread jk jk
Forgive the spam. Let me try that e-mail again. I'm trying to get snow working with openmpi and sge. Everything appears to work, except the program only runs on 1 node. If i tell snow to run on 5 nodes, it spawns 5 processes on a single node, 6 nodes = 6 procs on 1 node and so on. I'm at a

[R] determining plot location in lattice

2008-11-07 Thread Sundar Dorai-Raj
Hi, I'm dealing with a lattice plot inserted into a tk widget and would like to know when a user has clicked on the plot area of a plot (i.e. inside the axes). For example, library(tkrplot) library(lattice) tt - tktoplevel() makePlot - function() print(xyplot(1 ~ 1)) printCoords -

[R] For Loop - loading 10 sets of data and calculating

2008-11-07 Thread PDXRugger
I am trying to simplify my code by adding a for loop that will load and compute a sequence of code 10 time. They way i run it now is that the same 8 lines of code are basically reproduced 10 times. I would like to replace the numeric value in the code (e.g. Bin1, Bin2Bin10) each time the

[R] help with syntax of random formula

2008-11-07 Thread Thomas Wutzler
Dear R-users Thanks to Jose Pinheiro, Douglas Bates and coworkes for providing R with the nlme package. Could someone help me, please, to specify a correct random formula for a mixed model, that specifies no random effect on a higher level? I have the following dataset of timeseries of

[R] help with prediction of GLM

2008-11-07 Thread penny77114
So, I have training data, and testing data however, when I try to predict values for the testing data, it gives me values for the training data. what gives? the following is my code: train = read.table(train.txt, header = TRUE, sep = ) test = read.table(test.txt, header = TRUE, sep = )

[R] Help With Graphs

2008-11-07 Thread Alex99
Hi guys, I am truing to draw a circle and choose 10 points on the circle and put a number from 1 to 10 above each point. I don't have a problem with drawing a circle and choosing 10 points. my problem is with numbering . is it even possible to put a number above each chosen point? if so any idea

Re: [R] rmpi/snow/sge/openmpi help

2008-11-07 Thread Markus Schmidberger
Hi, there is a new mailing list for R and HPC: [EMAIL PROTECTED] This is probably a better list for your question. Do not forgett, first of all you have to register: https://stat.ethz.ch/mailman/listinfo/r-sig-hpc Did you tried to run openmpi and R without SGE? Like this: orterun -n 1 R

Re: [R] Help With Graphs

2008-11-07 Thread Sarah Goslee
?text On Fri, Nov 7, 2008 at 12:42 PM, Alex99 [EMAIL PROTECTED] wrote: Hi guys, I am truing to draw a circle and choose 10 points on the circle and put a number from 1 to 10 above each point. I don't have a problem with drawing a circle and choosing 10 points. my problem is with numbering .

Re: [R] Rmpi task-pull

2008-11-07 Thread Markus Schmidberger
Hi, there is a new mailing list for R and HPC: [EMAIL PROTECTED] This is probably a better list for your question. Do not forget, first of all you have to register: https://stat.ethz.ch/mailman/listinfo/r-sig-hpc I tried your code and it is working! Please send us your sessionInfo() output.

Re: [R] For Loop - loading 10 sets of data and calculating

2008-11-07 Thread jim holtman
# I would put this in a list in the following manner Bin - lapply(1:10, function(.file){ #--- #Loads bin data frame from csv files with acres and TAZ data fileName - paste(I:/Research/Samba/urb_transport_modeling/LUSDR/Workspace/BizLandPrice/data/Bin_lookup_values/Bin, .file,

Re: [R] Agent-based social simulation and R

2008-11-07 Thread Martin Elff
On Friday 07 November 2008 (19:45:04), you wrote: Martin Elff wrote: Hi Tom, my package 'memisc' contains a sort of an infrastructure for doing simulations. As a fun exercise I also used it to create a 'toy' agent based simulation of Schelling's neighbourhood model. Although it is not a

[R] negative binomial predicted probabilities

2008-11-07 Thread Joseph Magagnoli
I estimated a negative binomial model using zelig. z.out- zelig(NEWBHC~ PW80 + CHNGBLK + XBLK,data=data, model=negbin) How do I calculate predicted probabilities for this model? Is it the same process as a poisson regression? Thanks in advance Joe [[alternative HTML version deleted]]

[R] easy way to cap a data frame to a max value

2008-11-07 Thread Grey Moran
Hello, I have some rather large matrices. Is there a way (without having to loop) to cap all the values of a data frame to a given ceiling? E.g. junk - cbind(c(1,2,3,4,5),c(2,4,6,8,10)) junk [,1] [,2] [1,]12 [2,]24 [3,]36 [4,]48 [5,]5 10 replace

Re: [R] easy way to cap a data frame to a max value

2008-11-07 Thread Gabor Grothendieck
Assuming the data frame is all numeric: DF[] - pmax(10, unlist(DF)) On Fri, Nov 7, 2008 at 4:16 PM, Grey Moran [EMAIL PROTECTED] wrote: Hello, I have some rather large matrices. Is there a way (without having to loop) to cap all the values of a data frame to a given ceiling? E.g. junk -

Re: [R] easy way to cap a data frame to a max value

2008-11-07 Thread Erik Iverson
Are they objects of class matrix or data.frame? You seem to make reference to both, but know there is a difference. Try: junk[junk 5] - 5 Grey Moran wrote: Hello, I have some rather large matrices. Is there a way (without having to loop) to cap all the values of a data frame to a given

Re: [R] nls: Fitting two models at once?

2008-11-07 Thread Martin Ballaschk
Dear Heather! Thank you very, very much for your solution which also reproduces exactly the results I get from the SigmaPlot analysises. :) Martin Heather Turner schrieb: Dear Martin, You can use the same idea of concatenating the data in R. The following reproduces your example:

Re: [R] easy way to cap a data frame to a max value

2008-11-07 Thread Gabor Grothendieck
That should be pmin: On Fri, Nov 7, 2008 at 4:25 PM, Gabor Grothendieck [EMAIL PROTECTED] wrote: Assuming the data frame is all numeric: DF[] - pmax(10, unlist(DF)) On Fri, Nov 7, 2008 at 4:16 PM, Grey Moran [EMAIL PROTECTED] wrote: Hello, I have some rather large matrices. Is there a

Re: [R] easy way to cap a data frame to a max value

2008-11-07 Thread Grey Moran
Thanks to all who replied - lots of good ideas. The one I prefered at the end was: junk[junk 5] - 5 Grey On Fri, Nov 7, 2008 at 4:38 PM, Gabor Grothendieck [EMAIL PROTECTED] wrote: That should be pmin: On Fri, Nov 7, 2008 at 4:25 PM, Gabor Grothendieck [EMAIL PROTECTED] wrote: Assuming the

Re: [R] easy way to cap a data frame to a max value

2008-11-07 Thread Grey Moran
On Fri, Nov 7, 2008 at 4:46 PM, Grey Moran [EMAIL PROTECTED] wrote: Thanks to all who replied - lots of good ideas. The one I prefered at the end was: junk[junk 5] - 5 Grey On Fri, Nov 7, 2008 at 4:38 PM, Gabor Grothendieck [EMAIL PROTECTED] wrote: That should be pmin: On Fri, Nov 7,

Re: [R] easy way to cap a data frame to a max value

2008-11-07 Thread Gabor Grothendieck
A few more. These each have the advantage of not destroying the original data frame: # based on Erik's DF2 - replace(DF, DF 10, 10) # based on my previous one DF2 - replace(DF, TRUE, pmin(10, unlist(DF))) DF2 - (DF + 10)/2 - abs(DF - 10)/2 On Fri, Nov 7, 2008 at 4:38 PM, Gabor Grothendieck

[R] unable to add a new workbook with rcom

2008-11-07 Thread stenka1
__ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

Re: [R] two kind of Hosmer and Lemeshow’s test

2008-11-07 Thread Frank E Harrell Jr
leo_wa wrote: I know that there are two method to apply the Hosmer and Lemeshow’s. One of them is calculated based on the fixed and pre-determined cut-off points of the estimated probability of success. One of them is calculated based on the percentiles of estimated probabilities. Both of

[R] UTF8

2008-11-07 Thread Denise Duarte
Hi, I am trying to get R 2.8.0 for Mac OS from CRAN, but I thing I am doing something wrong because when R starts I have annoying error messages: During startup - Warning messages: 1: Setting LC_CTYPE failed, using C 2: Setting LC_COLLATE failed, using C 3: Setting LC_TIME failed, using C 4:

Re: [R] Re gular Expression help

2008-11-07 Thread Wacek Kusnierczyk
Peter Dalgaard wrote: Rajasekaramya wrote: hi there I have a vector with a set of data.I just wanna seperate them based on the first p and q values metioned within the data. [1] chr10p15.3 /// chr3q29 /// chr4q35 /// chr9q34.3 [2] chr1q22-q24 [3]

[R] grouping data together

2008-11-07 Thread Swanton0822
Hi. i have a data, and there is 3 columns, Month, Year and Total. and there is over 1000 rows for them because there is 87 years data for every month, so there is month from Jan-Dec, and year from 1900-1987, so i was wondering if i would want to make 12 groups (Jan,Feb...,Dec), and put each

[R] Faster way to combine data sets with different date ranges

2008-11-07 Thread t c
I am trying to combine two data sets, one with daily values and one with weekly values.  SurveyData conatins environmental data collected on a daily basis.  sat.data contains satellite sea surface temperature that is an average of satellite measurements over a six day period.  I would like to

Re: [R] Re gular Expression help

2008-11-07 Thread Wacek Kusnierczyk
Wacek Kusnierczyk wrote: Peter Dalgaard wrote: Rajasekaramya wrote: hi there I have a vector with a set of data.I just wanna seperate them based on the first p and q values metioned within the data. [1] chr10p15.3 /// chr3q29 /// chr4q35 /// chr9q34.3 [2] chr1q22-q24

Re: [R] Re gular Expression help

2008-11-07 Thread Wacek Kusnierczyk
Wacek Kusnierczyk wrote: Rajasekaramya wrote: hi there I have a vector with a set of data.I just wanna seperate them based on the first p and q values metioned within the data. [1] chr10p15.3 /// chr3q29 /// chr4q35 /// chr9q34.3 [2] chr1q22-q24

Re: [R] Re gular Expression help

2008-11-07 Thread Gabor Grothendieck
Here are a few more solutions. x is the input vector of character strings. The first is a slightly shorter version of one of Wacek's. The next three all create an anonymous grouping variable (using sub, substr/gsub and strapply respectively) whose components are p and q and then tapply is used

[R] missing value where TRUE/FALSE needed

2008-11-07 Thread David Croll
Hello dear R people, for my MSc thesis I need to program some functions, and some of them simply do not work. In the following example, I made sure both vectors have the same length (10), but R gives me the following error: Error in if (vector1[i] == vector2[j]) { : missing value where

Re: [R] esoteric inconsistency -- intended or not?

2008-11-07 Thread Felix Andrews
2008/11/8 Bert Gunter [EMAIL PROTECTED]: Is the following intended or not? func- function(y) match.call() z - func(y =2) z func(y = 2) z[[a]] - 5 z func(y = 2, 5) ## Note that the second argument **is not** named ## BUT... z - func(y =2) z$a - 5 z func(y = 2, a = 5) ## The

Re: [R] missing value where TRUE/FALSE needed

2008-11-07 Thread cruz
is this what you want? vector1 [1] 65 1 34 100 42 20 79 43 89 10 vector2 [1] 34 65 47 91 48 32 23 74 92 86 for (i in 1:10) { + for (j in 1:10) { + if (vector1[i] == vector2[j]) + show(c(i,j)) + } + } [1] 1 2 [1] 3 1 On Sat, Nov 8, 2008 at

Re: [R] grouping data together

2008-11-07 Thread cruz
hi friend, this is from your previous posts on Kruskal-Wallis test:) i came up with this one: A5 - read.table('kew.dat' ,header=TRUE) plot(factor(A5$Month, levels=month.abb), A5$Rain) is that what you want? On Sat, Nov 8, 2008 at 7:03 AM, Swanton0822 [EMAIL PROTECTED] wrote: Hi. i have a

  1   2   >