I know that if you have to resort to 'parse(text=...)', you should look for
another way (it is a 'fortune'), but it is getting late, and at least it
works:
> eval(parse(text="subset(df, A==1 & B==1)"))
A B
1 1 1
On Sat, Mar 20, 2010 at 9:09 PM, Mark Heckmann wrote:
> df <- data.frame(A=c(1,2
Hi All,
I was trying to find a function that handles Partially Linear
Single-Index model in survival analysis, but was not lucky.
Is thee a function in R for this type of analysis?
Thanks
A
__
R-help@r-project.org mailing list
https://stat.ethz.ch/m
df <- data.frame(A=c(1,2), B=c(1,1))
I have a string containing a condition for a subset function, like:
conditionAsString <- paste(names(df), df[1,], sep="==", collapse=" & ")
> conditionAsString
> "A==1 & B==1"
Now I want to use this string in the subset call, like
subset(df, conditionAsStri
> Hi all,
>
> Does any one know of any encryption/decryption algorithms in R? I'm
> not looking for anything robust - I want some way of printing output
> to the screen that the user can't read immediately, but can decrypt a
> little later. The main thing I don't want to the user to see is a
> num
Dear R and lme4 users-
I am trying to fit a mixed-effects model, with the glmer function in
lme4, to right-skewed, zero-inflated, non-normal data representing
understory grass and forb biomass (continuous) as a function of tree
density (indicated by leaf-area). Thus, I have tried to specify a
Gam
Hello,
Using this data:
http://n4.nabble.com/file/n1676330/US_Final_Values.txt US_Final_Values.txt
and the following code i got the image at the end of this message:
US.final.values<-read.table("c:/tmp/US_Final_Values.txt",header=T,sep=" ")
US.nls.1<-nls(US.final.values$ECe~a*US.final.values$
You may want to check out the odfWeave package for another way to produce
multiple plots in a format that can be easily saved as a word doc.
--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.s...@imail.org
801.408.8111
> -Original Message-
> From: r-h
On Mar 20, 2010, at 5:08 PM, James Rome wrote:
I have a date/time imported from Excel in my dataframe oooi (with
several hundred thousand rows), for example the input data near row
3100 is
ActualOnLocal
11/12/2008 21:35
11/12/2008 22:03
11/12/2008 22:12
11/12/2008 22:38
11/12/2008 23:16
11/1
I have a date/time imported from Excel in my dataframe oooi (with
several hundred thousand rows), for example the input data near row 3100 is
ActualOnLocal
11/12/2008 21:35
11/12/2008 22:03
11/12/2008 22:12
11/12/2008 22:38
11/12/2008 23:16
11/12/2008 23:23
11/13/2008 7:00
11/13/2008 7:03
11/13/200
Hi,
I would like to do the following operations:
variable.df is a character string that contains the name of the data
frame that I want to do the following operations on:
variable.df <- data.frame();
# I can do the above command using
assign( variable.df, data.frame() )
How can I perform the as
You can use abline, but heatmap rescales the x and y coordinates to
min of 0, max of 1. You can use the max x and y values to find the
desired location for the line.
Sarah
On Sat, Mar 20, 2010 at 4:02 PM, Tim Smith wrote:
> Hi,
>
> Is there a way I can draw an abline on a heatmap? I try the abli
Hi Anthony,
Have a look at ?rowSums (if you just want to calculate the score) or
?score.items in the psych package (if you want to calculate alpha's,
item-by-scale correlations etc.).
-Ista
On Sat, Mar 20, 2010 at 4:02 PM, Anthony Lopez wrote:
> hello,
>
> I am new to R (convert from Stata) and
Hi Anthony,
Perhaps
?rowSums
?apply
?aggregate
?ave
Here is an example:
set.seed(123)
X <- matrix(rnorm(40), ncol = 4)
colnames(X) <- c('x1','x2','x3','x4')
X
x <- rowSums(X)
x
cbind(X, x)
HTH,
Jorge
On Sat, Mar 20, 2010 at 4:02 PM, Anthony Lopez <> wrote:
> hello,
>
> I am new to R (con
Hi,
Is there a way I can draw an abline on a heatmap? I try the abline function,
but don't get the line. My sample code is:
mat <- matrix(sample(1:100,40),nrow=5)
heatmap(mat,col=greenred(75),trace="none",
dendrogram = "column",labCol = NULL)
abline(h=5,v=4)
thanks!
[[alternati
hello,
I am new to R (convert from Stata) and I am wondering if there is an R
command/function for generating a summated scale from, for example, four
separate variables in a data set. In other words, I want to transform the
variables x1, x2, x3, and x4 (which have high inter-item reliability) in
I guess, you are looking for:
?file.remove
Am 20.03.2010 20:36, schrieb Megh:
Is there any R function to delete a CSV file saved in disk? For example here
I have created following R function :
asd<- function(a = 5) {
dat<- read.delim(file="F:/Test.csv", header=T, sep=",")
res<- dat[1,
Is there any R function to delete a CSV file saved in disk? For example here
I have created following R function :
asd <- function(a = 5) {
dat <- read.delim(file="F:/Test.csv", header=T, sep=",")
res <- dat[1,1]*a
# Here I want to delete "Test.csv"
return(res)
}
Here I am l
On Mar 20, 2010, at 1:17 PM, Gaathier Mahed wrote:
Dear Sir/madam
I am a new user to R. I have no background in coding or even
scripting. It seems as if R would be the best tool in order to analyse
large sets of data. I need to sum hourly readings for the day and then
sum daily into monthly re
On Mar 20, 2010, at 2:53 PM, David Winsemius wrote:
Sorry for the noise. I did not read to the end and then pasted the
wrong code in as well.
I intended to post a suggestion to use:
text(1,1, expression(mu))
I'm guessing it is happening because different fonts or families are
being used
here is my program... Im trying to fit 1 component to 6 components in each of
the 300 generated samples. Each sample has size=200. For each of the 300
generated samples and for each modeled component (v=1,2,3,4,5,6), I will get
estimates of the parameters that will maximize the likelihood, AND the
Dear Sir/madam
I would like to subscribe to the mailing list for the R software
Regards
__
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 p
Dear Sir/madam
I am a new user to R. I have no background in coding or even
scripting. It seems as if R would be the best tool in order to analyse
large sets of data. I need to sum hourly readings for the day and then
sum daily into monthly readings. i also need to do the same for
another set of d
Sorry for the noise. I did not read to the end and then pasted the
wrong code in as well.
I intended to post a suggestion to use:
text(1,1, expression(mu))
I'm guessing it is happening because different fonts or families are
being used for quartz and pdf devices. But I am not skilled at
m
?plotmath
Try instead:
pdf("mu.pdf")
plot(1,1, type="n")
text(1,1, "\u3BC")
dev.off()
On Mar 20, 2010, at 2:16 PM, Dennis Fisher wrote:
pdf("mu.pdf")
plot(1,1, type="n")
text(1,1, "\u3BC")
dev.off()
David Winsemius, MD
West Hartford, CT
__
R-he
Colleagues,
OS: OS X
R: 2.10.1
I want a mu (µ) to appear in text that is created using a PDF device. However,
the µ does not appear as intended; instead, it is replaced by two dots. A
minimal example is:
> pdf("mu.pdf")
> plot(1,1, type="n")
> text(1,1, "\u3BC")
> dev.off()
The "te
You're right. It's necessary for xyplot though to prevent grouping.
On Mar 20, 2010 10:43 AM, "Dieter Menne"
wrote:
Sundar Dorai-Raj-2 wrote:
>
> Or perhaps more clearly,
>
> histogram(~a1 + b1 + c1, data = aa, o...
Why outer=TRUE? Looks same for me without:
Dieter
library(lattice)
aa <- dat
On Sat, Mar 20, 2010 at 1:39 PM, James Rome wrote:
> And to use sqldf, it looks as if I have to read the source data files
> directly into sqldf to use it.
No. The whole idea of sqldf is that it operates directly on data frames.
__
R-help@r-project.or
Sundar Dorai-Raj-2 wrote:
>
> Or perhaps more clearly,
>
> histogram(~a1 + b1 + c1, data = aa, outer = TRUE)
>
>
Why outer=TRUE? Looks same for me without:
Dieter
library(lattice)
aa <- data.frame(a1=rnorm(20),b1=rnorm(20,0.8),c1=rnorm(20,0.5))
histogram(~a1 + b1 + c1, data = aa)
--
View
On 3/20/2010 11:52 AM, Daniel Malter wrote:
If the flight identifiers runway$Flight and oooi$Flight are unique (i.e.
only one observation has the same identifier in each dataset), you could use
merge() to bind together the dataset based on matching the two. See,
?merge
Also, I see an OnDate vari
tj wrote:
>
> Thanks David. I already tried two different programs for this. The first
> one has errors.
> I'm working right now on my alternative program ( i hope it will work),
> BUT I still prefer to use the first program I made because it is more
> detailed. So, I'm trying how to correct the
Thanks everyone for your help! All your suggestions work. I appreciate it.
Have a great day!
--
View this message in context:
http://n4.nabble.com/How-to-count-the-number-of-occurence-tp1661733p1675997.html
Sent from the R help mailing list archive at Nabble.com.
__
Thanks David. I already tried two different programs for this. The first one
has errors.
I'm working right now on my alternative program ( i hope it will work), BUT
I still prefer to use the first program I made because it is more detailed.
So, I'm trying how to correct the errors in the first R p
Dear Steve Chen,
you have sent it to the correct address, but the CRAN maintainer who is
in duty for the mirrors may not have had the time to look at it yet.
Please wait for another few days and you will certainly get a response
hear.
Thanks in advance for providing space and bandwidth for
use table and count all occurances at one time
> X
[1] 1 1 1 1 1 1 3 1 2 1 1 1 1 1 1 1 1 3 2 1 1 4 1 1 1 1 1 5 1 1
> table(X)
X
1 2 3 4 5
24 2 2 1 1
>
On Sat, Mar 20, 2010 at 3:43 AM, tj wrote:
>
> Hi, may I ask for your help...
> What is the R code if I want to count the number of t
Using the sqldf package you could do an SQL join with the indicated
condition in your where clause. See the examples section of this
page: http://sqldf.googlecode.com
On Sat, Mar 20, 2010 at 10:20 AM, James Rome wrote:
> I have two data frames of flight data, but they have very different
> numb
sqldf package:
> n <- 200
> x <- data.frame(id=sample(1:10,n, TRUE), timex=runif(n))
> y <- data.frame(id=sample(1:15, n, TRUE), timey=runif(n), runway=seq(n))
> require(sqldf)
> sqldf("select x.id, timex, y.id, timey, y.runway from x join y
+ where x.id = y.id and abs(timex - timey) < 0.005")
rm(setdiff(ls(), c("AA", "BB")) should work.
On Mar 20, 2010, at 12:27 PM, bogaso.christofer wrote:
Dear all, in my working project, I have created huge number of
different
kind of objects including "AA" and "BB". Now I want to delete all
objects
except that "AA" and "BB". Is there any proc
Dear all, in my working project, I have created huge number of different
kind of objects including "AA" and "BB". Now I want to delete all objects
except that "AA" and "BB". Is there any procedure in R to do that ?
Thanks,
[[alternative HTML version deleted]]
If the flight identifiers runway$Flight and oooi$Flight are unique (i.e.
only one observation has the same identifier in each dataset), you could use
merge() to bind together the dataset based on matching the two. See,
?merge
Also, I see an OnDate variable in both dataset. So if Flight does not
p
On Mar 20, 2010, at 3:53 AM, tj wrote:
Please help me in writing the R code for this problem. I've been
solving this
for 4 days. It was hard for me to solve it. It's a simulation
problem in R.
The problem is
My true model is a normal mixture which is given as
0.5 N(-0.8,1) + 0.5 N(0.8,
On Mar 20, 2010, at 3:43 AM, tj wrote:
Hi, may I ask for your help...
What is the R code if I want to count the number of times that "2"
appeared
in the following R output
k
[1] 1 1 1 1 1 1 3 1 2 1 1 1 1 1 1 1 1 3 2 1 1 4 1 1 1 1 1 5 1 1
sum(k==2)
David Winsemius, MD
West Hartfor
Hi all,
I couldn't find other appropriate place to ask this question,
so I am posting the message to R-help mailling list.
Our department had set up a new CRAN mirror site and is working fine so
far. According CRAN mirror Howto, I sent an email to c...@r-project.org
about 5 days ago to sumit our
Terrific! How could I've missed that. Well, I know, I didn't get it from the
documentation...
Thanks
Regards/Cordialement
Benoit Boulinguiez
-Message d'origine-
De : Duncan Murdoch [mailto:murd...@stats.uwo.ca]
Envoyé : samedi 20 mars 2010 14:54
À : Benoit Boulinguiez
Cc : r-help@r
Please help me in writing the R code for this problem. I've been solving this
for 4 days. It was hard for me to solve it. It's a simulation problem in R.
The problem is
My true model is a normal mixture which is given as
0.5 N(-0.8,1) + 0.5 N(0.8,1). This model has two components.
I will get a
Hi, may I ask for your help...
What is the R code if I want to count the number of times that "2" appeared
in the following R output
> k
[1] 1 1 1 1 1 1 3 1 2 1 1 1 1 1 1 1 1 3 2 1 1 4 1 1 1 1 1 5 1 1
Thank you for your help. :-)
--
View this message in context:
http://n4.nabble.com/How-to
I have two data frames of flight data, but they have very different
numbers of rows. They come from different sources, so the data are not
identical.
> names(oooi)
[1] "FltOrigDt" "MkdCrrCd"
[3] "MkdFltNbr" "DprtTrpnStnCd"
[5] "ArrTrpnStnCd"
On 20/03/2010 7:35 AM, Duncan Murdoch wrote:
On 20/03/2010 6:38 AM, Benoit Boulinguiez wrote:
Hi all,
for publication purpose I must provide a graph with grid lines aligned with
each tick mark.
Thing is that the graph has a log scale on the x-axis.
I looked at the grid() and par() documentati
On 3/17/10 6:52 PM, Marshall Feldman wrote:
> Hi,
>
> I can't get the colClasses option to work in the readHTMLTable function
> of the XML package. Here's a code fragment:
>
> require("XML")
> doc <- "http://www.nber.org/cycles/cyclesmain.html";
> table <- getNodeSet(htmlParse(doc
Actually both the solutions I listed assume that every row in small is
in big. Although that was the case in the example you displayed, If
that is not the case in general then use intersect:
ix <- intersect(rownames(big), rownames(small))
result <- big
result[ix, ix] <- big[ix, ix] + small[ix, ix
The original post said the matrices are symmetric but it seems from
the examples that they are not symmetric but do each have the same row
and column names so we have assumed only this latter condition
instead.
If your matrices are called big and small then:
ix <- rownames(big) %in% rownames(smal
>
>
> Dear Ruser,
>>
>>
>> I am trying to use the map library. But unfortunately I am facing the
>> warning message above:
>> Warning message:
>> *In readGDAL(destfile, silent = TRUE) : GeoTransform values not available
>> *
>
> I want to use that library because I intend to plot some station in
On 20/03/2010 6:38 AM, Benoit Boulinguiez wrote:
Hi all,
for publication purpose I must provide a graph with grid lines aligned with
each tick mark.
Thing is that the graph has a log scale on the x-axis.
I looked at the grid() and par() documentation but still don't figure out
how to get it do
Hi all,
for publication purpose I must provide a graph with grid lines aligned with
each tick mark.
Thing is that the graph has a log scale on the x-axis.
I looked at the grid() and par() documentation but still don't figure out
how to get it done.
simple example
plot(seq(1,9), log="x", pan
You can some time manually substitute a categorical variable with a set
of continuous variables.
For example, you have the variables like "landcover.class" with 3 values
"class A, class B, class C". You cna transform it into 3 continuous
variables landcover.class.A, landcover.class.B, landcove
Thank you very much for the big help!
From: GlenB [via R]
Sent: Sat, March 20, 2010 1:23:50 AM
Subject: Re: OUTPUT the row
> a<-read.table(stdin(),header=TRUE)
0: id kAgeHeight
1: 23 2 23 60
2: 12 3 28 58
3:
Hi... Please help me with this.
In R, if I have this dataframe:
id kAgeHeight
23 2 23 60
12 3 28 58
19 4 18 55
37 5 22 54
My question is, I want to get the value of k that has the minimum age.
So in this dataframe, the minimu
To clarify, the two matrices might look like this:
A B C D E F
A 1 2 3 4 5 6
B 2 4 6 8 10 12
C 0 0 0 0 0 0
D 0 1 0 1 0 1
E 3 6 9 11 13 15
F 2 2 2 2 2 2
B D E
B 4 9 13
D 9 8 7
E 1 0 1
I would like this:
A B C D E
Please help me in writing the R code for this problem. I've been solving this
for 4 days. It was hard for me to solve it. It's a simulation problem in R.
The problem is
My true model is a normal mixture which is given as
0.5 N(-0.8,1) + 0.5 N(0.8,1). This model has two components.
I will get
Hi everyone,
I'm trying to make a prediction on the following model for the values V1 =
18, V4 = 35, V6 = 7.
modelo4 = lm(Y ~ V1 + V4 + V6, data = datos)
and I want to plot the confidence bands for that prediction, I've found many
examples for simple regression, but I haven't been able to find a
59 matches
Mail list logo