Re: [R] Multiple groups barplot

2012-11-13 Thread Jim Lemon
On 11/14/2012 11:04 AM, michele caseposta wrote: Hi everyone, I have a certain number of samples and I want to visualize the groups those samples belong to. For example, suppose to have three variables, age, sex, and smoker/nonsmoker, and three samples, S1, S2, S3. S1 is 35, male, nonsmoker S2

Re: [R] numbering observations: help please!

2012-11-13 Thread Jeff Newmiller
On Tue, 13 Nov 2012, Paul Artes wrote: Dear Friends, I have the very simple problem of needing to number observations in a data frame. After scratching the rest of my hair off my head without inspiration, I'm using a silly loop. I'm sure that there is a much more elegant and faster solution - c

Re: [R] no y-axis

2012-11-13 Thread Jim Lemon
On 11/13/2012 11:01 PM, Geophagus wrote: Hi Jim and thanks for your answer. It does not work how I want. When I use your proposal, the values are superimposed like shown on the pic. pic.png Thats my code (what I need is a y-scale with the fol

Re: [R] numbering observations: help please!

2012-11-13 Thread Rolf Turner
On 14/11/12 14:50, Paul Artes wrote: Dear Friends, I have the very simple problem of needing to number observations in a data frame. After scratching the rest of my hair off my head without inspiration, I'm using a silly loop. I'm sure that there is a much more elegant and faster solution - can

Re: [R] Getting information encoded in a SAS, SPSS or Stata command file into R.

2012-11-13 Thread andrewH
Wow! After reading Jan's post, I said "Great, I'll do that," because it was the closest to what I originally had in mind. Then I read Ista's post, and said "I think I'l try that first," because it got me back on the track of following directions in the R Data Import/Export manual. Then I read Anth

[R] How to filter xml value in R?

2012-11-13 Thread Manish Gupta
Hi, I have one xml file. First node Second node Third node Fourth node for (i in 1:xmlSize()) { print(Class[i]) # how can i filter Node1 ? } by using xmlChildren(Class), i get nodes of Class. How can i filter Node1 and print other elements of Class node? Re

Re: [R] Random sampling many times and run through glm model

2012-11-13 Thread chuck.01
see: ?boot SASandRlearn wrote > I have a large dataset from which i need to take a random sample many > times ( say N=50) and run it through the same glm() - logistic regression > model everytime ( 50 times ) and capture the chi-square p-values ( Pr > > ChiSq ) of the variables for each run an

[R] Random sampling many times and run through glm model

2012-11-13 Thread SASandRlearn
I have a large dataset from which i need to take a random sample many times ( say N=50) and run it through the same glm() - logistic regression model everytime ( 50 times ) and capture the chi-square p-values ( Pr > ChiSq ) of the variables for each run and output average p-value of the variables

[R] Macro Variable in R

2012-11-13 Thread SASandRlearn
I have over 300 variables in my table. I want to choose only a handful of those variables to run through many procedures. Lm(), glm() etc..i have over 10 procedures that i need to run those variables everytime. Those handful of variables can change everytime if output is satisfactory or not. I ha

Re: [R] Proc Nnpar1way with D option - equivalent in R

2012-11-13 Thread SASandRlearn
Dan, what you suggested worked out well. This code below also worked out well for me and it matches with SAS output. Ks <- cbind(x,fitted(d1logit)) ks.df <- data.frame(Ks) x <- subset(ks.df,x==0,select=c(V2)) y <- subset(ks.df,x==1,select=c(V2)) ks.test(x[,'V2'], y[,'V2'], alternative = c("two.si

[R] numbering observations: help please!

2012-11-13 Thread Paul Artes
Dear Friends, I have the very simple problem of needing to number observations in a data frame. After scratching the rest of my hair off my head without inspiration, I'm using a silly loop. I'm sure that there is a much more elegant and faster solution - can anyone help? Here is an example: my.

Re: [R] Bootstrapping issues

2012-11-13 Thread Clive Nicholas
Thank you for your answer - I will consult the help file to see if it has anything to useful to say by way of a solution - but I don't understand why you accused me of shouting. I merely pasted in the R output which contained the heading of the results in block letters: I honestly didn't know that

Re: [R] help formatting data for clustering

2012-11-13 Thread arun
Hi, You could also try: dta <- read.table(text=" 1 , 45 , 32, 45, 23 2 , 34 4, 11, 43, 45 ",sep=",",fill=TRUE) library(reshape)  dtanew<-reshape(dta,varying=2:5,v.name="brand",idvar="V1",direction="long")[,c(1,3)]  dtanew1<-dtanew[complete.cases(dtanew),]  dtanew1<-dtanew1[order(dtanew1$V1),]  col

[R] Multiple groups barplot

2012-11-13 Thread michele caseposta
Hi everyone, I have a certain number of samples and I want to visualize the groups those samples belong to. For example, suppose to have three variables, age, sex, and smoker/nonsmoker, and three samples, S1, S2, S3. S1 is 35, male, nonsmoker S2 is 24, female, nonsmoker S3 is 24, female, smoker

Re: [R] How to permanently change console colours in R

2012-11-13 Thread vinay_ragas
Hello Peter Ehlers I tried your suggestion. But I couldnt save the settings into Rconsole file while using that. So i temporarily used my another console settings file and tried changing the Rconsole from \etc, but still gives an error. Anyhow will update my R tomorrow and try your suggestion ag

Re: [R] How to permanently change console colours in R

2012-11-13 Thread Peter Ehlers
On 2012-11-13 10:49, vinay_ragas wrote: Hello. I am new to R and I like it very much... I am learning to use it day-by-day. I have a query which might be a novice level for you. I want to know how to change the background and text colours in the R console. Doing google searches, I found to go to

Re: [R] How do I step thru all lines (including step into sub-routines) in a R script?

2012-11-13 Thread William Dunlap
I am not familiar with debugger(). I only showed how to list all function definitions in a group of files. Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com From: Michael [mailto:comtech@gmail.com] Sent: Tuesday, November 13, 2012 2:59 PM To: William Dunlap Cc: r-help Subject: Re: [R] H

Re: [R] Tukey test for subgroups in a data frame

2012-11-13 Thread arun
Hi, To extract the p values alone: lapply(split(dat1,dat1$date),function(x) TukeyHSD(aov(value~name,data=x),"name",ordered=TRUE)[[1]][4]) #$`2008-10-05` #[1] 0.1402197 #$`2008-11-05` #[1] 0.004488184 #$`2008-12-05` #[1] 0.5441151 A.K. - Original Message - From: arun To: raz Cc: R he

Re: [R] How do I step thru all lines (including step into sub-routines) in a R script?

2012-11-13 Thread Michael
Great help! Thanks a lot! The only problem is how do I escape from a big loop? Lets say after a few iterations in that big loop, I've already got enough of the loop and wanted to escape the loop and debug the next line after the loop...? Thanks again! On Tue, Nov 13, 2012 at 4:54 PM, William Du

Re: [R] How do I step thru all lines (including step into sub-routines) in a R script?

2012-11-13 Thread William Dunlap
Untested, you probably want to add pattern=\\.R$ or similar things to the dir() call that lists all the files: filenames <- dir(directoryName, recursive=TRUE, full.names=TRUE) unlist(lapply(filenames, function(file)namesOfFunctionsDefined(parse(file Bill Dunlap Spotfire, TIBCO Software wdunl

Re: [R] Can't format x axis on a stacked plot of a zoo object

2012-11-13 Thread Gabor Grothendieck
On Tue, Nov 13, 2012 at 5:30 PM, Vindoggy ! wrote: > > As an example data set: > > set.seed(1) > z.Date <- as.Date(paste(2003, 02, c(1, 3, 7, 9, 14), sep = "-")) > z <- zoo(cbind(left = rnorm(5), right = rnorm(5, sd = 0.2)), z.Date) > > tt<-time(z) > > > > fmt<-"%b-%d" > > labs<-format(tt,fmt) > p

Re: [R] How do I step thru all lines (including step into sub-routines) in a R script?

2012-11-13 Thread Michael
Thanks a lot! How do I iteratively loop your function thru all scripts under a big folder and its sub-folders? Thanks again! On Tue, Nov 13, 2012 at 4:45 PM, William Dunlap wrote: > You can make a list of the names of the functions defined at the top > level in a script using the following.

Re: [R] How do I step thru all lines (including step into sub-routines) in a R script?

2012-11-13 Thread William Dunlap
You can make a list of the names of the functions defined at the top level in a script using the following. namesOfFunctionsDefined <- function (expr) { # expr is typically output of parse(file) expr <- as.list(expr) isFunctionAssignment <- function(expr) is.call(expr) && identical(expr[[

[R] Effective degrees of freedom

2012-11-13 Thread Mario A. Pardo
Greetings, I am performing a simple Pearson's correlation test. Length of both vectors is 40, therefore the resulting df is 38. Nevertheless, a colleague is asking me for the "effective degrees of freedom". As far as I understand, those degrees of freedom have to be estimated for more complex

[R] about systemfit package

2012-11-13 Thread Sonia Amin
Dear friends, I have written the following lines in R console wich already exist in pdf file systemfit: data( "GrunfeldGreene" ) library( "plm" ) GGPanel <- plm.data( GrunfeldGreene, c( "firm", "year" ) ) greeneSur <- systemfit( invest ~ value + capital, method = "SUR", + data = GGPanel ) greenSur

Re: [R] Matrix in R

2012-11-13 Thread Haszun
It's a bit complicated. Is there any shorter way? Is there possibility to read datas from .csv as matrix, like this which i want to have? -- View this message in context: http://r.789695.n4.nabble.com/Matrix-in-R-tp4649426p4649429.html Sent from the R help mailing list archive at Nabble.com. _

Re: [R] OT: Any web based report delivery software that support R out there ?

2012-11-13 Thread Gergely Daróczi
Hello Paul, we are definitely doing something like this at http://rapporter.net based on our pander/rapport etc. packages. Please let me know if you would have further questions. BTW our `rapport` package (which definitely needs an update on CRAN, so please check out the recent version on Github

[R] Matrix in R

2012-11-13 Thread Haszun
Is there posiibility to read.table change in matrix? When i used read.table it gave me: V1 V2 V3 V4 [1,] "OsobaA" "10,00" "9,00" "8,00" [2,] "OsobaB" "2,00" "3,00" "1,00" [3,] "OsobaC" "5,00" "6,00" "4,00" I want to change it in: [1,] [2,] [3,] [4,

Re: [R] help formatting data for clustering

2012-11-13 Thread David Carlson
This is easier if you read the data into a list instead of creating a data frame since the number of values on each row is different. You may be able to modify this to fit your needs. The steps are 1) Read the file with readLines(); 2) split the lines into numeric vectors (one for each line); 3) r

[R] OT: Any web based report delivery software that support R out there ?

2012-11-13 Thread Paul
I'm looking for something, but I'm not sure quite how to describe it, so maybe the list can help. I use R to produce several different reports using database > ODBC > R > Sweave > pdf report. Ideally I would like to be able to upload the report 'templates' to a web page, and allow users to r

[R] Can't format x axis on a stacked plot of a zoo object

2012-11-13 Thread Vindoggy !
As an example data set: set.seed(1) z.Date <- as.Date(paste(2003, 02, c(1, 3, 7, 9, 14), sep = "-")) z <- zoo(cbind(left = rnorm(5), right = rnorm(5, sd = 0.2)), z.Date) tt<-time(z) fmt<-"%b-%d" labs<-format(tt,fmt) plot(z[,1], xlab = "Time", ylab = "") If I plot the data and don't like the

Re: [R] How do I step thru all lines (including step into sub-routines) in a R script?

2012-11-13 Thread Duncan Murdoch
On 12-11-13 5:07 PM, Michael wrote: Is there a way to strip out all functions in hundreds of R script? And then I can create a script which does "debug(foo1); debug(foo2); debug(foo3);",etc? Not a simple one. You could try parsing all the scripts, and look for function definitions, and then s

Re: [R] How do I step thru all lines (including step into sub-routines) in a R script?

2012-11-13 Thread Michael
Is there a way to strip out all functions in hundreds of R script? And then I can create a script which does "debug(foo1); debug(foo2); debug(foo3);",etc? Thank you! On Tue, Nov 13, 2012 at 3:56 PM, Duncan Murdoch wrote: > On 12-11-13 4:50 PM, Michael wrote: > >> but there are hundreds of such

Re: [R] How do I step thru all lines (including step into sub-routines) in a R script?

2012-11-13 Thread Duncan Murdoch
On 12-11-13 4:50 PM, Michael wrote: but there are hundreds of such functions...? how to mark them all using "debug"? When you see you are about to enter one that you haven't marked, you can mark it from within the debugger. (So in some other debuggers you'd type "s" to step in; in R you need

Re: [R] How do I step thru all lines (including step into sub-routines) in a R script?

2012-11-13 Thread Michael
but there are hundreds of such functions...? how to mark them all using "debug"? thanks! On Tue, Nov 13, 2012 at 3:43 PM, Duncan Murdoch wrote: > On 12-11-13 4:05 PM, Michael wrote: > >> How do I step thru all lines (including step into sub-routines) in a R >> script? >> >> Hi all, >> >> I know

Re: [R] How do I step thru all lines (including step into sub-routines) in a R script?

2012-11-13 Thread Duncan Murdoch
On 12-11-13 4:05 PM, Michael wrote: How do I step thru all lines (including step into sub-routines) in a R script? Hi all, I know I can put a "browser()" into any place... but how to step into sub-routines? Keep pressing "n" at the break-point seems not getting me into the sub-routines? Mar

Re: [R] Missing values and geeglm

2012-11-13 Thread joann
model<-geeglm(outcome~predictor+confounder, family=binomial(link = "logit"), data=na.omit(DataMiss), corstr='ar1', id=id, std.err="san.se") There could be other variables in DataMiss that have many missing values, so when you apply na.omit() on DataMiss, you may be ending up with an empty data.f

[R] How do I step thru all lines (including step into sub-routines) in a R script?

2012-11-13 Thread Michael
How do I step thru all lines (including step into sub-routines) in a R script? Hi all, I know I can put a "browser()" into any place... but how to step into sub-routines? Keep pressing "n" at the break-point seems not getting me into the sub-routines? Thanks a lot! [[alternative HTML

[R] Starting the line at zero in ggplot

2012-11-13 Thread Maziar Mohaddes
Hi I have been looking around for a couple of days without being able to find a solution. I am trying to plot the following table using the package ggplot2 MonthMean SEM cry3m 3-0.05227273 0.1607422 cry6m 6 0.65826087 0.663873

Re: [R] Is function(x){x}(5) a valid expression?

2012-11-13 Thread Brian Diggs
On 11/13/2012 11:19 AM, Duncan Murdoch wrote: On 13/11/2012 1:33 PM, Jamie Olson wrote: I was surprised to notice that statements like: h = function(...){list(...)}(x=4) do not throw syntax errors. R claims that 'h' is now a function, but I can't seem to call it. > h = function(x){list(x)}(4

Re: [R] Getting information encoded in a SAS, SPSS or Stata command file into R.

2012-11-13 Thread David Winsemius
On Nov 13, 2012, at 7:20 AM, Anthony Damico wrote: > Hi Andrew, to work with the Current Population Survey with R, your best > best is to use a variant of my SAScii package that works with a SQLite > database (and therefore doesn't overload RAM). > > I have written obsessively-documented code ab

Re: [R] Is function(x){x}(5) a valid expression?

2012-11-13 Thread Duncan Murdoch
On 13/11/2012 1:33 PM, Jamie Olson wrote: I was surprised to notice that statements like: h = function(...){list(...)}(x=4) do not throw syntax errors. R claims that 'h' is now a function, but I can't seem to call it. > h = function(x){list(x)}(4) > is(h) [1] "function" "OptionalFunct

Re: [R] Is function(x){x}(5) a valid expression?

2012-11-13 Thread William Dunlap
The syntax expression(arg) means to call the value of 'expression' as a function with argument 'arg'. Hence you can do things like { function(x)x^2 } (11:13) # gives 121, 144, 169 or, weirder, eval(call("function", pairlist(x=NULL, base=2), quote(log(x,base (512) # gives 9 If 'expre

Re: [R] save/load and package namespaces

2012-11-13 Thread Duncan Murdoch
On 13/11/2012 1:45 PM, Jamie Olson wrote: Correct me if I'm wrong, but it also seems that more generally, everything works as long as the environment is 'below' .GlobalEnv. For example, x = function(){ y = 4 function()y } yfun = x() save(yfun,file = "yfun.RData") load("yfun.RData") yfu

Re: [R] Using lubridate to increment date by business days only

2012-11-13 Thread Sarah Goslee
Does this help at all: http://stackoverflow.com/questions/7595533/generating-a-time-series-with-a-specific-start-and-end-date Sarah On Tue, Nov 13, 2012 at 1:49 PM, ramoss wrote: > Hello, > > I know how to increment a date by calendar date: > > ticker$ldate <- ticker$tdate + days(5) > > How do I

Re: [R] How to visualize relation between two sets of rel. frequencies?

2012-11-13 Thread Stefan Sobernig
Rich, > I see at as an application of a Likert plot. I would start with this Indeed, I went with an HH likert() for now. I am not so sure about the scaling, though. So for now, I stick with counts ... but I will revisit that with a fresh mind tomorrow. Many thanks for your suggestion! //

[R] How to permanently change console colours in R

2012-11-13 Thread vinay_ragas
Hello. I am new to R and I like it very much... I am learning to use it day-by-day. I have a query which might be a novice level for you. I want to know how to change the background and text colours in the R console. Doing google searches, I found to go to preferences in Edit and to change them.

Re: [R] save/load and package namespaces

2012-11-13 Thread Jamie Olson
Correct me if I'm wrong, but it also seems that more generally, everything works as long as the environment is 'below' .GlobalEnv. For example, x = function(){ y = 4 function()y } yfun = x() save(yfun,file = "yfun.RData") load("yfun.RData") yfun() This works fine even when there are more

[R] Is function(x){x}(5) a valid expression?

2012-11-13 Thread Jamie Olson
I was surprised to notice that statements like: h = function(...){list(...)}(x=4) do not throw syntax errors. R claims that 'h' is now a function, but I can't seem to call it. > h = function(x){list(x)}(4) > is(h) [1] "function" "OptionalFunction" "PossibleMethod" > h() Error in list(x)

Re: [R] R + Hadoop on Amazon

2012-11-13 Thread Jamie Olson
The RHadoop wiki describes the dependencies that you need to have in order to install RHadoop. The only tricky thing is, as mentioned, the JAVA_HOME environmental variable. Other than that, just follow their instructions. I'm actually using the ElasticMapreduce tool to setup the cluster along wi

Re: [R] for loop

2012-11-13 Thread farnoosh sheikhi
thanks dear. method 2 worked very fast since my data is very big. Thanks a lot. :-)   Best,Farnoosh Sheikhi Cc: R help Sent: Monday, November 12, 2012 6:15 PM Subject: Re: for loop HI, You can do this in many ways: dat1<-read.table(text=" med1,med2,med3

[R] Comparing goodness of fit between two logistic regression models

2012-11-13 Thread hoguejm
Greetings, I want to compare the goodness-of-fit between several different models that I have developed using Logistic Regression. I have been doing some research and am sort of confused on how to do this. I know it is not as simple as in an OLS model, however since there is no "R-squared" valu

[R] Using lubridate to increment date by business days only

2012-11-13 Thread ramoss
Hello, I know how to increment a date by calendar date: ticker$ldate <- ticker$tdate + days(5) How do I increment it by business days only so that week-ends are not counted? So for example friday november 2 + 5days becomes friday november 9 & not wednesday nov 7. Thanks for your help. -- Vi

Re: [R] Matrix package will not loead

2012-11-13 Thread Prof Brian Ripley
On 13/11/2012 13:28, Uzuner, Tolga I wrote: Many thanks for your advice and assistance. Sadly, I am unable to install "from source" as my operating environment does not have Rtools or a compiler. Is there an old version compiled somewhere I can use ? Yes, in your 2.15.1 installation. Since

Re: [R] Using "apply" instead of "for" loop / multithreading

2012-11-13 Thread Flavio Barros
That worked better because of vectorization, but isn't multithreaded. To have this resource look at plyr package. On Mon, Nov 12, 2012 at 9:08 PM, Charles D. wrote: > it works really faster ! > thank you > > > > -- > View this message in context: > http://r.789695.n4.nabble.com/Using-apply-inst

Re: [R] Can't remember which package I used. Anyone can help please?

2012-11-13 Thread David Winsemius
On Nov 13, 2012, at 3:12 AM, HJ YAN wrote: > Dear R users > > I tried an example earlier to check the results using two different > methods of clustering with same data set, and for both methods, say method > A and method B. Also I decided to have same number of groups/clusters (here > 8 was cho

Re: [R] RODBC and ORACLE

2012-11-13 Thread mmgm
Follow up. After lots of hours around this i got a fix: 1) Deinstalled Java 2) Downloaded the R Source 3) Configured ". oraenv" 4) Made sure the libsqora.so.11.1 was on the LD_LIBRARY_PATH 5) compiled from the source with the standard ./configure and make make install After this RODBC started

[R] GAM model to reduce PACF of a model

2012-11-13 Thread PavloEs
I have asked this question on Stackoverflow and was told it does not relate to the sites' mission as it is statistical question, thus I brought it here. I am fitting a gam mode in the mgcv package to study associations of environmental pollutants and mortality. The aim is to choose a model with l

Re: [R] reshape

2012-11-13 Thread David Winsemius
On Nov 12, 2012, at 10:16 PM, arun wrote: > Hi, > You can try this: > dat1<-read.table(text=" > Rad:0 > Rad1:2 > Rad3:3 > ",sep="",header=FALSE) > > > > Variable<-do.call(rbind,lapply(strsplit(as.character(dat1[[1]]),split=":"),`[`,1)) > n11<-do.call(rbind,lapply(strsplit(as.character(dat1[[1

Re: [R] Tukey test for subgroups in a data frame

2012-11-13 Thread arun
HI, Try this: dat1<-read.table(text="   date name  value   10/5/2008  L 26   10/5/2008  L 30   10/5/2008  L 54   10/5/2008  L 25   10/5/2008 M 18   10/5/2008 M 21   10/5/2008 M 29   10/5/2008 M 17   11/5/2008  L 32   11/5/2008 

Re: [R] order in stacked barplot

2012-11-13 Thread John Kane
Could be few things but we probably need some sample data to get a feeling for what you are doing. The easiest way to supply data is to use the dput() function. Example with your file named "testfile": dput(testfile) Then copy the output and paste into your email. For large data sets, you

Re: [R] Invalid 'times' argument three-category ordered probit with maximum likelihood

2012-11-13 Thread David Winsemius
On Nov 12, 2012, at 2:16 PM, jackle1o4 wrote: > Hello, > First time poster here so let me know if you need any more information. I am > trying to run an ordered probit with maximum likelihood model in R with a > very simple model (model <- econ3 ~ partyid). Everything looks ok until i > try to ru

Re: [R] plot matrix

2012-11-13 Thread John Kane
Hi, I didn't see a response for this so here is one way to approach it using the reshape2 and ggplo2 packages. library(reshape2) library(ggplot2) dat1<-read.table(text=" year strong medium healtly 2007 0.606000 0.5101442 0.6226696 2006 1.398500 1.2362115 1.515 2005 2

Re: [R] reshape

2012-11-13 Thread Flavio Barros
I think that the better solution is to use the transform function. Lets suppose that your data is in table: > table <- transform(table, n12 = 2400 - n11) and its done. On Tue, Nov 13, 2012 at 4:16 AM, arun wrote: > Hi, > You can try this: > dat1<-read.table(text=" > Rad:0 > Rad1:2 > Rad3:3 > "

[R] Issues running sensitivity analysis

2012-11-13 Thread Dave Murray-Rust
Hello list, I'm trying to carry out a global sensitivity analysis using the "sensitivity" package. I have a model with 26 paramters, mostly normally distributed (with a few truncated to not go below 0). I've been trying both the fast99 and sobol2007 functions, but having problems with both: *

[R] sum of squared loadings after varimax?

2012-11-13 Thread Eric Williams
Is it possible to retrieve sums of squared loadings after applying varimax rotation? Here's the setup to my problem: I ran PCA using prcomp(). I then applied the Kaiser criterion to retain only the components having eigenvalues >= 1. (I know there's debate about the wisdom of that criterion, but

Re: [R] Proc Nnpar1way with D option - equivalent in R

2012-11-13 Thread Nordlund, Dan (DSHS/RDA)
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of SASandRlearn > Sent: Tuesday, November 13, 2012 4:26 AM > To: r-help@r-project.org > Subject: Re: [R] Proc Nnpar1way with D option - equivalent in R > > Dan > > Thank you for yo

[R] Confidence intervals in Ripley's K function - a little challenge...

2012-11-13 Thread AMFTom
I have plotted Ripley's K function for a spatial point pattern for 12 plots, with 39 Monte Carlo simulations for complete spatial randomness (CSR). I would like to analyse these data as follows: I would like to know for which plots the Ripley's K function deviates from CSR at a number of confide

[R] Polya distribution

2012-11-13 Thread Elahe m
hello I like to comput median and mean point and intreval estimation by polya posterior when super population is normal(35,sd=5) with 1000 repeat. 500 and 25 are population size and sample size. how do i do? help me please [[alternative HTML version deleted]] _

[R] About systemfit package

2012-11-13 Thread Sonia Amin
Dear friends, I have written the following lines in R console wich already exist in pdf file systemfit: data( "GrunfeldGreene" ) library( "plm" ) GGPanel <- plm.data( GrunfeldGreene, c( "firm", "year" ) ) greeneSur <- systemfit( invest ~ value + capital, method = "SUR", + data = GGPanel ) greenSur

[R] Restricted Domain Optimization Problem

2012-11-13 Thread McGehee, Robert
Hello, I'm hoping for some help implementing a general optimization problem in R. I'd like to write a program that for a vector of non-negative input values, x, returns a non-negative "normalized" vector y such that sum(y)==1, and y <= maxx (vector of maximum values), and for which sum((x-y)^2)

[R] Tukey test for subgroups in a data frame

2012-11-13 Thread raz
Hello, I have a data frame with the following columns: "date","name","value" the name is the same for each date I would like to get TukeyHSD p-value for the differences of "value" between "name"s in each "date" separately I tried different ANOVA (aov()) but can only get either tukey by "name" or b

Re: [R] Extract cell of many values from dataframe cells and sample from them.

2012-11-13 Thread Jean V Adams
Ben, Yes, lists can be used any time you have unequal row or column size. Matrices and arrays always have the same number of elements in each dimension. You'd have to provide an example for me to say how the indexing would work. Jean "Benjamin Ward (ENV)" wrote on 11/11/2012 05:16:51 AM:

Re: [R] Can't remember which package I used. Anyone can help please?

2012-11-13 Thread PIKAL Petr
Hi > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- > project.org] On Behalf Of HJ YAN > Sent: Tuesday, November 13, 2012 12:12 PM > To: r-help@r-project.org > Subject: [R] Can't remember which package I used. Anyone can help > please? > > Dear R users >

Re: [R] Getting information encoded in a SAS, SPSS or Stata command file into R.

2012-11-13 Thread Anthony Damico
Hi Andrew, to work with the Current Population Survey with R, your best best is to use a variant of my SAScii package that works with a SQLite database (and therefore doesn't overload RAM). I have written obsessively-documented code about how to work with the CPS in R here.. http://usgsd.blogspot

Re: [R] Getting information encoded in a SAS, SPSS or Stata command file into R.

2012-11-13 Thread Ista Zahn
Hi Andrew, You may be able to run the SPSS syntax file using pspp (http://www.gnu.org/software/pspp/) Best, Ista On Mon, Nov 12, 2012 at 11:23 PM, andrewH wrote: > Dear folks – > I have a large (26 gig) ASCII flat file in fixed-width format with about 10 > million observations of roughly 400 va

Re: [R] How to visualize relation between two sets of rel. frequencies?

2012-11-13 Thread Richard M. Heiberger
This is an interesting exercise. I see at as an application of a Likert plot. I would start with this tmp <- data.frame(x = c(0.1,0.6,0.2,0.1), y = c(0.5,0.2,0.2,0.1)) tmp$xx <- 1 tmp$yy <- tmp$x / tmp$y tmp$xy <- tmp$xx * tmp$x tmp$xxx <- tmp$xx - tmp$xy tmp$yyy <- tmp$yy -

[R] Simulation with cpm package

2012-11-13 Thread Christopher Desjardins
Hi, I am running the following code based on the cpm vignette's code. I believe the code is syntactically correct but it just seems to hang R. I can get this to run if I set the sims to 100 but with 2000 it just hangs. Any ideas why? Thanks, Chris library(cpm) cpmTypes <- c("Kolmogorov-Smirnov","M

Re: [R] multiply each row in a matrix with the help of the for loop

2012-11-13 Thread D. Rizopoulos
Another alternative is: aa <- array(0, dim = c(3,3,3)) a <- matrix(1, 3, ) for (i in 1:3) { a[i, ] <- -a[i, ] aa[, , i] <- a } aa I hope it helps. Best, Dimitris From: r-help-boun...@r-project.org [r-help-boun...@r-project.org] on behalf o

Re: [R] multiply each row in a matrix with the help of the for loop

2012-11-13 Thread arun
HI, May be this helps: list1<-lapply(lapply(1:3,function(i) {aa[1:i,,i]<-a[1:i,]*-1  return(aa[,,i])}),function(x) apply(x,2,function(i) ifelse(i==0,1,x))) res<-array(unlist(list1),dim=c(nrow(list1[[1]]),ncol(list1[[1]]),length(list1)))  res #, , 1 #  #    [,1] [,2] [,3] #[1,]   -1   -1   -1 #[2

Re: [R] Discrete trait Ornstein–Uhlenbeck in R?

2012-11-13 Thread Ben Bolker
KRAmazon alumni.uci.edu> writes: > Is there a package that will allow me to fit Brownian motion and > Ornstein–Uhlenbeck models of evolution for discrete traits? I know that > geiger and ouch have commands for fitting these models for continuous > traits, but these aren't suitable for discrete tr

Re: [R] Matrix package will not loead

2012-11-13 Thread Duncan Murdoch
On 13/11/2012 8:28 AM, Uzuner, Tolga I wrote: Many thanks for your advice and assistance. Sadly, I am unable to install "from source" as my operating environment does not have Rtools or a compiler. Is there an old version compiled somewhere I can use ? You might be able to find one on a mirr

Re: [R] Can't remember which package I used. Anyone can help please?

2012-11-13 Thread Mohammed Ouassou
try : sessionInfo() M.O On ti., 2012-11-13 at 11:12 +, HJ YAN wrote: > Dear R users > > I tried an example earlier to check the results using two different > methods of clustering with same data set, and for both methods, say method > A and method B. Also I decided to have same number of

Re: [R] standardized residuals / adjusted residuals

2012-11-13 Thread David Meyer
If I call chisq.test(x)$residuals ; I get the *standardized* residuals (even though it's called residuals) chisq.test(x)$stdres ; I get the *adjusted* standardized residuals (even though it's called stdres) Is this correct? I think, yes - as documented on the man page. Best David __

[R] How to visualize relation between two sets of rel. frequencies?

2012-11-13 Thread Stefan Sobernig
I am looking at a data set containing two variables (x,y), each of which represents relative frequencies (rounded): data.frame(x = c(0.1,0.6,0.2,0.1), y = c(0.5,0.2,0.2,0.1)) xy 1 0.1 0.5 2 0.6 0.2 3 0.2 0.2 4 0.1 0.1 each of the rows reflects a "relation" between x and y, for exampl

Re: [R] Quastion

2012-11-13 Thread R. Michael Weylandt
On Tue, Nov 13, 2012 at 9:57 AM, sisay eshetu wrote: > Hey Dear, > I have got aproblem with interpolation 2D transmisivity in the datasample= > data.frame, it is not running I got this (Error in > as.data.frame.default(x[[i]], optional = TRUE) : > cannot coerce class '"function"' into a dat

[R] Can't remember which package I used. Anyone can help please?

2012-11-13 Thread HJ YAN
Dear R users I tried an example earlier to check the results using two different methods of clustering with same data set, and for both methods, say method A and method B. Also I decided to have same number of groups/clusters (here 8 was chosen). I found a good graphical tool in R to compare the

Re: [R] no y-axis

2012-11-13 Thread Geophagus
Hi Jim and thanks for your answer. It does not work how I want. When I use your proposal, the values are superimposed like shown on the pic. pic.png Thats my code (what I need is a y-scale with the following interrupts: 5,10,100,1000,5000)

Re: [R] Getting information encoded in a SAS, SPSS or Stata command file into R.

2012-11-13 Thread Jan
Hi, If it is your objective to get your data in an ffdf, I suggest you look at the SAS/SPSS/Stata code to see where each column is starting, next try out the LaF package as it allows you to read in large fixed width format files and once y

Re: [R] Can't get R to recognize Java for rJava installation

2012-11-13 Thread gparab
I had similar issue. This worked for me: get in as root: export JAVA_HOME="/usr/java/jdk1.6.0_37/jre" export PATH=$PATH:$JAVA_HOME/bin ln -sf usr/java/default/bin/javah /usr/bin/javah ln -sf usr/java/default/bin/javap /usr/bin/javap (basically make sure you have all java* binaries that yo

Re: [R] Proc Nnpar1way with D option - equivalent in R

2012-11-13 Thread SASandRlearn
Dan Thank you for your reply. I will try what you recommended. yes.. i have a 1 and 0 as binary. Here is what i have so far d <- read.csv(c:/test.csv", header=T) dlogit <- glm(x ~ a + b + c, data = d, family = "binomial") attach(d) ks.test(x, fitted(values),alternative = c("two.sided"),exact

[R] Quastion

2012-11-13 Thread sisay eshetu
 Hey Dear, I have  got aproblem with interpolation 2D transmisivity in the datasample= data.frame, it is not running  I got  this  (Error in as.data.frame.default(x[[i]], optional = TRUE) :  cannot coerce class '"function"' into a data.frame). So, how  shall I manage this?? Regards, Siffan

Re: [R] Matrix package will not loead

2012-11-13 Thread Uzuner, Tolga I
Many thanks for your advice and assistance. Sadly, I am unable to install "from source" as my operating environment does not have Rtools or a compiler. Is there an old version compiled somewhere I can use ? > install.packages("H:\\Downloads\\Matrix_1.0-10.tar.gz", repos = NULL, > type="sour

Re: [R] Matrix package will not loead

2012-11-13 Thread Prof Brian Ripley
You will find the problem and solution in the list archives. The current version of Matrix can be installed *from source* on R (>= 2.15.0), as it claims. But if you install it on R >= 2.15.2 then it uses features of 2.15.2 and hence can only be run on R >= 2.15.2. And there was a warning abou

Re: [R] Bootstrapping issues

2012-11-13 Thread PIKAL Petr
Hi From: Clive Nicholas [mailto:cliveli...@googlemail.com] Sent: Tuesday, November 13, 2012 3:12 AM To: PIKAL Petr Cc: r-help@r-project.org Subject: Re: [R] Bootstrapping issues Petr Pikal replied: [...] > The following works > > results <- boot(data=test, statistic=bs, R=1000, A~B+C+D+C*D) >

[R] multiply each row in a matrix with the help of the for loop

2012-11-13 Thread Haris Rhrlp
Dear R users, I have this program aa<-array(rep(0,27),dim=c(3,3,3)) a<-matrix(rep(1,9),ncol=3) n<-0 for (i in 1:3) {            a[i,]<-a[i,]*(-1)       n<-n+1       aa[,,n]<-a[i,] } but i real want to multiply each row  with -1 according to for loop and after that to put it in the array.  I w

Re: [R] Matrix package will not loead

2012-11-13 Thread Duncan Murdoch
On 12-11-13 7:06 AM, Uzuner, Tolga I wrote: Dear Fellow R Users, I am having a problem with the Matrix package, in Windows XP on R 2.15.1 . This is the only package where I experience this. I remove the package first, re install, and then when trying to load, get a LoadLibrary failure as belo

[R] Matrix package will not loead

2012-11-13 Thread Uzuner, Tolga I
Dear Fellow R Users, I am having a problem with the Matrix package, in Windows XP on R 2.15.1 . This is the only package where I experience this. I remove the package first, re install, and then when trying to load, get a LoadLibrary failure as below. Thanks in advance for any assistance. Reg

[R] help formatting data for clustering

2012-11-13 Thread Raphael Bauduin
Hi, I'm a R beginner. I have data of this form: user_id, brand_id1, brand_id2, . for example: 1 , 45 , 32, 45, 23 2 , 34 4, 11, 43, 45 I'm looking for the right procedure to be able to cluster users. I am especially interested to know which functions to use at each step. I am currently abl

Re: [R] no y-axis

2012-11-13 Thread Jim Lemon
On 11/13/2012 06:59 AM, Geophagus wrote: thanks, that works fine! good idea. I have one last question regarding this problem. My y-scale now is grouped from 0 - 4000 in 1000. Is it possible to set the scale into not equal breaks like 5,10,100,1000,5000 ? My axis now: axis(2,at=seq(0,4000,1000),

  1   2   >