[R] R: mpirun .C and R

2011-02-03 Thread Allan Clark
hello all i am busy testing some code that will be used for parallel computations on a Moab cluster. I have written a C++ program and am linking it with R using the .C command - this works correctly. Extracts of the r code (as well as the *.sh file) is included below. I am able to run the

Re: [R] rgl: draw multiple ellipsoids

2011-02-03 Thread baptiste auguie
Hi, Thank you for the pointer; I'd overlooked that demo which contains an alternative way of generating ellipsoids. It is slightly annoying that ellipsoid3d is not defined in the main package but in the demo; I'll have to duplicate the code. Playing with this idea, I realised the bottleneck of my

[R] interpret significance from the contr.poly() function

2011-02-03 Thread Asan Ramzan
Hello R-help I don’t know how to interpret significance from the contr.poly() function . From the example below : how can I tell if data has a significant Linear/quadratic/cubic trend? contr.poly(4, c(1,2,4,8))               .L         .Q          .C [1,]

Re: [R] problem with D(COM) Server

2011-02-03 Thread Bart Joosen
I have the problem with the basic test too. But I installed D(COM) for use with the R2wd package. Despite the problem with the basic test, R2wd works like a charm. So just try your code, it actually might work fine. Bart -- View this message in context:

Re: [R] Average of several line plots

2011-02-03 Thread mattnixon
Hi, Peter: thank you, I have taken a look at ?approxfun but I'm not sure it does what I'm after. Eduardo: The data doesn't represent functions. Basically the X values represent the distance across a sample and the Y values are a measure of the colour intensity at that point across the sample

Re: [R] looping variable names

2011-02-03 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 03.02.2011 00:56:40: Thanks for the reply! This sounds great. Is there a nice way to store these 100 variable names in a list without typing them all out? Why? When you need your 42nd variable from a list lll you can just use lll[42] and if

Re: [R] Average of several line plots

2011-02-03 Thread Petr PIKAL
Hi r-help-boun...@r-project.org napsal dne 03.02.2011 10:36:57: Hi, Peter: thank you, I have taken a look at ?approxfun but I'm not sure it does what I'm after. Hm, maybe yes. But not approxfun but approx x1-1:15 x2-50:100 y1-rnorm(15) y2-rnorm(51) yy2-approx(x2,y2)$y

[R] glmnet with binary predictors

2011-02-03 Thread sambit rath
Hi Everybody! I must start with a declaration that I am a sparse user of R. I am creating a credit scorecard using a dataset which has a variable depicting actual credit history (good/bad) and 41 other variables of yes/no type. The procedure I am asked to follow is to use a penalized logistic

[R] Loop to mapply. Error

2011-02-03 Thread Alaios
Goodmorning List Member, I would like to ask your help using mapply or Vectorize to make a loop more efficient. I have a m*4 matrix called borders and I would like to add a 5th column. Thus first A. I add the new 5th column borders-cbind(borders,matrix(data=NA,nrow=nrow(borders))) B. For every

Re: [R] looping variable names

2011-02-03 Thread Eik Vettorazzi
As Greg wrote, a list is in most circumstances a better way to store many objects. But you can use 'assign' and 'get' to create and access (global) variables #creation for (i in 1:100) assign(paste(var,i,sep=),rnorm(5)) #access i-th variable i-15 get(paste(var,i,sep=)) hth. Am 02.02.2011

Re: [R] looping variable names

2011-02-03 Thread Alaios
Hello I would like to ask you if I can use the same method but for functions. That means that I want not to assign some value but a function. So is it possible to try something like that: for (i in 1:10) for (j in 1:10) assign(paste(var,i,j,sep=),myfunction) I would like to thank you in

[R] Reg : read missing values from database using RJDBC

2011-02-03 Thread Raji
Hi R-helpers, i am using the following dataset.This dataset is stored in a mysql database. W(x)pH(y) 10 1 15 1 20 4 5 7.5 3 13 9 5 11.5 13.53 16 2 1 9.6 1 I am using RJDBC package to read the data from the database into a

Re: [R] [r] align xyplot

2011-02-03 Thread Francesco Nutini
Thanks Dennis, I have used the codes as.table = TRUE and aspect = 1 to obtain what i needed. Maybe I'll ask you more about xyplot, is very powerfull tool! Cheers, Francesco Date: Mon, 31 Jan 2011 04:33:27 -0800 Subject: Re: [R] [r] align xyplot From: djmu...@gmail.com To:

[R] Odp: Loop to mapply. Error

2011-02-03 Thread Petr PIKAL
Hi Well, no data so a wild guess. You want select values from matrix sr based on values in borders[,1] and borders[,2]. If it is the case plain selection could be far better mat-matrix(1:12, 4,4) mat [,1] [,2] [,3] [,4] [1,]1591 [2,]26 102 [3,]37

Re: [R] glmnet with binary predictors

2011-02-03 Thread Nick Sabbe
Hello Sambit. Step1: Create a matrix out of your predictor data, having columns for every predictor, coding 1 for yes and 0 for no. he matrix should have a row for each observation (called pred.mat below) Besides that, you need a vector with the outcome variable for each observation (best if this

Re: [R] Odp: Loop to mapply. Error

2011-02-03 Thread Alaios
Hello Petr, I am sorry that I did not provide all the required data (for me is not very straight-forward to understand what I have to provide and what not) findCell-function(x,sr){ # It is just for me understand how mapply works sr[x[1],x[2]] } and I want to call mapply like that.

Re: [R] Average of several line plots

2011-02-03 Thread Philipp Pagel
On Thu, Feb 03, 2011 at 01:36:57AM -0800, mattnixon wrote: The data doesn't represent functions. Basically the X values represent the distance across a sample and the Y values are a measure of the colour intensity at that point across the sample (i.e. a line plot across the sample). Each

[R] mapply question (?)

2011-02-03 Thread Albert-Jan Roskam
Hi, I have a function myFun which I want to call multiple times, using different argument lists. myFun(v1, 2009, 1) myFun(v2, 2008, 1) myFun(q, 2001) How can I easily do this in R? Should I use mapply? I unsuccessfully tried something like: x - list(c(v1, 2009, 1), c(v2, 2008, 1), c(q, 2001))

[R] Error message: number of items to replace is not a multiple of replacement length

2011-02-03 Thread Karen Moore
*Warning messages: *appear after dredging global model in MMI and requesting model selection table dd(global model)-dredge(global model) - runs OK dd(global model) * 1: In x[i] - value[[j]] : number of items to replace is not a multiple of replacement length* Also at model averaging stage I

Re: [R] mapply question (?)

2011-02-03 Thread Kenn Konstabel
On Thu, Feb 3, 2011 at 1:26 PM, Albert-Jan Roskam fo...@yahoo.com wrote: Hi, I have a function myFun which I want to call multiple times, using different argument lists. myFun(v1, 2009, 1) myFun(v2, 2008, 1) myFun(q, 2001) Notice that the third call is different, you have 3 args in

Re: [R] Odp: Loop to mapply. Error

2011-02-03 Thread Petr PIKAL
Hi Alaios ala...@yahoo.com napsal dne 03.02.2011 12:16:45: Hello Petr, I am sorry that I did not provide all the required data (for me is not very straight-forward to understand what I have to provide and what not) findCell-function(x,sr){ # It is just for me understand how mapply

Re: [R] testing randomness of random number generators with student t-test?

2011-02-03 Thread Petr Savicky
On Wed, Feb 02, 2011 at 06:01:36PM -0500, Carl Witthoft wrote: Hi, subject more or less says it all. I freely admit to not having bothered to find some of the online papers about method of testing the quality of random number generators -- but in an idle moment I wondered what to expect

[R] how to read the Sum Sq - column from summary.aov()

2011-02-03 Thread Bertolt Meyer
Dear R-Users, I have a trivial problem, but extensive googling and ??'ing did not solve it: I want to obtain the sums of squares from a summary.aov() object for later use. Example: DV - rnorm(100) IV1 - as.factor(rep(c(male, female), times = 50)) IV2 - as.factor(rep(c(young, old), times =

[R] boostrap an nls regression

2011-02-03 Thread m234
Hello there I have the following model based on the hollings disc equation for the type II functional response for 2 data sets: nls(eaten~(a*suppl)/(1+a*h*suppl) where eaten is the number of prey eaten by a predator and suppl is the number of prey initially supplied to the same predator. I

[R] interpret significance from the contr.poly() function

2011-02-03 Thread Asan Ramzan
Hello R-help (sorry if this message gets posted twice, i think I may have accidently postponed it) I don’t know how to interpret significance from the contr.poly() function . From the example below : how can I tell if data has a significant Linear/quadratic/cubic trend? contr.poly(4,

Re: [R] Odp: Loop to mapply. Error

2011-02-03 Thread Kenn Konstabel
On Thu, Feb 3, 2011 at 1:16 PM, Alaios ala...@yahoo.com wrote: I am sorry that I did not provide all the required data (for me is not very straight-forward to understand what I have to provide and what not) findCell-function(x,sr){ # It is just for me understand how mapply works

Re: [R] how to read the Sum Sq - column from summary.aov()

2011-02-03 Thread Peter Ehlers
On 2011-02-03 04:30, Bertolt Meyer wrote: Dear R-Users, I have a trivial problem, but extensive googling and ??'ing did not solve it: I want to obtain the sums of squares from a summary.aov() object for later use. Example: DV- rnorm(100) IV1- as.factor(rep(c(male, female), times = 50)) IV2-

Re: [R] how to read the Sum Sq - column from summary.aov()

2011-02-03 Thread Ivan Calandra
Hi, If you do test - summary(aov(DV ~ IV1 * IV2)) str(test) you will see that test[[1]][2] gives you what you want. Reading more on indexing will also probably help you. str() is a very useful function, to use without moderation! HTH, Ivan Le 2/3/2011 13:30, Bertolt Meyer a écrit :

Re: [R] Why my package is not being generated?

2011-02-03 Thread Ben Bolker
Cristiano Strieder cstrieder at gmail.com writes: Hi all, I have commited a new release of my package and waited for more than one day. After that install.packages(tests,repos=http://r-forge.r-projet.org;) still returns package 'tests' is not available. I have done the local build

[R] random sequences for rnorm and runif

2011-02-03 Thread Matthias Gondan
Dear R experts, For a fixed seed, the first random number produced by rnorm and runif has the same rank within the distribution, which I find useful. The following ranks differ, however. set.seed(123) runif(4) [1] *0.2875775* 0.7883051 *0.4089769* 0.8830174 set.seed(123) pnorm(rnorm(4))

Re: [R] how to read the Sum Sq - column from summary.aov()

2011-02-03 Thread Bertolt Meyer
Dear Peter, thank you so much for the quick and helpful reply - it was exactly what I was looking for. Regards, Bertolt Am 03.02.2011 um 13:49 schrieb Peter Ehlers: On 2011-02-03 04:30, Bertolt Meyer wrote: Dear R-Users, I have a trivial problem, but extensive googling and ??'ing did not

Re: [R] random sequences for rnorm and runif

2011-02-03 Thread Prof Brian Ripley
On Thu, 3 Feb 2011, Matthias Gondan wrote: Dear R experts, For a fixed seed, the first random number produced by rnorm and runif has the same rank within the distribution, which I find useful. The following ranks differ, however. set.seed(123) runif(4) [1] *0.2875775* 0.7883051 *0.4089769*

Re: [R] Odp: Loop to mapply. Error

2011-02-03 Thread Alaios
I would like to thank you very much both. Your replies helped me understand. I will bookmark you replies for future reference :) Best Regards Alex --- On Thu, 2/3/11, Kenn Konstabel lebats...@gmail.com wrote: From: Kenn Konstabel lebats...@gmail.com Subject: Re: [R] Odp: Loop to mapply. Error

[R] minimum steiner tree

2011-02-03 Thread amir
Dear All, Is there any function in R that find the minimum steiner tree not minimum spanning tree? Regards, Amir __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

[R] mpirun .C and R

2011-02-03 Thread Allan Clark
hello all For those interested! i figured out the problem! I needed to put the dyn.load and dyn.unload lines inside the loop! library(doMPI) cl - startMPIcluster(count=2)#this will

[R] coxme, colon2 dataframe

2011-02-03 Thread John Sorkin
I am exploring the coxme function. The help page uses two examples that use the colon2 dataframe. The data frame is not included in the material that is installed when one loads the coxme package. The web site that contains the colon2 data, does not have the file in an immediately usable

Re: [R] interpret significance from the contr.poly() function

2011-02-03 Thread Ista Zahn
By fitting some kind of model. contr.poly doesn't fit a model or test significance, it just sets contrasts. Here is an example data(mtcars) mtcars$carb - factor(mtcars$carb) contrasts(mtcars$carb) - contr.poly(n=levels(mtcars$carb)) contrasts(mtcars$carb) .L .Q .C

Re: [R] interpret significance from the contr.poly() function

2011-02-03 Thread RICHARD M. HEIBERGER
You can use the summary with the split argument. See ?summary.aov for an example. This gives similar results to the regression coefficients approach that Ista Zahn suggested. I usually prefer the ANOVA table approach for factors. On Thu, Feb 3, 2011 at 3:36 AM, Asan Ramzan asanram...@yahoo.com

Re: [R] Why my package is not being generated?

2011-02-03 Thread Bart Joosen
a typo in r-projeCt.org? install.packages(tests,repos=http://r-forge.r-project.org;) -- View this message in context: http://r.789695.n4.nabble.com/Why-my-package-is-not-being-generated-tp3255111p3258202.html Sent from the R help mailing list archive at Nabble.com.

[R] Sorting a Data Frame by hybrid string / number key

2011-02-03 Thread Alastair
Hi, I'm trying to present a table of some experimental data, and I want to order the rows by the instance names. The issue I've got is that there are a variety of conventions for the instance names (e.g. competition01, competition13, small_1, big_20, med_9). What I want to be able to sort them

Re: [R] Sorting a Data Frame by hybrid string / number key

2011-02-03 Thread David Winsemius
On Feb 3, 2011, at 10:12 AM, Alastair wrote: Hi, I'm trying to present a table of some experimental data, and I want to order the rows by the instance names. The issue I've got is that there are a variety of conventions for the instance names (e.g. competition01, competition13, small_1,

[R] get caller's name

2011-02-03 Thread Ernest Adrogué
Hi, Suppose a function that checks an object: stop.if.dims - function(x) { if (! is.null(dim(x))) { stop(cannot handle dimensional data) } } This would be used by other functions that can only work with dimensionless objects. The problem is the error message would need to include the

Re: [R] Sorting a Data Frame by hybrid string / number key

2011-02-03 Thread William Dunlap
To sort a character vector in a desired order you can convert it to a factor with the levels in the desired order. To sort strings like 2 and 11 in numerical order, use convert them to numbers with as.numeric. To sort by two variables, using the second to break ties in the first, use

Re: [R] sqlsave and mysql database with autoincremental column

2011-02-03 Thread PtitBleu
I found a solution (certainly not the best one but it works). I add a 45th column full of 0 to the 44-columns data.frame. When I copy the data.frame to the database with sqlsave, the last column of the table is not full of 0, but it autoincrements. Another small question: what is the command to

Re: [R] get caller's name

2011-02-03 Thread David Winsemius
On Feb 3, 2011, at 10:27 AM, Ernest Adrogué wrote: Hi, Suppose a function that checks an object: stop.if.dims - function(x) { if (! is.null(dim(x))) { stop(cannot handle dimensional data) } } mtx - matrix(c(1,0,0,1), 2) stop.if.dims - function(x) { objname - deparse(substitute(x)) +

[R] R-help

2011-02-03 Thread sudhir cr
Hi, I have data like this print(x) ID VAL1VAL2 1 B A 2 P Q 3 T S What I would like is data like this... ID VAL1VAL2 1 A B 2 P Q 3 S T So that VAL1 and VAL2 are alphabetically

Re: [R] tapply output as a dataframe

2011-02-03 Thread Graves, Gregory
On Mon, Apr 13, 2009 at 12:41 PM, Dan Dube ddube-at-advisen.com wrote: i use tapply and by often, but i always end up banging my head against the wall with the output. The proposed solution of Dan's problem posted on R-help was: do.call(rbind,a) When I use this 'solution' I get 'ERROR:

Re: [R] get caller's name

2011-02-03 Thread Henrique Dallazuanna
Try this: g - function(.x) tryCatch(stop.if.dims(.x), error=function(e)sprintf(Error in %s: %s, deparse(sys.call(1)), e$message)) g(rbind(2, 3)) 2011/2/3 Ernest Adrogué nfdi...@gmail.com Hi, Suppose a function that checks an object: stop.if.dims - function(x) { if (! is.null(dim(x))) {

[R] Matrix' with Functions

2011-02-03 Thread Alaios
Dear R members, I have a quite large of function that are named like that f11,f12,...f15 f21,f22,...f25 .. f51,f52,...f52 These are static (hard-coded) functions that the only common they have is that they take the same number and type of input fij(a,b,c,d). As you might understand this is

[R] substring and paste character with a for loop

2011-02-03 Thread Chris82
Hello R users, I have a little problem with a for loop. Below there is an simple example of my problem. I want to delet the commas in the character string. Fore this reason I create a for loop to unpick the string and rebuild him without the commas. The problem is, that paste does not work in

Re: [R] substring and paste character with a for loop

2011-02-03 Thread Ben Bolker
Chris82 rubenbauar at gmx.de writes: Hello R users, I have a little problem with a for loop. Below there is an simple example of my problem. I want to delet the commas in the character string. Fore this reason I create a for loop to unpick the string and rebuild him without the

Re: [R] R-help

2011-02-03 Thread Henrique Dallazuanna
Try this: x[2:3] - t(apply(x[-1], 1, sort)) On Thu, Feb 3, 2011 at 1:57 PM, sudhir cr sudhir...@gmail.com wrote: Hi, I have data like this print(x) ID VAL1VAL2 1 B A 2 P Q 3 T S What I would like is data like this... ID

Re: [R] substring and paste character with a for loop

2011-02-03 Thread Eik Vettorazzi
Hi Chris, 'gsub' does exactly what you want: gsub(,,,text) so there is no need for a loop. Btw. your loop assigns a new value to m in each step and you see only the last assignment. you could do something like m - paste(m,substring(text,i,i+2),sep = ) hth Am 03.02.2011 17:35, schrieb

Re: [R] Matrix' with Functions

2011-02-03 Thread Claudia Beleites
Seems funny to me: f - list (mean, sd, median, sum) dim (f) - c (2, 2) or in one line: f - structure (.Data=list (mean, sd, median, sum), dim = c(2,2)) f [,1] [,2] [1,] ?? [2,] ?? f [1,1] [[1]] function (x, ...) UseMethod(mean) environment: namespace:base f [[1,1]] (1:3) [1]

Re: [R] substring and paste character with a for loop

2011-02-03 Thread Chris82
Oh, that's of course a better solution. I've never red or heard about gsub. Thanks a lot! -- View this message in context: http://r.789695.n4.nabble.com/substring-and-paste-character-with-a-for-loop-tp3258449p3258485.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] R-help

2011-02-03 Thread Dennis Murphy
Hi: u - matrix(sample(LETTERS[1:24]), nrow = 8) u [,1] [,2] [,3] [1,] W J M [2,] K V P [3,] X E U [4,] T B N [5,] I Q F [6,] G R S [7,] A C O [8,] D H L t(apply(u, 1, function(x) sort(x))) [,1] [,2] [,3] [1,] J M W [2,] K P V [3,] E U X [4,] B N T [5,] F I Q

Re: [R] Matrix' with Functions

2011-02-03 Thread Samuel Le
://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. __ Information from ESET NOD32 Antivirus, version of virus signature database 5843 (20110203

Re: [R] looping variable names

2011-02-03 Thread Greg Snow
It depends on what you are assigning. A simple example of assigning the values 1 through 100: mylist - lapply(1:100, I) names(mylist) - paste('var',1:100, sep='') Or if you have 100 files named dat1.txt, dat2.txt, ..., dat100.txt and you want to read them in: mylist - lapply( paste('dat',

Re: [R] looping variable names

2011-02-03 Thread Greg Snow
It is not clear what you are trying to do, but you can have lists (or vectors) of functions and that should simplify what you are trying to do: trigfuns - list( s=sin, c=cos, t=tan ) trigfuns $s function (x) .Primitive(sin) $c function (x) .Primitive(cos) $t function (x) .Primitive(tan)

Re: [R] get caller's name

2011-02-03 Thread Ernest Adrogué
3/02/11 @ 11:25 (-0500), David Winsemius escriu: On Feb 3, 2011, at 10:27 AM, Ernest Adrogué wrote: Hi, Suppose a function that checks an object: stop.if.dims - function(x) { if (! is.null(dim(x))) { stop(cannot handle dimensional data) } } mtx - matrix(c(1,0,0,1), 2)

Re: [R] get caller's name

2011-02-03 Thread Ernest Adrogué
3/02/11 @ 14:30 (-0200), Henrique Dallazuanna escriu: Try this: g - function(.x) tryCatch(stop.if.dims(.x), error=function(e)sprintf(Error in %s: %s, deparse(sys.call(1)), e$message)) g(rbind(2, 3)) This is it. Thanks! Cheers. -- Ernest __

[R] Mixed Model Logistic Weighting

2011-02-03 Thread Cody Likavec
I am trying to run a mixed model logistic regression with participants nested within state with a certain amount of covariates. Here is what my model looks like: m1 - lmer(Overweight ~ age + factor(A_RACE_G) + Prevalance + HH_Income_Dicot + Unemployment_Rate + Intensity_effect + (1 | state2)

Re: [R] Average of several line plots

2011-02-03 Thread mattnixon
Yes - that is exactly what was needed. Applying approx to each data set then allowed for straight forward averaging afterwards. Many thanks. -- View this message in context: http://r.789695.n4.nabble.com/Average-of-several-line-plots-tp3254850p3258494.html Sent from the R help mailing list

Re: [R] exact logistic regression

2011-02-03 Thread Den
Dear Dennis Thank you again It is funny how stupid I was. I was afraid of the word inference in elrm package description while performing my first search. elrm package looks like what I need. They have very good intro with examples Zamar D, McNeney B and Graham J. elrm: Software Implementing

Re: [R] tapply output as a dataframe

2011-02-03 Thread Phil Spector
Try as.data.frame(as.table(a)) - Phil Spector Statistical Computing Facility Department of Statistics UC Berkeley

Re: [R] Matrix' with Functions

2011-02-03 Thread RICHARD M. HEIBERGER
and provide commented, minimal, self-contained, reproducible code. __ Information from ESET NOD32 Antivirus, version of virus signature database 5843 (20110203) __ The message was checked by ESET NOD32 Antivirus. http://www.eset.com __ Information from ESET NOD32

Re: [R] tapply output as a dataframe

2011-02-03 Thread David Winsemius
On Feb 3, 2011, at 11:29 AM, Graves, Gregory wrote: On Mon, Apr 13, 2009 at 12:41 PM, Dan Dube ddube-at-advisen.com wrote: That is pushing two years ago, so I doubt very many people still have that posting on their mail-clients. (When I did go to the archives Dan Dube's problem was

Re: [R] tapply output as a dataframe

2011-02-03 Thread Graves, Gregory
Yes, as far as I can tell, sampling.date is a character vector of the format 1/15/2008. It resides in the leftmost column of the tapply output. station.code are the A, B, C column headers which refer actual water quality station locations, and the values below those headers correspond to the

Re: [R] tapply output as a dataframe

2011-02-03 Thread David Winsemius
On Feb 3, 2011, at 1:05 PM, Graves, Gregory wrote: Yes, as far as I can tell, sampling.date is a character vector of the format 1/15/2008. It resides in the leftmost column of the tapply output. station.code are the A, B, C column headers which refer actual water quality station

Re: [R] tapply output as a dataframe

2011-02-03 Thread Gabor Grothendieck
On Thu, Feb 3, 2011 at 1:11 PM, David Winsemius dwinsem...@comcast.net wrote: On Feb 3, 2011, at 1:05 PM, Graves, Gregory wrote: Yes, as far as I can tell, sampling.date is a character vector of the format 1/15/2008.  It resides in the leftmost column of the tapply output. station.code are

Re: [R] Matrix' with Functions

2011-02-03 Thread Bert Gunter
signature database 5843 (20110203) __ The message was checked by ESET NOD32 Antivirus. http://www.eset.com __ Information from ESET NOD32 Antivirus, version of virus signature database 5843 (20110203) __ The message was checked by ESET NOD32 Antivirus. http

[R] I want to ask user to create a typical matrix, otherwise there should be some error displaying...

2011-02-03 Thread Maithula Chandrashekhar
Dear all, I am into some bigger project and in implementing that, I have come across a problem, wherein I have to ask user to create a Matrix with all elements either NA value or some Date object, preferably in mm/dd/yy format. Therefore I would like to force user to create following sort of

Re: [R] error in density plot

2011-02-03 Thread Ben Bolker
On 02/02/2011 09:29 AM, David Winsemius wrote: On Feb 2, 2011, at 8:22 AM, Ben Bolker wrote: Ramya ramya.victory at gmail.com writes: I have the code for the density plot j - 8 plot(density(diff_in_sample[,1]), main = list.files()[j]) for(i in 1:25){ lines(density(diff_in_sample[,i]))

[R] Need advises on mixed-effect model ( a concrete example)

2011-02-03 Thread wphantomfr
Dear R-help members, I'm trying to run LME model on some behavioral data and need confirmations about what I'm doing... Here's the story... I have some behavioral reaction time (RT) data (participants have to detect dome kind of auditory stimuli). the dependant variable is RT measured in

[R] coxph fails to survfit

2011-02-03 Thread Bond, Stephen
I have a model with quant vars only and the error message does not make sense: (mod1 - coxph(Surv(time=strt,time2=stp,event=(resp==1))~ +incpost+I(amt/1e5)+rate+strata(termfac), subset=dt2010-08-30, data=inc,method=efron)) Call: coxph(formula = Surv(time = strt, time2 = stp, event

Re: [R] tapply output as a dataframe

2011-02-03 Thread Graves, Gregory
This works. Thanks. Gregory A. Graves, Lead Scientist Everglades REstoration COoordination and VERification (RECOVER) Wetland Watershed Sciences / Restoration Sciences Department South Florida Water Management District Phones:  DESK: 561 / 682 - 2429       CELL:  561 / 719 - 8157

[R] My own distribution in survreg function

2011-02-03 Thread spooky
Hello, I´m trying to do some analysis using survreg function. I need to implement there my own distribution with density: lambda*exp(-lambda*y), where y = a1/(1+exp(-a2*x)). a1, a2 are unknown parameters and x 0. I need to get estimates of a1 and a2 (and lambda of course) I’m really

[R] replacement bootstrapping

2011-02-03 Thread Mhairi
Hi there I am looking at the functional response (the consumption of single predators of prey over a range of prey densities) and Im having issues with the following script when trying to obtain mutliple replicates of coefficients (a and h) from the following nls model based on Hollings disc

[R] Changing the direction of axis labels on a plot

2011-02-03 Thread Longe
Dear list, Plots generated with the plot command have labels on the vertical y axis rotated counterclockwise. How do I specify that they should be positioned horizontally (I mean each label should read from left to right)? Thank you. L. __

Re: [R] Changing the direction of axis labels on a plot

2011-02-03 Thread David Winsemius
On Feb 3, 2011, at 1:16 PM, Longe wrote: Dear list, Plots generated with the plot command have labels on the vertical y axis rotated counterclockwise. How do I specify that they should be positioned horizontally (I mean each label should read from left to right)? ?par The las

Re: [R] error in density plot

2011-02-03 Thread David Winsemius
On Feb 3, 2011, at 2:14 PM, Ben Bolker wrote: On 02/02/2011 09:29 AM, David Winsemius wrote: On Feb 2, 2011, at 8:22 AM, Ben Bolker wrote: Ramya ramya.victory at gmail.com writes: I have the code for the density plot j - 8 plot(density(diff_in_sample[,1]), main = list.files()[j]) for(i

Re: [R] error in density plot

2011-02-03 Thread Ben Bolker
My concern was that it was outside the density function and I thought the density function would throw an error before it passed anything to na.omit(). plot(na.omit(density(c(1,1,1,1,1,NA,4,4,4,4))) ) Error in density.default(c(1, 1, 1, 1, 1, NA, 4, 4, 4, 4)) : 'x' contains missing

Re: [R] Changing the direction of axis labels on a plot

2011-02-03 Thread Peter Alspach
Tena koe ?par and check the las argument. HTH Peter Alspach -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Longe Sent: Friday, 4 February 2011 7:16 a.m. To: r-help@r-project.org Subject: [R] Changing the direction

[R] use summary

2011-02-03 Thread Hongwei Dong
Hi, dear R users, I'm running a Tobit regression and using summary to display model results. It used to work. But this time, I kept getting this: summary(RES_TOBIT) Length Class Mode 1 vglm S4 Could anyone tell me how to solve this problem, and why I got this problem? Thanks.

Re: [R] coxph fails to survfit

2011-02-03 Thread David Winsemius
On Feb 3, 2011, at 2:14 PM, Bond, Stephen wrote: I have a model with quant vars only and the error message does not make sense: (mod1 - coxph(Surv(time=strt,time2=stp,event=(resp==1))~ +incpost +I(amt/1e5)+rate+strata(termfac), subset=dt2010-08-30, data=inc,method=efron))

Re: [R] exact logistic regression

2011-02-03 Thread Łukasz Ręcławowicz
2011/2/3 Den d.kazakiew...@gmail.com Thank you again It is funny how stupid I was Elrm, clogit {survival} or exactLoglinTest are only exact-like, the truth is, R don't have it... and glm is poor. http://sas-and-r.blogspot.com/2010/12/example-818-monte-carlo-experiment.html

[R] R Data Manipulation - Transposing Data by a Given Column, Like User_ID

2011-02-03 Thread Mike Schumacher
Hello, I'd like to transpose data to create an analysis-friendly dataframe. See below for an example, I was unable to use t(x) and I couldn't find a function with options like PROC TRANSPOSE in SAS. The ideal solution handles variable quantities of SITE - but beggars can't be choosers. :-)

Re: [R] coxph fails to survfit

2011-02-03 Thread Bond, Stephen
Responding to the suggestion by D Winsemius : s1 - survfit(mod1,newdata=inc[50050:50100,c(strt,stp,incpost, amt,rate, termfac)], + se.fit=F,individual=T,type=aa) Error in Surv(time = strt, time2 = stp, event = (resp == 1)) : object 'resp' not found it appears it wants to fit

[R] hubers function in R MASS library : problem and solution

2011-02-03 Thread Feiming Chen
Hello: I found the hubers function in MASS library is NOT working on the following data: a -

Re: [R] R Data Manipulation - Transposing Data by a Given Column, Like User_ID

2011-02-03 Thread Eik Vettorazzi
Hi Mike reshape will be your friend. reshape(RAW,direction=wide,timevar=SITE,idvar=USER_ID) there is also the 'reshape'-package, which can do some more sophisticated transformations. hth. Am 03.02.2011 20:41, schrieb Mike Schumacher: Hello, I'd like to transpose data to create an

Re: [R] R Data Manipulation - Transposing Data by a Given Column, Like User_ID

2011-02-03 Thread Steve Lianoglou
Hi, On Thu, Feb 3, 2011 at 2:41 PM, Mike Schumacher mike.schumac...@gmail.com wrote: Hello, I'd like to transpose data to create an analysis-friendly dataframe.  See below for an example, I was unable to use t(x) and I couldn't find a function with options like PROC TRANSPOSE in SAS. The

[R] rgenoud for multiple chips: does a more recent special version of snow exist?

2011-02-03 Thread Dimitri Liakhovitski
Dear everyone, I am trying to run rgenoud on several chips simultaneusly. I used the instructions provided on Jasjeet Sekhon's Homepage (http://sekhon.berkeley.edu/rgenoud/multiple_cpus.html). However, I have the newer version of R (R 2.12) installed - for a 64-bit machine. So, when I tried to

Re: [R] rgenoud for multiple chips: does a more recent special version of snow exist?

2011-02-03 Thread Dimitri Liakhovitski
Just a small correction: the package snow does install. But once I try to load it: library(snow), I get an error: Error: package 'snow' was built before R 2.10.0: please re-install it Dimitri On Thu, Feb 3, 2011 at 3:57 PM, Dimitri Liakhovitski dimitri.liakhovit...@gmail.com wrote: Dear

[R] Generalized Estimating Equations and a Reviewer Question I can’t answer

2011-02-03 Thread James Ewing
I am using the R statistical package in a pretty straightforward manner, just interested in getting summary statistics and reliable estimates of means, variances, confidence intervals, p-values using standard tests, etc. I've been using the generalized estimating equation package because I

Re: [R] R Data Manipulation - Transposing Data by a Given Column, Like User_ID

2011-02-03 Thread Dennis Murphy
Hi: This also works, except that the result is of class 'table': xtabs(COUNTS ~ USER_ID + SITE, data = RAW) SITE USER_ID SITE1 SITE2 SITE3 1101322 2101212 31344 0 4 0 099 If you need a data frame, then the earlier

Re: [R] any similiar R fuction for matlab function 'fprintf'?

2011-02-03 Thread Zunqiu Chen
Thanks a lot! It really helps. Zunqiu From: Jude Ryan [mailto:jr...@marketshare.com] Sent: Thursday, February 03, 2011 3:28 PM To: Zunqiu Chen Cc: R-help@r-project.org Subject: Re: [R] any similiar R fuction for matlab function 'fprintf'? There does not seem to be a function exactly similar to

Re: [R] problem subsetting a data frame

2011-02-03 Thread Pete Brecknock
try subset(D, D$x 5|D$y 5) HTH Pete -- View this message in context: http://r.789695.n4.nabble.com/problem-subsetting-a-data-frame-tp3258981p3259360.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing

[R] Easy help with plots, font size

2011-02-03 Thread gigi1234
I am trying to make some plots for a poster. Each one needs to be 6 inches by inches. Right now the fonts are too small and the plots don't read well on my poster. I am pretty much an R newbie and I can't figure out how to change the fonts. It would also be nice to know how to specify the size of

Re: [R] any similiar R fuction for matlab function 'fprintf'?

2011-02-03 Thread Jude Ryan
There does not seem to be a function exactly similar to MATLAB's fprintf in R, but you can achieve pretty much the same results using something like the code below: a - 1:10 b - 11:20 ab - cbind(a,b) sink(C:\\R\\test.txt) # open file to write data to - file will be deleted if it exists

Re: [R] Changing the direction of axis labels on a plot

2011-02-03 Thread Longe
On 02/03/2011 01:57 PM, Peter Alspach wrote: Tena koe ?par and check the las argument. HTH Peter Alspach Thank you, Peter, and also David and William. The las argument indeed helps in setting the tick labels horizontally. Beautiful! But how do I rotate also the axis label, which

  1   2   >