On Wed, Sep 23, 2009 at 07:29:30AM -0500, Peng Yu wrote:
> On Wed, Sep 23, 2009 at 1:24 AM, Peter Dalgaard
> wrote:
> > Peng Yu wrote:
>
> Is there an operation on a factor to get a subset and keep only the
> corresponding levels (see commented line below)?
Yes, there is: call factor() on your s
On Sep 23, 2009, at 4:54 AM, MKHABELA,SN wrote:
Hi everyone
I want help in graduating the attached rates and checking for
goodness of fit and smoothness using R please help.
females.txt>__
You have provided the rates but not the death counts or
Try using XML package:
Lines <- "2005-012006-012007-012008-012009-01"
library(XML)
xpathApply(htmlParse(Lines), "//a", xmlAttrs)
On Wed, Sep 23, 2009 at 9:29 AM, Rene wrote:
> Dear All,
>
>
>
> Can someone please guide me how to get the certain part from a long html
> language?
>
>
>
> e.g.
>
>
Dear R-users,
I am a new user for R. I am eager to lean about it.
I wanted to read and summary of the a simple data file
I used the following,
rel <- read.table("C:/Documents and Settings/ashta/My
Documents/R_data/rel.dat", quote="",header=FALSE,sep="",col.names=
c("id","orel","nrel
Hi,
It's trivial with ggplot2,
library(ggplot2)
qplot(tp,dp, geom="line") + scale_y_reverse()
HTH,
baptiste
2009/9/23 David Winsemius :
>
> On Sep 23, 2009, at 7:58 AM, FMH wrote:
>
>> Dear All,
>>
>> Let:
>> dp: depth of the river
>> tp: temperature with respect to depth
>>
>> We can have a s
Hi,
The R4X package can help you. (I have wrapped your td's into one tr)
> x <- xml( "2005-012006-012007-012008-012009-01" )
> x["td/a/#"]
tdtdtdtdtd
"2005-01" "2006-01" "2007-01" "2008-01" "2009-01"
> x["td/a/@href"]
td td
On 09/23/2009 09:58 PM, FMH wrote:
Dear All,
Let:
dp: depth of the river
tp: temperature with respect to depth
We can have a simple scatter plot, between depth as y-axis and temperature as
x-axis, by using a plot function as shown below.
#
dp<- c(1,4,3,2,5,7,9,8,9,2)
tp<
Sebastian,
There is rarely a completely free lunch, but fortunately for us R has
some wonderful tools
to make this possible. R supports regular expressions with commands
like grep(),
gsub(), strsplit(), and others documented on the help pages. It's
just a matter of
constructing and algorithm tha
Dear All,
Can someone please guide me how to get the certain part from a long html
language?
e.g.
"2005-012006-012007-012008-012009-01"
How to get only the wording of "2005-01.html", "2006-01.html",
"2007-01.html"," 2008-01.html"," 2009-01.html" from the above html code? I
have tr
On Wed, Sep 23, 2009 at 1:24 AM, Peter Dalgaard
wrote:
> Peng Yu wrote:
>>
>> Hi,
>>
>> Please see the command with a comment below. I don't find
>> 'A630039F22Rik' in y. But 'A630039F22Rik' is in z. Can somebody let me
>> know what the problem is?
>
> Most obvious guess is that your factor y has
yet another way,
> x <- read.table(textConnection("Category Value
+ b1
+ b2
+ a7
+ a1"), header=TRUE)
> y = transform(x, Category = relevel(Category, c("b")))
> str(y)
'data.frame': 4 obs. of 2 variables:
$ Category: Facto
Here is a way to do it. I assume that you data has each record on a
line; it came through the email as multiple lines.
> x <- readLines("/tempxx.txt")
> # remove '#Fields:" so it can be used as a header
> x <- sub("^#Fields: ", "", x)
> # remove comment lines
> x <- x[-grep("^#", x)]
> # remove
On Sep 23, 2009, at 7:58 AM, FMH wrote:
Dear All,
Let:
dp: depth of the river
tp: temperature with respect to depth
We can have a simple scatter plot, between depth as y-axis and
temperature as x-axis, by using a plot function as shown below.
#
dp <- c(1,4,3,2,5,7,9,8,
Ya it works thanks for the help
--
View this message in context:
http://www.nabble.com/use-of-class-variable-in-r-as-in-Proc-means-of-sas-tp25530654p25531102.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing
Here is a way of doing it
> x <- read.table(textConnection("Category Value
+ b1
+ b2
+ a7
+ a1"), header=TRUE, as.is=TRUE)
> # now keep level in original order
> x$Category <- factor(x$Category, levels=unique(x$Category))
> str(x)
Try this:
DF$Category <- factor(DF$Category, levels = c("b", "a"))
On Wed, Sep 23, 2009 at 4:16 AM, Chris Li wrote:
>
> Hello,
>
> Say I have a dataset as followed:
>
> Category Value
> b 1
> b 2
> a 7
> a 1
>
> Then, if I:
>
> leve
try this:
plot(tp,dp, type= 'l',ylim=rev(range(dp)))
On Wed, Sep 23, 2009 at 7:58 AM, FMH wrote:
> Dear All,
>
> Let:
> dp: depth of the river
> tp: temperature with respect to depth
>
> We can have a simple scatter plot, between depth as y-axis and temperature as
> x-axis, by using a plot fu
Dear All,
Let:
dp: depth of the river
tp: temperature with respect to depth
We can have a simple scatter plot, between depth as y-axis and temperature as
x-axis, by using a plot function as shown below.
#
dp <- c(1,4,3,2,5,7,9,8,9,2)
tp <- 1:10
plot(tp,dp, type= 'l')
#
See if this works:
qfun2 <- function(x, digits=3,sci=F,...){
c(q=quantile(x, probs=c(1,5,10,95,99)/100,type=6,...)
)
}
cheers,
-Girish
===
premmad wrote:
>
> I tried thanks for your help and got the same result for percentile 5 & 95
> as in SAS.But if i need to calcu
Can't you just use get()? What am I missing?
f <- function(fo, data, groups) {
g <- xyplot(as.formula(fo), groups = get(groups), data)
print(g)
}
f("yield ~ variety | site", data = barley, groups = "year")
Peter Ehlers
Erich Neuwirth wrote:
Thanks, that completely solves the
Hi,
nvars <- 902
data <- as.data.frame(matrix(runif(100*nvars),ncol=nvars))
colnames(data)[901] <- c('phenotype')
colnames(data)[902] <- c('outcome')
### catch all aic values ###
res <- matrix(nrow=900,ncol=2)
for (i in 1:(length(data)-2)) {
res[i,1] <- names(data)[i]
res[i,2] <- glm(outco
Hello Chris,
I had the same problem, and I ended up driving R Gui through an Autoit
script, see http://www.autoitscript.com/autoit3/ Regards,
Gabriele Franzini
-Original Message-
From: cr...@binghamton.edu [mailto:cr...@binghamton.edu]
Sent: 22 September 2009 19:37
To: r-help@r-project.o
You might need to change the type quantile. The default is type = 7,
whereas default for SAS is type = 3 and for SPSS type = 6. Have a look
at the helpfile of quantile() for more details on the type.
HTH,
Thierry
ir.
Hi everyone
I want help in graduating the attached rates and checking for goodness
of fit and smoothness using R please help.
Many thnk
TOo every one around the world
This message and attachments are subject to a disclaimer. Please refer
to www.it.up.ac.za/documentation/governance/disclaimer
I tried thanks for your help and got the same result for percentile 5 & 95 as
in SAS.But if i need to calculate quantiles (1,5,10,99,etc.) it will not be
possible with fivenum as explained in the help page .If i need those
quantiles what is the change i need to make in the function
qfu<-function(
thank a lot it works
Hans W. Borchers wrote:
>
> But of course, it is always possible to emulate a semi-continuous variable
> by introducing a binary variable and use some "big-M" trick. That is, with
> a new binary variable b we add the following two conditions:
>
> x3 - 3.6 * b >= 0 and
Thanks for the help.I got the required quantiles by altering ur code
as follows
qfu<-function(x,digits=3,sci=F,...)
{c(q=quantile(x,probs=c(5,90)/100))
}
and my result of the R system is different from my sas system output for the
same function .could anyone help me in this and what is the rea
Hello,
Say I have a dataset as followed:
Category Value
b1
b2
a7
a1
Then, if I:
levels(Category)
It will return:
[a], [b]
But I want to keep the original order, i.e.:
[b], [a]
Is it possible to do it in R?
Thanks in advanc
one implementation is in the optmatch package as far as I remember
stefano
On 23/set/09, at 03:37, shuva gupta wrote:
Hi,
Is there any R implementation of the well-known algorithm from the
Operations Research
literature, the Ford-Fulkerson algorithm of maximum flow in networks
with capaciti
Hi,
The short answer would be ?paste (as in paste(year, ".csv", sep="") ),
but I'd suggest you try this instead,
lf <- list.files(pattern = ".csv")
lf
# [1] "2003.csv" "2004.csv" "2005.csv"
ln <- gsub(".csv", "", lf)
ln
# [1] "2003" "2004" "2005"
length(ln)
lapply(lf, read.csv)
?list.files
Hi R community, I have a question. I have 5 files in a directory. Each file has
a year as a name (file 1 ->2004, file 2-> 2005, ...). I want to build a for
loop where I call first file, do some calculations, go to second file, do some
calculations, etc. Somethin like this:
year<-2003
nfiles <-
Replace your qfu as follows:
qfu <- function(x, digits=3,sci=F,...){
c(q=fivenum(x, ...)
)
}
Look up fivenum function for more information.
cheers,
-Girish
=
premmad wrote:
>
> Thanks for the help.I got the required quantiles by altering ur code
> as follows
>
> q
Reproducible code.???
premmad wrote:
>
> I have to remove missing data both in character and numeric datatype.I
> tried using NA condition but it is not working ,please help me to solve
> this.
>
-
Blay S
KATH
Kumasi, Ghana.
--
View this message in context:
http://www.nabble.com/Han
Hi,
with a different (faster) algorithm, but maximum flows are implemented
in package igraph, although for some networks only calculating the
flow value is supported, giving the flow itself is not.
Best,
Gabor
On Wed, Sep 23, 2009 at 3:37 AM, shuva gupta wrote:
> Hi,
> Is there any R implementa
Hi
I am not sure if I understand what you want but if your matrix is not so
big you can try
> x[,1]*x[,2]
[1] 5 12 21 32
> cumsum(x[,1]*x[,2])
[1] 5 17 38 70
>
and than check value of cumsum according to your condition.
Regards
Petr
r-help-boun...@r-project.org napsal dne 23.09.2009 05:25
101 - 135 of 135 matches
Mail list logo