[R] get only little part of html with htmlParse

2012-09-03 Thread ????????
Here is my code. there are three method to get text to be parded by htmlParse function. 1.file on mycomputer options(encoding="gbk") library(XML) xmltext1 <- htmlParse("/home/tiger/Desktop/27174.htm" ) #/home/tiger/Desktop/27174.htm is the file of http://www.jb51.net/article/27174.htm dow

[R] Create a function to number each repeated visit or measurements

2012-09-03 Thread Jon Toledo
Hi dear R list members, I am trying to create a numerical variable that tracks the visits/entries that a subject has had. For example having a database of repeated serial measurements that are ordered by subject and time. So I would get a variable that says 0 for baseline visit/measurement, 1 f

[R] Producing a SMA signal when closing price is above the moving average for 3 days

2012-09-03 Thread Douglas Karabasz
I have loaded price data for GE and then calculated a 50 day simple moving average. Then I have a created a ifelse statement that produce a 1 when GE's closing price is above the simple moving average and a 0 when GE Closing price is below the 50 day simple moving average. However, what I reall

Re: [R] adding points to a point pattern

2012-09-03 Thread Rolf Turner
On 04/09/12 11:58, Frederico Mestre wrote: Hello all: Is there any way to add points to a point pattern, while keeping a given minimum distance amongst this new points and the pre-existing points? Presumably this is a question about the "spatstat" package. If so, the answer is "yes". A

Re: [R] RES: adding points to a point pattern

2012-09-03 Thread Rolf Turner
I had no trouble in figuring out what he wanted. cheers, Rolf Turner On 04/09/12 14:26, Jeff Newmiller wrote: Then why don't you follow the posting guide and provide an R sample data set and R sample result?

Re: [R] Common elements in columns

2012-09-03 Thread Silvano Cesar da Costa
Hi Jim. It was a very elegant way of solving the problem. Thank you, > Another way of solving the problem: > >> set.seed(1) >> df1<-data.frame(C1=sample(LETTERS[1:25],20,replace=FALSE),value=sample(50,20,replace=FALSE)) >> set.seed(15) >> df2<-data.frame(C1=sample(LETTERS[1:25],15,replace=FALS

[R] Adding summary title to table

2012-09-03 Thread David Arnold
All, I have: x <- matrix(c(22,3,6,69,9,4,7,81,23,4,22,50),nrow=3,byrow=TRUE) rownames(x) <- c("Cold or flu","Headache","Backache"); colnames(x) <- c("Went to doctor","No response","Did nothing","Self-medicated") x <- t(x) print(x) 1. I'd like to add the title "Nutritional Status" above the colum

Re: [R] RES: adding points to a point pattern

2012-09-03 Thread Jeff Newmiller
Then why don't you follow the posting guide and provide an R sample data set and R sample result? --- Jeff NewmillerThe . . Go Live... DCN:Basics: ##.#. ##.#. Live Go..

[R] Skew Normal CDF using psn (package sn)

2012-09-03 Thread Boris Beranger
Dear R-users, I have been using the code below in order to verify how the CDF of a skew-normal distribution was calculated: library(sn) s=seq(-30,30,by=0.1) a<-matrix(nrow=length(s),ncol=5) lambda=1 for(i in 1:length(s)){ a[i,1]=pnorm(s[i],mean=0,sd=1); a[i,2]=T.Owen(s[i],lambda); a

Re: [R] [newbie] scripting remote check for R package

2012-09-03 Thread Tom Roche
https://stat.ethz.ch/pipermail/r-help/2012-September/322985.html >>> for RSERVER in 'foo' 'bar' 'baz' ; do >>> ssh ${RSERVER} '' >>> done >>> or is there a better way to script checking for an R package? https://stat.ethz.ch/pipermail/r-help/2012-September/323000.html >> I would call something

[R] RES: adding points to a point pattern

2012-09-03 Thread Frederico Mestre
Hello, Yes, I'm using spatstat. Sorry, I forgot to mention that. Thanks, Frederico -Mensagem original- De: Rolf Turner [mailto:rolf.tur...@xtra.co.nz] Enviada em: terça-feira, 4 de Setembro de 2012 02:04 Para: Frederico Mestre Cc: r-help@r-project.org; adrian.badde...@csiro.au Assu

[R] RES: adding points to a point pattern

2012-09-03 Thread Frederico Mestre
Hello, I'm trying to make a function in R in which I need to do this. Frederico -Mensagem original- De: Jeff Newmiller [mailto:jdnew...@dcn.davis.ca.us] Enviada em: terça-feira, 4 de Setembro de 2012 01:30 Para: Frederico Mestre; r-help@r-project.org Assunto: Re: [R] adding points to

Re: [R] adding points to a point pattern

2012-09-03 Thread Jeff Newmiller
Perhaps. What does this have to do with R? --- Jeff NewmillerThe . . Go Live... DCN:Basics: ##.#. ##.#. Live Go... Live: OO#.. D

[R] adding points to a point pattern

2012-09-03 Thread Frederico Mestre
Hello all: Is there any way to add points to a point pattern, while keeping a given minimum distance amongst this new points and the pre-existing points? Thanks, Frederico [[alternative HTML version deleted]] __ R-help@r-project

Re: [R] Common elements in columns

2012-09-03 Thread jim holtman
Another way of solving the problem: > set.seed(1) > df1<-data.frame(C1=sample(LETTERS[1:25],20,replace=FALSE),value=sample(50,20,replace=FALSE)) > set.seed(15) > df2<-data.frame(C1=sample(LETTERS[1:25],15,replace=FALSE),C2=1:15) > set.seed(3) > df3<-data.frame(C1=sample(LETTERS[1:10],10,replace=FA

Re: [R] how to find the index of points selected from a scatter plot?

2012-09-03 Thread Bert Gunter
All good points. -- Bert On Mon, Sep 3, 2012 at 12:07 PM, Greg Snow <538...@gmail.com> wrote: > I would be very surprised if the x value from locator matched the x > value in the data to the precision needed by ==, and what if 2 points > have the same x-value but different y-values, you would ne

Re: [R] Time Series filter help?

2012-09-03 Thread Rui Barradas
Hello, Try the following, where 'dat' is your data.frame. dat <- read.table(text=" 2012-05-07 0 2012-05-08 0 2012-05-09 0 [...etc...] 2012-08-27 1 2012-08-28 1 2012-08-29 1 ", stringsAsFactors = FALSE) r <- rle(dat[[2]]) csum <- cumsum(r$lengths > 3) spl <- sapply(split(

Re: [R] boxplot - bclust

2012-09-03 Thread Peter Ehlers
On 2012-09-03 08:34, Dominic Roye wrote: Hello everybody, I have a problem with the commando of boxplot -bclust. http://127.0.0.1:13155/library/e1071/html/boxplot.bclust.html data(iris) bc1 <- bclust(iris[,1:4], 3, base.centers=5) Committee Member: 1(1) 2(1) 3(1) 4(1) 5(1) 6(1) 7(1) 8(1) 9(1

Re: [R] [newbie] scripting remote check for R package

2012-09-03 Thread Tom Roche
https://stat.ethz.ch/pipermail/r-help/2012-September/322985.html >> e.g., how to replace '' in the >> following: >> for RSERVER in 'foo' 'bar' 'baz' ; do >> ssh ${RSERVER} '' >> done >> or is there a better way to script checking for an R package? https://stat.ethz.ch/pipermail/r-help/2012-Se

Re: [R] Horizontal grid in background of barplot

2012-09-03 Thread Peter Ehlers
On 2012-09-03 12:12, David Arnold wrote: All, I have: x <- matrix(c(22,3,6,69,9,4,7,81,23,4,22,50),nrow=3,byrow=TRUE) rownames(x) <- c("Cold or flu","Headache","Backache"); colnames(x) <- c("Went to doctor","No response","Did nothing","Self-medicated") x <- t(x) print(x) barplot(x,beside=TRUE,

Re: [R] combing list objects

2012-09-03 Thread Rui Barradas
Hello, Try ?unlist. unlist(abun) Hope this helps, Rui Barradas Em 03-09-2012 17:06, chris20 escreveu: Hi, I am trying to combine a long list but I can't work out how to do it, for example: abun<-list(rep(0,5),rep(0,7),rep(0,4),rep(0,10)) nb<-c(5,5,1,8) fill.abun <- function(x, y) {

[R] Horizontal grid in background of barplot

2012-09-03 Thread David Arnold
All, I have: x <- matrix(c(22,3,6,69,9,4,7,81,23,4,22,50),nrow=3,byrow=TRUE) rownames(x) <- c("Cold or flu","Headache","Backache"); colnames(x) <- c("Went to doctor","No response","Did nothing","Self-medicated") x <- t(x) print(x) barplot(x,beside=TRUE, ylim=c(0,90), xlab="Ailment

[R] boxplot - bclust

2012-09-03 Thread Dominic Roye
Hello everybody, I have a problem with the commando of boxplot -bclust. http://127.0.0.1:13155/library/e1071/html/boxplot.bclust.html > data(iris) > bc1 <- bclust(iris[,1:4], 3, base.centers=5) Committee Member: 1(1) 2(1) 3(1) 4(1) 5(1) 6(1) 7(1) 8(1) 9(1) 10(1) Computing Hierarchical Clustering

[R] combing list objects

2012-09-03 Thread chris20
Hi, I am trying to combine a long list but I can't work out how to do it, for example: abun<-list(rep(0,5),rep(0,7),rep(0,4),rep(0,10)) nb<-c(5,5,1,8) fill.abun <- function(x, y) { set <- sample(1:length(x), size = y) x[set] <- rlnorm(length(set)) return(x) }

Re: [R] R suitability for development project

2012-09-03 Thread Eric Langley
Jim wrote: > I would use mean ranks for something like this. You would have to calculate > these from your summary array unless you have the raw ranks. I note: Thank you for the detailed answer. I have the raw ranks. For a question they look like this; 1=Item2, 2=Item1, 3=Item3, 4=Item4 Jim wrot

Re: [R] R suitability for development project

2012-09-03 Thread Eric Langley
Rolf wrote: > Is there monetary reward involved? Or are you just counting > on people's good nature? I note: Absolutely, I should have noted that... Rolf wrote: > This reminds me of > > fortune("driveway") > > from the "fortunes" package. I note: You mean this one? "I th

Re: [R] fitting lognormal censored data

2012-09-03 Thread Salma Wafi
Dear Berend Thanks for your response. I will write my code and estimate the parameters using functions optim() or nlminb(). For the code that I am trying to build for estimation the parameters using mle via EM ahgorithm, I will rewrite it and reformulated my question about, but before that I nee

Re: [R] R suitability for development project

2012-09-03 Thread Jim Lemon
Eric Langley wrote: Hello All, Eric Langley here with my first post to this list. I am looking to determine if R is suitable for a development project I am working on and if so possibly finding someone proficient in R that would be interested in doing the coding. I would like to preface my inqu

[R] Scatter plot from tapply output, labels of data

2012-09-03 Thread monaR
Hei, i am trying to plot the means of two variables (d13C and d15N), by 2 grouping factors (Species and Year) that i obtained by the function tapply. I would like to plot with different colours according to the Year and show the "Species" as data labels. My data looks like this: Species d

[R] Time Series filter help?

2012-09-03 Thread Douglas Karabasz
I have a time series data with 1's and 0's. When the last 3 observations are 1 I want to generate a 1 until I have three 0's in a row and then I want it to produce all zeros again. For example if I have 0101010101 for the first part of the time series this would produce all zeros. Then if the d

Re: [R] how to find the index of points selected from a scatter plot?

2012-09-03 Thread Greg Snow
I would be very surprised if the x value from locator matched the x value in the data to the precision needed by ==, and what if 2 points have the same x-value but different y-values, you would need to also check the y's. With appropriate rounding this would work, but would just be reinventing the

[R] Fwd: I need help with package RANDFORESTGUI

2012-09-03 Thread Elvira M.H
I need help with package RANDFORESTGUI I do this: > library(RandForestGUI) > RandForestGUI() Error en RandForestGUI() : no se puede cambiar el valor de un vínculo bloqueado para 'tt' Some one can help me? Is it important this menssage? I cant get what i want! Thanks to all!! [[al

Re: [R] Coxph not converging with continuous variable

2012-09-03 Thread Terry Therneau
On 09/03/2012 05:00 AM, r-help-requ...@r-project.org wrote: The coxph function in R is not working for me when I use a continuous predictor in the model. Specifically, it > fails to converge, even when bumping up the number of max iterations or setting reasonable initial values. > The estimat

Re: [R] select specific rows from regression output

2012-09-03 Thread Alexander Snijders
Unfortunately, predict can't be applied to an object of class "mer"... Regards, Alex 2012/9/3 PIKAL Petr > Hi > > I am not familiar with glmer but maybe you can try to give to prediction > only values with BMI>25. As you did not provide data nor any code something > like (untested) > > predict(

Re: [R] select specific rows from regression output

2012-09-03 Thread PIKAL Petr
Hi I am not familiar with glmer but maybe you can try to give to prediction only values with BMI>25. As you did not provide data nor any code something like (untested) predict(fit, newdata=olddata[olddata$BMI>25,]) Regards Petr > -Original Message- > From: r-help-boun...@r-project.org

Re: [R] Class that wraps Data Frame

2012-09-03 Thread Ramiro Barrantes
Thanks to everyone for all their help. I will investigate more. I am not attached to S4 at all, but it sounds like it might be a good option. I will look into bioconductor for examples. Thanks again, Ramiro From: Martin Morgan [mtmor...@fhcrc.org] Se

[R] select specific rows from regression output

2012-09-03 Thread Alexander Snijders
Hello everyone, I have a data set that contains characteristics of 25,000 patients of 92 different hospitals. I have run a regression to capture the probability these patients will have a complication after a certain operation. Now, I actually want to predict the probability per patient, using the

Re: [R] Common elements in columns

2012-09-03 Thread Silvano Cesar da Costa
Hi Arun, it's exactly what I wanted. Thanks a lot, > Hi, > May be this might help: > > set.seed(1) > df1<-data.frame(C1=sample(LETTERS[1:25],20,replace=FALSE),value=sample(50,20,replace=FALSE)) > set.seed(15) > df2<-data.frame(C1=sample(LETTERS[1:25],15,replace=FALSE),C2=1:15) > set.seed(3) >

[R] Call for contribution: the RDataMining package - an R package for data mining

2012-09-03 Thread Yanchang Zhao
Join the RDataMining project to build a comprehensive R package for data mining http://www.rdatamining.com/package We have started the RDataMining project on R-Forge to build an R package for data mining. The package will provide various functionalities for data mining, with contributions from ma

Re: [R] fitting lognormal censored data

2012-09-03 Thread Berend Hasselman
You should keep your replies on the R-help list by always cc-ing to that list. As you were asked to do in a previous thread you started. As I demonstrated in a previous reply, the R function optim() is perfectly capable of minimizing or maximizing your likelihood function. Your attempts at using

Re: [R] R suitability for development project

2012-09-03 Thread Rolf Turner
On 03/09/12 14:15, Eric Langley wrote: Hello All, Eric Langley here with my first post to this list. I am looking to determine if R is suitable for a development project I am working on and if so possibly finding someone proficient in R that would be interested in doing the coding. Is there