[R] using for loops with ggplot

2012-04-04 Thread Tarek Haddad
Hi all, I have been using ggplot for a few months and ran into this porblem, I am trying to use ggplot in a for loop and it is not working. if I do the following: data=as.data.frame(cbind(rnorm(10),rnorm(10),rnorm(10))) pp=ggplot(data, aes(x=(1:10), y=data[,1])) pp=pp+geom_line(aes(x=

[R] random sample from list

2012-04-04 Thread Daisy Englert Duursma
random selection of cells in raster based on distance from xy locations Hi, I am trying to sample a raster for random cells that occur within a specific distance of point locations. I have successfully found multiple ways of doing this but have memory issues with very large datasets. To overcome

Re: [R] How to close gwindow by automatially

2012-04-04 Thread j verzani
mrzung gmail.com> writes: > > Hi, all > > I am using gWidgets for making gui, and in trouble with closing gwindow. > > I want to close gwindow "A" by automatically when I click a button in > gwindow "A" that loads another gwindow "B" . > > for example. > > A<-gwindow(visible=FALSE) > open<-g

Re: [R] Fisher's LSD multiple comparisons in a two-way ANOVA

2012-04-04 Thread Richard M. Heiberger
Here is your example. The table you displayed in gigawiz ignored the two-way factor structure and interpreted the data as a single factor with 6 levels. I created the interaction of a and b to get that behavior. ## your example, with data stored in a data.frame tmp <- data.frame(x=c(76, 84, 78,

[R] How to close gwindow by automatially

2012-04-04 Thread mrzung
Hi, all I am using gWidgets for making gui, and in trouble with closing gwindow. I want to close gwindow "A" by automatically when I click a button in gwindow "A" that loads another gwindow "B" . for example. A<-gwindow(visible=FALSE) open<-gbutton(cont=A,"open new window",handler=function(h,..

Re: [R] Using download.file() to grab information from a Password Protected Website

2012-04-04 Thread R. Michael Weylandt
Authenticated access is sometimes a little harder than a simple download -- the RCurl package provides tools that will be helpful, but you'll need to tailor things to the sort of authentication used on the other end. getURL iprovides one example of password authentication in the examples. If you ar

Re: [R] How do I get a rough quick utility plot of a time series?

2012-04-04 Thread R. Michael Weylandt
Give a reproducible example (use dput()) and someone will be able to help you. Otherwise, we're just guessing at what your data looks like. Also, ?plot or ?matplot might help. Particularly, see the second example for matplot. It might be what you are looking for. A lesson of all this is though, p

Re: [R] Subscript Error

2012-04-04 Thread jim holtman
You should have the following statement as part of your startup for R: options(error=utils::recover) When an error occurs, you will be at the stack frame where is happens and you can examine the values of the variables that you are using and this should help a lot in tracking down your problem.

Re: [R] Subscript Error

2012-04-04 Thread Peter Ehlers
On 2012-04-04 14:25, z2.0 wrote: json_dir is a list of JSON lists mapping lat/long route points between locations using CloudMade's API. post_url is the URL of the HTTP request for (n in json_dir) { i = i + 1 if (typeof(json_dir[[i]]) != "NULL") { if

Re: [R] recover lost global function

2012-04-04 Thread Duncan Murdoch
On 12-04-04 5:15 PM, Sam Steingold wrote: * Duncan Murdoch [2012-04-04 17:00:32 -0400]: There's no warning when you mask a function with a non-function at top level, and little need for one, because R does the right search based on the fact that you're making a function call: c [1] 1 c(1,2)

Re: [R] Print std. Error separately from mle-class object

2012-04-04 Thread Aziz, Muhammad Fayez
Thank you Jeff for your input. I did realize just after posting the question that the summary fn returns an object whose "slots" can be read and that the slot containing the coefficient information is a matrix. Here is how I got the desired results through the following code in "mypanel" functi

Re: [R] Shapiro-Wilk cpoefficients: 2 Qs

2012-04-04 Thread Peter Ehlers
Hi Ted, On 2012-04-04 15:06, Ted Harding wrote: Greetings! I want to have the coefficients that R uses in shapiro.test() for the Shapiro-Wilk test for a prticular sample size, i.e. the a[i] in W = Sum(a[i]*x[i])/(Sum(x[i] - mean(x))^2) (where the x[i] are sorted). Two questions: Q1: Is the

Re: [R] Looking for the name of a certain kind of quantile plot

2012-04-04 Thread Carl Witthoft
Thanks, Chuck. That looks about right. And I would have provided repro code, but I was forced to write it in Matlab on account of corporate rules, and haven't translated to R yet. Carl Witthoft writes: > Hi, > While playing with quantile-quantile plots, I wrote up some code which > plots s

Re: [R] meaning of sigma from LM, is it the same as RMSE

2012-04-04 Thread Roy Mendelssohn
?summary.lm -Roy On Apr 4, 2012, at 4:47 PM, John Sorkin wrote: > Please forgive my re-sending this question. I did not see any replies from my > prior post. My apologies if I missed something. > > Is the sigma from a lm, i.e. > > fit1 <- lm(y~x) > summary(fit1) > summary(fit1)$sigma > > the

[R] identify with mfcol=c(1,2)

2012-04-04 Thread John Sorkin
Please forgive my re-sending this question. I did not see any replies from my prior post. My apologies if I missed something. I would like to have a figure with two graphs. This is easily accomplished using mfcol: oldpar <- par(mfcol=c(1,2)) plot(x,y) plot(z,x) par(oldpar) I run into trouble

[R] meaning of sigma from LM, is it the same as RMSE

2012-04-04 Thread John Sorkin
Please forgive my re-sending this question. I did not see any replies from my prior post. My apologies if I missed something. Is the sigma from a lm, i.e. fit1 <- lm(y~x) summary(fit1) summary(fit1)$sigma the RMSE (root mean square error) Thanks, John John David Sorkin M.D., Ph.D. Chief, Bios

Re: [R] How do I get a rough quick utility plot of a time series?

2012-04-04 Thread Hurr
Thanks again Michael, I finally had a little time today to look ar the zoo documentation. But I do not understand R and am incompetent to figure out how to use zoo to get the quick plot of unequal interval time series presented in the first posting (yes it's equal interval, but pretend it is not).

Re: [R] Remove carriage return in writing tab-delimited file.

2012-04-04 Thread Justin Haynes
take a look at ?paste paste(yourmatrix, sep='\t', collapse='') On Wed, Apr 4, 2012 at 2:58 PM, kickout wrote: > Having problems with the write.table function. I can write a tab delimited > file just fine, but for each line in my matrix its inputs a carriage return > when i dont want it to. > > F

Re: [R] Remove carriage return in writing tab-delimited file.

2012-04-04 Thread David Winsemius
On Apr 4, 2012, at 5:58 PM, kickout wrote: Having problems with the write.table function. I can write a tab delimited file just fine, but for each line in my matrix its inputs a carriage return when i dont want it to. For example my matrix might be: ID V1 V2 V3 FARY1004 1 2 3 FARY2067 2 3

[R] Remove carriage return in writing tab-delimited file.

2012-04-04 Thread kickout
Having problems with the write.table function. I can write a tab delimited file just fine, but for each line in my matrix its inputs a carriage return when i dont want it to. For example my matrix might be: ID V1 V2 V3 FARY1004 1 2 3 FARY2067 2 3 1 FARY4587 2 2 2 And I want the written File to b

Re: [R] how to load functions from file

2012-04-04 Thread David Winsemius
On Apr 4, 2012, at 6:10 PM, Sarah Goslee wrote: I just tried it, because I'm curious that way. If I search for "load functions into R" I get only this thread. If I search for load functions into R (no quotes), I get the referenced discussion from Henrik Bengtsson: ttps://stat.ethz.ch/pipermai

Re: [R] Print std. Error separately from mle-class object

2012-04-04 Thread Jeff Newmiller
Are you aware that the summary function normally returns a data value that you can extract values from and format to your hearts desire? try str(coef(summary(tmp))) and read ?mle-class (and try to provide a reproducible example next time) ---

Re: [R] how to load functions from file

2012-04-04 Thread Rolf Turner
On 05/04/12 10:10, Sarah Goslee wrote: I just tried it, because I'm curious that way. If I search for "load functions into R" I get only this thread. If I search for load functions into R (no quotes), I get the referenced discussion from Henrik Bengtsson: ttps://stat.ethz.ch/pipermail/r-help/20

Re: [R] how to load functions from file

2012-04-04 Thread Sarah Goslee
I just tried it, because I'm curious that way. If I search for "load functions into R" I get only this thread. If I search for load functions into R (no quotes), I get the referenced discussion from Henrik Bengtsson: ttps://stat.ethz.ch/pipermail/r-help/2008-September/173606.html As in so many a

[R] Shapiro-Wilk cpoefficients: 2 Qs

2012-04-04 Thread Ted Harding
Greetings! I want to have the coefficients that R uses in shapiro.test() for the Shapiro-Wilk test for a prticular sample size, i.e. the a[i] in W = Sum(a[i]*x[i])/(Sum(x[i] - mean(x))^2) (where the x[i] are sorted). Two questions: Q1: Is there a readymade R function from which I can extract t

Re: [R] how to load functions from file

2012-04-04 Thread Rolf Turner
On 04/04/12 22:32, Bert Gunter wrote: Rolf: Google on "load functions into R." A post referencing source() (from Henrik Bengtsson is the first hit. Tried that just now. The only hits I got were to *your* post; no hits on any post from Henrik Bengtsson. These things are never as easy and str

Re: [R] extract data

2012-04-04 Thread Rui Barradas
Hello, Roslina Zakaria wrote > > HI, > > > > I would like to extract data in a specific way.  For example, the rainfall > data > > > > 0,0,1.5,0,0, 3,1,2.5,0,0,0,0, 2.3,0,0,0, 2.1,1.4,0,0,0, 3,2,1,0,0,0... > > > > data_1: 1.5, 2.3   ( a single nonzero data between zeros data

Re: [R] convert a list to a data frame

2012-04-04 Thread z2.0
Have you looked at plyr? Generally, ldply works well for this sort of thing. -- View this message in context: http://r.789695.n4.nabble.com/convert-a-list-to-a-data-frame-tp4532206p4533257.html Sent from the R help mailing list archive at Nabble.com.

[R] Using download.file() to grab information from a Password Protected Website

2012-04-04 Thread Michael Roberts
I am new to R and have been spinning my wheels on the following. *Issue:* I have a membership to a website, and I want to grab data from the website using download.file(). download.file(url, destfile, method, quiet = T, mode = "w", cacheOK = TRUE) The R Documentation is helpful. However, I have

[R] Subscript Error

2012-04-04 Thread z2.0
json_dir is a list of JSON lists mapping lat/long route points between locations using CloudMade's API. post_url is the URL of the HTTP request for (n in json_dir) { i = i + 1 if (typeof(json_dir[[i]]) != "NULL") { if (i == 1) { dat_add

Re: [R] Selecting obs within groups defined by 2 variables

2012-04-04 Thread Rui Barradas
Hello, > > The by function does not seem to allow two variables in the Indices > argument: > Yes it does, but you must use a list of variables. (Read the help for 'by': INDICESa factor or a list of factors, each of length nrow(data).) mydata <- read.table(text=" C1 C2 C3 1 x 1 1 x 2 1

Re: [R] Plotting lines and points on the second plot when using gap.plot in plotrix

2012-04-04 Thread sophykim
you need to subtract the length of gap in y-axis. Good luck! -- View this message in context: http://r.789695.n4.nabble.com/Plotting-lines-and-points-on-the-second-plot-when-using-gap-plot-in-plotrix-tp804226p4533129.html Sent from the R help mailing list archive at Nabble.com. _

Re: [R] Selecting obs within groups defined by 2 variables

2012-04-04 Thread Naomi Sugie
Hi Peter, Thanks! This was very helpful and worked perfectly. Naomi On Apr 4, 2012, at 4:52 PM, Peter Alspach wrote: Tena koe Naomi There are lots of ways to do this. Here are a couple (note I've made a minor modification to your example): naomi C1 C2 C3 1 1 x 1 2 1 x 2 3 1 y

Re: [R] convert a list to a data frame

2012-04-04 Thread David Winsemius
On Apr 4, 2012, at 4:54 PM, Sam Steingold wrote: * Sam Steingold [2012-04-04 14:58:15 -0400]: 1. the strings I replaced with and are very long; I wish I could replace them in the object all, not just in text i.e., I have a long list with elements with long names. how do I replace

Re: [R] meta-analysis, outcome = OR associated with a continuous independent variable

2012-04-04 Thread Thomas Lumley
On Thu, Apr 5, 2012 at 8:24 AM, Marie-Pierre Sylvestre wrote: > Hello everyone, > I want to do a meta-analysis of case-control studies on which an OR was > computed based on a continuous exposure. I have found several several > packages (metafor, rmeta, meta) but unless I misunderstood their main

Re: [R] recover lost global function

2012-04-04 Thread Sam Steingold
> * Duncan Murdoch [2012-04-04 17:00:32 -0400]: > > There's no warning when you mask a function with a non-function at top > level, and little need for one, because R does the right search based on > the fact that you're making a function call: > >> c > [1] 1 >> c(1,2) > [1] 1 2 why then am I get

Re: [R] recover lost global function

2012-04-04 Thread Sam Steingold
> * Duncan Murdoch [2012-04-04 17:00:32 -0400]: > > There's no warning when you mask a function with a non-function at top > level, and little need for one, because R does the right search based on > the fact that you're making a function call: > >> c > [1] 1 >> c(1,2) > [1] 1 2 why then am I get

[R] extract data

2012-04-04 Thread Roslina Zakaria
HI, I would like to extract data in a specific way.  For example, the rainfall data 0,0,1.5,0,0, 3,1,2.5,0,0,0,0, 2.3,0,0,0, 2.1,1.4,0,0,0, 3,2,1,0,0,0... data_1: 1.5, 2.3   ( a single nonzero data between zeros data) data_2: 3.1, 2.5, 2.1,1.4   ( two nonzero data between zero

[R] extract data

2012-04-04 Thread Roslina Zakaria
HI, I would like to extract data in a specific way.  For example, the rainfall data 0,0,1.5,0,0, 3,1,2.5,0,0,0,0, 2.3,0,0,0, 2.1,1.4,0,0,0, 3,2,1,0,0,0... data_1: 1.5, 2.3   ( a single nonzero data between zeros data) data_2: 3.1, 2.5, 2.1,1.4   ( two nonzero data between zeros data)

Re: [R] recover lost global function

2012-04-04 Thread Duncan Murdoch
On 12-04-04 4:52 PM, Sam Steingold wrote: Since R has the same namespace for functions and variables, c<- 1 kills the global function, which can be restored by c<- get("c",mode="function") Is there a way to prevent R from overriding globals or at least warning when I do that or at least warn

Re: [R] convert a list to a data frame

2012-04-04 Thread Sam Steingold
> * Sam Steingold [2012-04-04 14:58:15 -0400]: > > 1. the strings I replaced with and are very long; I wish I > could replace them in the object all, not just in text i.e., I have a long list with elements with long names. how do I replace all these long names with something shorter? ro

[R] recover lost global function

2012-04-04 Thread Sam Steingold
Since R has the same namespace for functions and variables, > c <- 1 kills the global function, which can be restored by > c <- get("c",mode="function") Is there a way to prevent R from overriding globals or at least warning when I do that or at least warning when I replace a functional value with

Re: [R] Selecting obs within groups defined by 2 variables

2012-04-04 Thread Peter Alspach
Tena koe Naomi There are lots of ways to do this. Here are a couple (note I've made a minor modification to your example): > naomi C1 C2 C3 1 1 x 1 2 1 x 2 3 1 y 1 4 1 y 2 5 2 x 1 6 2 x 2 7 2 x 3 8 2 y 1 9 2 y 2 > tapply(naomi[,3], naomi[,1:2], function(x) x[length

[R] meta-analysis, outcome = OR associated with a continuous independent variable

2012-04-04 Thread Marie-Pierre Sylvestre
Hello everyone, I want to do a meta-analysis of case-control studies on which an OR was computed based on a continuous exposure. I have found several several packages (metafor, rmeta, meta) but unless I misunderstood their main functions, it seems to me that they focus on two-group comparisons (bi

[R] Selecting obs within groups defined by 2 variables

2012-04-04 Thread Naomi Sugie
Hello, I am relatively new to R, and I am trying to select the last observation within a group, where the group is defined by two variables. One of the variables is a date. In the below example, C3 varies within C2, which varies within C1. I need to select the last observation in C3 for 4

[R] Deadlines Approaching: R User Conference Registration, Hotels, Student Scholarships

2012-04-04 Thread Frank Harrell
DEADLINE FAST APPROACHING – 8th Annual International R User Conference useR! 2012, Nashville, Tennessee USA Registration Deadlines: Early Registration: Passed Regular Registration: Mar 1- May 12 Late Registration: May 13 – June 4 On-Site Registration: June 12 – June 15 Please note: Nashville is

Re: [R] Rgui maintains open file handles after Sweave error

2012-04-04 Thread Yihui Xie
Herik's suggestion is an absolutely good practice which guarantees the device is always closed. That is what I did in the knitr package, so you can probably take a look at http://yihui.name/knitr/ Regards, Yihui -- Yihui Xie Phone: 515-294-2465 Web: http://yihui.name Department of Statistics, Iow

Re: [R] Rgui maintains open file handles after Sweave error

2012-04-04 Thread Alexander Shenkin
Thanks for the reply, Henrik. Process Explorer still shows the file handle as being open, but R only shows the following: > showConnections(all=TRUE) description class mode text isopen can read can write 0 "stdin" "terminal" "r" "text" "opened" "yes""no" 1 "stdout""termina

Re: [R] Rgui maintains open file handles after Sweave error

2012-04-04 Thread Henrik Bengtsson
See ?closeAllConnections Suggestion to the maintainer of Sweave: "atomify" the figure generation, e.g. use { pdf(); on.exit(dev.off()); {...}; } or similar, instead of { pdf(); {...}; dev.off(); } possibly by leaving a copy of the fault figure file for troubleshooting. /Henrik On Wed, Apr 4, 201

[R] how to avoid this : underflow occurred in 'lgammacor'

2012-04-04 Thread casperyc
Hi all, I am constructing a likelihood involving the following lbeta(j + a, k - j + b) where j,k are constants and a and b are parameters (>0). While doing the optimization, the error sometimes occurs, In lbeta(j + a, k - j + b) : underflow occurred in 'lgammacor' Is there a way to avoid it?

[R] Rgui maintains open file handles after Sweave error

2012-04-04 Thread Alexander Shenkin
Hello Folks, When I run the document below through sweave, rgui.exe/rsession.exe leaves a file handle open to the sweave-001.pdf graphic (as verified by process explorer). Pdflatex.exe then crashes (with a Permission Denied error) because the graphic file is locked. This only seems to happen whe

Re: [R] Calculating NOEL using R and logistic regression - Toxicology

2012-04-04 Thread Danielle Duncan
I suppose I'll just report a LC10 using the dose.p function in the package MASS using my glm fitted logistic regression on binomial data. Thanks everyone for ideas & input! The LOEC seems to be a flawed calculation...I'll research it. Again, thanks all! On Mon, Apr 2, 2012 at 2:45 PM, Danielle

Re: [R] convert a list to a data frame

2012-04-04 Thread Sam Steingold
Thanks for your reply! 1. the strings I replaced with and are very long; I wish I could replace them in the object all, not just in text 2. `all` is the result of as.data.frame(do.call("rbind",l),stringsAsFactors = FALSE) 3. I get my data frame as fr <- data.frame(audience =

Re: [R] Calculating NOEL using R and logistic regression - Toxicology

2012-04-04 Thread Danielle Duncan
Thanks everyone for the advice, you raise interesting points. Maybe the best thing for me to do is do an ANOVA in R with binomial data (if possible) and find the lowest dose that gives a significant difference from the controls. On Mon, Apr 2, 2012 at 2:45 PM, Danielle Duncan wrote: > Hello, I us

Re: [R] plot with a regression line(s)

2012-04-04 Thread S Ellison
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Sam Steingold > > plot.glm <- function (x, y, file = NULL, xlab = > deparse(substitute(x)), > ylab = deparse(substitute(y)), main = NULL) { > m <- glm(

Re: [R] Question about randomForest

2012-04-04 Thread Liaw, Andy
> From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Saruman > > I dont see how this answered the original question of the poster. > > He was quite clear: the value of the predictions coming out > of RF do not > match what comes out of the predict function u

Re: [R] spaghetti plots in R

2012-04-04 Thread R. Michael Weylandt
Can't you just combine your matrices into a single matrix: rbind() or cbind() should do the job. Michael On Wed, Apr 4, 2012 at 12:24 PM, uday wrote: > Hi Liviu , > now I can see that function but the problem is that its only applicable for > single data frame. as I wrote in my first post that I

[R] using metafor for meta-analysis of before-after studies

2012-04-04 Thread MP . Sylvestre
Greetings, I wish to conduct a meta-analysis for which the outcome is a continuous variable measured on the same individuals before and after an intervention. Hence, the comparison is not made between two groups, but within groups, at diffrent times. Each study reports the mean outcome and S

Re: [R] spaghetti plots in R

2012-04-04 Thread Rui Barradas
Hello, uday wrote > > Hi Liviu , > now I can see that function but the problem is that its only applicable > for single data frame. as I wrote in my first post that I got 2 different > matrix with same dimensions ( 3x 12 here in example) , so if I plot normal > plot using plot function > plot(a

Re: [R] Trying to merge new data set to bottom of old data set. Both are zoo objects.

2012-04-04 Thread knavero
Okay, will do. Thanks for all the handy advice Gabor. Ugh, it's such a stupid bug once I actually know what is going on. I need to go over my Unix date/time format specifiers, and I'll probably use the rep function to simplify and reducing the amount of code. A lot of that is definitely new to me.

Re: [R] spaghetti plots in R

2012-04-04 Thread uday
Hi Liviu , now I can see that function but the problem is that its only applicable for single data frame. as I wrote in my first post that I got 2 different matrix with same dimensions ( 3x 12 here in example) , so if I plot normal plot using plot function plot(ak[1,],pre[1,],type="l") lines(ak[2,

[R] crosstabs and histograms with flexible binning of dates

2012-04-04 Thread davideps
Hi, First, thank you to Duncan Mackay for getting me started processing dates with R. Unfortunately, I need to do a little more than I initially expected. I have 5K lines of data that look like this: ID AREA DATE 0001 Center 2010-10-15 0002 Center 2010-01-02 0003 NorthWest

[R] Print std. Error separately from mle-class object

2012-04-04 Thread Aziz, Muhammad Fayez
Hi, I am using power.law.fit to get an mle-class object in tmp and print summary(tmp), coef(tmp) and logLik(tmp). I wanted to print the std. error for alpha separately as I want to show these values concisely in a graph legend. coef(summary(tmp)) displays the alpha and std. error jointly, while

Re: [R] BRugs crash, question

2012-04-04 Thread Jack Tanner
Bob O'Hara gmail.com> writes: > > On 4 April 2012 05:35, Jack Tanner hotmail.com> wrote: > > > samplesBgr("beta") # crash > > samplesBgr("beta", plot=FALSE) # also crash > > > > Have you plotted your histories? I haven't used samplesBgr() much, so I > don't know how stable it is (although I do

Re: [R] unable to move temporary installation

2012-04-04 Thread Henrik Bengtsson
My $.01 contribution without having read the complete thread: Some other process/service is locking your file/directory. There are a few Windows tools out there helping your to narrow down exactly which, e.g. http://www.guidingtech.com/10175/tools-to-delete-locked-files-in-windows/ /Henrik

Re: [R] Fisher's LSD multiple comparisons in a two-way ANOVA

2012-04-04 Thread Jinsong Zhao
On 2012-04-03 20:03, Rmh wrote: yes. See ?glht in the multcomp package, and the examples using glht in ?MMC in the HH package. Sent from my iPhone Thank you very much for the clues. However, I can't figure out how to construct the linfct in glht. I also tried to inverse the computation b

Re: [R] unable to move temporary installation

2012-04-04 Thread Uwe Ligges
On 03.04.2012 19:43, Drew Tyre wrote: A final followup. I have identified a rather extreme workaround. The problem arises when the function utils:::unpackPkgZip uses file.rename(...) to move the unzipped binary package from the temporary directory that it was unpacked into into the proper direc

Re: [R] convert a list to a data frame

2012-04-04 Thread Bert Gunter
??? What is a? ?str str(a) ?do.call On Wed, Apr 4, 2012 at 9:34 AM, Sam Steingold wrote: > sorry, google does give a good start. > >> Google on "R convert list to data frame". > >  as.data.frame(do.call("rbind",a)) > > returns an object which I don't understand. >> summary(f) >  name.Length  

Re: [R] cluster analysis with pairwise data

2012-04-04 Thread ilai
On Wed, Apr 4, 2012 at 10:12 AM, Petr Savicky wrote: > On Wed, Apr 04, 2012 at 01:32:10PM +0200, paladini wrote: >  Var1 <- c("(1,2)", "(7,8)", "(4,7)") >  Var2 <- c("(1,5)", "(3,88)", "(12,4)") >  Var3 <- c("(4,2)", "(6,5)", "(4,4)") >  DF <- data.frame(Var1, Var2, Var3, stringsAsFactors=FALSE)

Re: [R] convert a list to a data frame

2012-04-04 Thread Sam Steingold
sorry, google does give a good start. > Google on "R convert list to data frame". as.data.frame(do.call("rbind",a)) returns an object which I don't understand. > summary(f) name.Length name.Class name.Modestatus 1 -none- characterLength:4445 1

Re: [R] simulate correlated binary, categorical and continuous variable

2012-04-04 Thread Greg Snow
How are you calculating the correlations? That may be part of the problem, when you categorize a continuous variable you get a factor whose internal representation is a set of integers. If you try to get a correlation with that variable it will not be the polychoric correlation. Also do you need

Re: [R] image.plot adding x-axis labels. Please Help

2012-04-04 Thread ilai
On Wed, Apr 4, 2012 at 6:05 AM, David Winsemius wrote: > > On Apr 3, 2012, at 11:16 PM, David Lyon wrote: > >> Sorry that didnt work for me, any ideas? > > > You _could_ indicate which package the image.plot function comes from. You > _could_ include dput on a sufficient segment of `data1` to offe

[R] markov regime switching models

2012-04-04 Thread Marie Morel
Dear Sir, I saw a question from a member in 2007 asking for regime switching model and I am looking for the same kind of model. I also saw a "project" named RSNL but I don't know if this one is available and if we can have access to the code to change things if needed... actually I used to buil

Re: [R] Looking for the name of a certain kind of quantile plot

2012-04-04 Thread cberry
Carl Witthoft writes: > Hi, > While playing with quantile-quantile plots, I wrote up some code which > plots something strangely different. Here's the pseudocode: > > testhist <- hist(sample_data) > refhist <- hist(rnorm(n, mean=0,sd=1)) # for some large-ish n > cumtest <- cumsum(testhist) > cu

Re: [R] cluster analysis with pairwise data

2012-04-04 Thread Petr Savicky
On Wed, Apr 04, 2012 at 01:32:10PM +0200, paladini wrote: > Hello, > I want to do a cluster analysis with my data. The problem is, that the > variables dont't consist of single value but the entries are pairs of > values. > That lokks like this: > > > Variable 1:Variable2: Variable3:

Re: [R] A contour plot question - vis.gam () function in "mgcv"

2012-04-04 Thread ilai
On Tue, Apr 3, 2012 at 6:22 PM, Peter Ehlers wrote: > On 2012-04-03 15:49, ilai wrote: >> >> Try to plot the points first followed by vis.gam(...,type='contour', >> color='bw', add=T) instead of vis.gam followed by points. >> >> HTH > > > Or, if vis.gam gives you default scales that you wish to pr

Re: [R] Filling empty List in a FOR LOOP

2012-04-04 Thread MacQueen, Don
Try A[[1]] <- NA (It is of course up to you to do the tests, presumably using if(), to decide when to assign NA to the list element.) -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 On 3/31/12 7:53 PM, "michaelyb" wrot

Re: [R] cluster analysis with pairwise data

2012-04-04 Thread David L Carlson
You can create distance matrices for each Variable, square them, sum them, and take the square root. As for getting the data into a data frame, the simplest would be to enter the three variables into six columns like the following: data [,1] [,2] [,3] [,4] [,5] [,6] [1,]1215

Re: [R] spaghetti plots in R

2012-04-04 Thread Liviu Andronic
On Wed, Apr 4, 2012 at 5:04 PM, uday wrote: > Hi Liviu , > thanks for post , but I could not find findFn('spaghetti') , I can see the > following functions in sos package > Extract.findFn > findFn > After installing 'sos', use the 'findFn()' function. For example, run findFn('spaghetti') See the

Re: [R] spaghetti plots in R

2012-04-04 Thread uday
Hi Liviu , thanks for post , but I could not find findFn('spaghetti') , I can see the following functions in sos package Extract.findFn findFn grepFn hits installPackages PackageSum2 PackageSummary print.findFn sortFindFn summary.findFn unionFindFn writeFindFn2xls -- View this messag

Re: [R] plot with a regression line(s)

2012-04-04 Thread David Winsemius
On Apr 4, 2012, at 11:30 AM, R. Michael Weylandt > wrote: I'm not sure what your definition of easier would be, but there are some style things you might want to be aware of: I) the name is likely to hit up against the S3 generic plot() when applied to a glm object. This might lead to str

Re: [R] Trying to understand factors

2012-04-04 Thread MacQueen, Don
I'd like to make the distinction between the purpose of factors, i.e., what they are intended for, and how that purpose is accomplished. Their purpose is for use in statistical models. The simplest example is analysis of variance, where predictors are commonly referred to as factors. Factors in R

Re: [R] plot with a regression line(s)

2012-04-04 Thread R. Michael Weylandt
I'm not sure what your definition of easier would be, but there are some style things you might want to be aware of: I) the name is likely to hit up against the S3 generic plot() when applied to a glm object. This might lead to strange bugs at some point. II) you can test !is.null once and use

Re: [R] convert a list to a data frame

2012-04-04 Thread Bert Gunter
Please first search yourself before posting. Google on "R convert list to data frame". -- Bert On Wed, Apr 4, 2012 at 8:11 AM, Sam Steingold wrote: > I have a huge list (returned by fromJSON) with elements like this: > > $`zz/3260` > $`zz/3260`$name > [1] "myname" > > $`zz/3260`$status > [1] "a

[R] plot with a regression line(s)

2012-04-04 Thread Sam Steingold
I am sure a common need is to plot a scatterplot with some fitted line(s) and maybe save to a file. I have this: plot.glm <- function (x, y, file = NULL, xlab = deparse(substitute(x)), ylab = deparse(substitute(y)), main = NULL) { m <- glm(y ~ x) if (!is.null(file)) p

[R] convert a list to a data frame

2012-04-04 Thread Sam Steingold
I have a huge list (returned by fromJSON) with elements like this: $`zz/3260` $`zz/3260`$name [1] "myname" $`zz/3260`$status [1] "active" $`zz/3260`$vectors $`zz/3260`$vectors$`vector/241` $`zz/3260`$vectors$`vector/241`$channel [1] "channel/300" $`zz/3260`$vectors$`vector/241`$targets $`zz/326

Re: [R] spaghetti plots in R

2012-04-04 Thread Liviu Andronic
On Wed, Apr 4, 2012 at 4:22 PM, uday wrote: > I would like to plat some spaghetti plots from my data , ma data is as > See: require(sos) findFn('spaghetti') Liviu > follows > ak[1:3,] >          [,1]      [,2]      [,3]      [,4]      [,5]      [,6]      [,7] > [,8]      [,9] > [1,] 0.3211745

[R] spaghetti plots in R

2012-04-04 Thread uday
I would like to plat some spaghetti plots from my data , ma data is as follows ak[1:3,] [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [1,] 0.3211745 0.4132568 0.5649930 0.6920562 0.7760113 0.8118568 0.8609301 0.9088819 0.9326736 [2,] 0.3159234 0.407

[R] npRmpi trouble - mpi.comm.spawn causes segfault

2012-04-04 Thread Peter Man
Dear all, I have a large dataset of randomly generated weighed sample for which I wish to compute a kernel density estimate. I have used the "np" package successfully for smaller datasets, however for the larger ones, they take too long when using the cross validation options for bandwidth sele

Re: [R] identify time span in date vector

2012-04-04 Thread David Winsemius
On Apr 4, 2012, at 8:19 AM, Petr PIKAL wrote: Hi Dear Petr, thanks for taking your time. For this input, the first element should be selected since there are more than 3 more dates within one year (basically, all other dates are within one year) and at least one of them is more than

Re: [R] read.socket utils package : something is going wrong

2012-04-04 Thread msalese
Found solution. I've changed the library and functions to open and read sockets. Using base package I wrote: msg3<-"function=subscribe|item=MI.EQCON.1|schema=last_price;ask;bid" msg4<-"function=unsubscribe" #open socket connection socketPointer<-socketConnection('localhost', port=5333, server=FAL

[R] STAR Spatio Temporal AutoRegressive models

2012-04-04 Thread vasilis
Hi there, do you know if there is a package that fits spatio temporal autoregressive models in R? thanks vasilis -- View this message in context: http://r.789695.n4.nabble.com/STAR-Spatio-Temporal-AutoRegressive-models-tp4531793p4531793.html Sent from the R help mailing list archive at Nabble.com

Re: [R] Trying to merge new data set to bottom of old data set. Both are zoo objects.

2012-04-04 Thread Gabor Grothendieck
On Wed, Apr 4, 2012 at 1:47 AM, knavero wrote: > Here's a case where it doesn't work. Again, the problem is that when I use > the rbind or concatenate functions, the 2012 data set seems to go ahead of > the 2010 and 2011 portions of the data set. The problem seems dependent on > the text files I r

Re: [R] filling small gaps of N/A

2012-04-04 Thread R. Michael Weylandt
No problem -- best of luck with it: the zoo package is one of the best documentation-wise and I'd advise you to look at the available vignettes when you have time. Vignettes are extended documentation included in some packages that give a more systematic presentation than can be given in the help

[R] Calculating NOEL using R and logistic regression - Toxicology

2012-04-04 Thread Jarno Tuimala
Make that bmd(fit, 0.01) in my previous post. Jarno __ 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-con

[R] cluster analysis with pairwise data

2012-04-04 Thread paladini
Hello, I want to do a cluster analysis with my data. The problem is, that the variables dont't consist of single value but the entries are pairs of values. That lokks like this: Variable 1:Variable2: Variable3: ... (1,2) (1,5) (4,2) (7,8) (3,88)

[R] Calculating NOEL using R and logistic regression - Toxicology

2012-04-04 Thread Jarno Tuimala
Dear Danielle, At least in industrial toxicology (my original background) the recent tendency has been to use benchmark dose (BSD) approach instead of NOEL or NOAEL approach due to various problems with the definition and estimation of NO(A)EL. In R this can be achieved using the packages drc and

Re: [R] logistic regression

2012-04-04 Thread David Winsemius
On Apr 3, 2012, at 9:25 PM, Melrose2012 wrote: I am trying to plot the logistic regression of a dataset (# of living flies vs days the flies are alive) and then fit a best-fit line to this data. Here is my code: plot(fflies$living~fflies$day,xlab="Number of Days",ylab="Number of Fruit F

Re: [R] identify time span in date vector

2012-04-04 Thread Petr PIKAL
Hi > > Dear Petr, > > thanks for taking your time. > > For this input, the first element should be selected since there are more > than 3 more dates within one year (basically, all other dates are within > one year) and at least one of them is more than 3 month later. > > In the meantime,

Re: [R] Package seems to be present but library don't find it

2012-04-04 Thread Duncan Murdoch
On 12-04-03 12:25 PM, Marc Girondot wrote: Indeed I get this error message when I install the library using R CMD INSTALL but not within the GUI (in MacOsX). Good to know that R CMD INSTALL is more verbose and permits to track bug. I followed up in R-sig-mac, and it turns out the reason you did

  1   2   >