I have a following matrix and wish to define a variable based the variable
A=matrix(0,5,5)
A[1,]=c(30,20,100,120,90)
A[2,]=c(40,30,20,50,100)
A[3,]=c(50,50,40,30,30)
A[4,]=c(30,20,40,50,50)
A[5,]=c(30,50,NA,NA,100)
> A
[,1] [,2] [,3] [,4] [,5]
[1,] 30 20 100 120 90
[2,] 40 30 2
On Aug 11, 2011, at 5:50 AM, Karl Knoblick wrote:
Thanks. Actually I thought of something like
Hanley JA, McNeil BJ. A method of comparing the areas under receiver
operating
characteristic curves derived from the same cases. Radiology. 1983;
148:
839–843.
http://radiology.rsna.org/content/
On Fri, Aug 12, 2011 at 5:08 PM, Katrina Bennett wrote:
> Hi Weidong Gu,
>
> This works! For my clarity, and so I can repeat this process if need be:
>
> The 'mat' generates a matrix using whatever is supplied to x (i.e.
> coop.dat) using the columns from position 9:length(x) of 6 columns (by
> ro
I think you are doing this in the wrong order. You need to set the
gpar on the viewport, then compute the grid.rect.
grid.rect(width=unit(1,'strwidth','Some text'),draw=T, gp=gpar(font=2))
grid.text('Some text',y=0.4,gp=gpar(font=2),draw=T)
is one way to do it: pushing a viewport is another.
Hi,
Try with the following ODE function. This should give you an extra
column with the derivative of G in your THAAC matrix.
degradation = function (t, state, parameters) {
with(as.list(c(state, parameters)),
{dG = (-a*(t+i)^b)*(G)
list(c(dG),dG=dG)
})
}
Any additional variables that y
Hey,
Also, if your function varies in time (less than 5 minutes) then you could
use
total.time.difference=system.time(some.function)[1)]
# (for user time) and you could plug this into your Sys.sleep() (which
accepts decimal seconds) if you can #accept an error on the order of
hundredths of second
Thank you, Achim.
So, then a follow up question to the community: is there a package out
there that allows one to calculate a correct DW for a regression with
weights?
Dimitri
On Fri, Aug 12, 2011 at 2:42 PM, Achim Zeileis wrote:
> On Fri, 12 Aug 2011, Dimitri Liakhovitski wrote:
>
>> Hello!
>>
>
Hi:
Here are several equivalent ways to produce your desired output:
# Base package: transform()
df <- transform(df, mean = ave(x, id, FUN = mean))
# plyr package
library('plyr')
ddply(df, .(id), transform, mean = mean(x))
# data.table package
library('data.table')
dt <- data.table(df, key = '
On Aug 12, 2011, at 21:26 , Duncan Murdoch wrote:
> On 12/08/2011 2:03 PM, RobertJK wrote:
>> Any way to run an R function every 5 minutes from the R terminal? Searched
>> around but couldn't find any answers. Thanks!!
>
> Yes, but not in the background:
>
> repeat {
> f()
> Sys.sleep(300)
>
Do you want to be doing other things with the R terminal in the meantime?
Are you OK with the terminal being locked up between runs and just want to see
the output updated?
Is it OK to have a new instance of R run the function?
If the last one is doable then you can have your OS scheduled to r
On Aug 12, 2011, at 21:12 , Ed Heaton wrote:
> Hi, all.
>
> I'm new to R. I've been a SAS programmer for 20 years.
>
> I seem to be having trouble with the most basic task - bringing a table in
> an *.RData file into a data.frame object.
>
> Here's how I created the *.RData file.
>
> library
On 12/08/2011 2:03 PM, RobertJK wrote:
Any way to run an R function every 5 minutes from the R terminal? Searched
around but couldn't find any answers. Thanks!!
Yes, but not in the background:
repeat {
f()
Sys.sleep(300)
}
If you want it run in the background, get your OS to run R to do i
Dear R-users,
When one defines a grid unit object using the 'strwidth' dimension, it
seems that the default plain font is assumed as the following example
illustrates. Is there a way to either make use of a font option when
creating a unit object or to know the factor that exists between the
width
On 12/08/2011 3:12 PM, Ed Heaton wrote:
Hi, all.
I'm new to R. I've been a SAS programmer for 20 years.
I seem to be having trouble with the most basic task - bringing a table in
an *.RData file into a data.frame object.
Here's how I created the *.RData file.
library(RODBC)
db<- odbcConnect(
Hey,
Sys.sleep(300)
?Sys.sleep
Ken Hutchison
On Aug 12, 2554 BE, at 2:03 PM, RobertJK wrote:
> Any way to run an R function every 5 minutes from the R terminal? Searched
> around but couldn't find any answers. Thanks!!
> Robert
>
> --
> View this message in context:
> http://r.7896
Any way to run an R function every 5 minutes from the R terminal? Searched
around but couldn't find any answers. Thanks!!
Robert
--
View this message in context:
http://r.789695.n4.nabble.com/Automating-an-R-function-call-tp3740070p3740070.html
Sent from the R help mailing list archive at Nabble.
Jim Lemon wrote:
>
> Hi Zeki,
>
> fgh<-read.table("fgh.tab",header=TRUE,sep="\t")
> fgh$c<-add.value.labels(fgh$c,c("alive","dead","zombie"))
> fgh$c
>
> Jim
>
Thanks Jim,
This is what i want.
Result as follows;
> test2$c<-add.value.labels(test2$c,c("alive","dead","zombie"))
> test2$c
[1] 0
Hi, all.
I'm new to R. I've been a SAS programmer for 20 years.
I seem to be having trouble with the most basic task - bringing a table in
an *.RData file into a data.frame object.
Here's how I created the *.RData file.
library(RODBC)
db <- odbcConnect("***")
df <- sqlQuery(
db
, "se
Regarding Simon Urbanek's excellent CairoPDF package, I noticed two items:
[1] looking at the april 6, 2011 documentation, on page 6, there are
some painful non-line breaks. One of them makes it impossible to
understand how the process would work. (see my example post earlier
on the charter font
On Fri, 12 Aug 2011, Dimitri Liakhovitski wrote:
Hello!
I have a data frame mysample (sorry for a long way of creating it
below - but I need it in this form, and it works). I regress Y onto X1
through X11 - first without weights, then with weights:
regtest1<-lm(Y~., data=mysample[-13]))
regtes
Hello!
I’d like to have a continuous color bar on my lattice xyplot with colors lets
say from topo.colors such that it has ticks & labels at few specific points
only.
Right now I use do.breaks & level.colors with somewhat large number of steps.
The problem is that color change point doesn’t ne
You are correct. asreml is a commercial package which requires a license.
See the download site for more information.
Kevin Wright
On Fri, Aug 12, 2011 at 12:52 PM, ram basnet wrote:
> Dear Uwe Ligges,
>
> Thanks for response.
> I mean this R package is not free package.
>
> Thanks
>
> Ram K
Katrina,
try this.
reorg<-function(x){
mat<-matrix(x[9:length(x)],ncol=6,byrow=T)
rem.col<-matrix(rep(x[1:8],nrow(mat)),byrow=T,ncol=8)
return(data.frame(cbind(rem.col,mat)))
}
co<-do.call('rbind',apply(coop.dat,1,function(x) reorg(x)))
You may need to tweak a bit to fit exactly what you want.
Dear R community,
I hope someone is out there who has some insights into the ltm package.
Specifically, I am seeking help for the testEquatingData function which is
part of this package.
Here is an example of my data:
#install.packages("ltm", dependencies = TRUE)
library(ltm)
anchor<- as.data.f
Dear Uwe Ligges,
Thanks for response.
I mean this R package is not free package.
Thanks
Ram Kumar Basnet
From: Uwe Ligges
To: ram basnet
Cc: R help
Sent: Friday, August 12, 2011 7:28 PM
Subject: Re: [R] problem in asreml function in wgaim package
On 12.08.2011 19:21, ram basnet wrote:
On 12.08.2011 19:21, ram basnet wrote:
Dear Uwe Ligges,
Thanks for your prompt response.
I visited website link that you mentioned. It seems it needs license
though it is R package.
Don't know about ASREML-R -> ask the authors.
The "wgaim" package itself is declared to be under license GPL-2.
On Fri, Aug 12, 2011 at 11:47 AM, Giles wrote:
> Hi.
>
> I'm comparing output from rollapply.zoo, as produced by two versions
> of R and package zoo. I'm illustrating with an example from a R-help
> posting 'Zoo - bug ???' dated 2010-07-13.
>
> My question is not about the first version, or the q
Q1 is very opaque because you are not even saying what kind of plot you want.
For a regular scatterplot, you have multiple options.
a.) select only the data in the given intervals and plot the data
b.) plot the entire data, but restrict the graph region to the intervals you
are interested in, or
Dear Uwe Ligges,
Thanks for your prompt response.
I visited website link that you mentioned. It seems it needs license though it
is R package.
Am i correct ?
Thanks
Regards,
Ram Kumar Basnet
From: Uwe Ligges
To: ram basnet
Cc: R help
Sent: Friday, August 12, 2011 7:13 PM
Subject: Re:
Dear Colleagues,
Do any R-plugins handle complex sampling procedures? I know that survey is
probably the best one from the command line and the standard linear model can
handle it in the RCommander, but I'd like to be able to show students how to
apply weights doing simple descriptive statistics
Or ?barplot2
barplot2(means,main="Proportion of time spent in AMU
sector",xlab="Treatments",ylab="Proportion of
time",names.arg=c("Solitary","Size-matched conspecific","Sub-adult
conspecific"),cex.names=0.85,axis.lty=1,ylim=c(0,0.4),
plot.ci=TRUE,ci.l=means,ci.u=means+halfSE)
Mikhail
>
On 12.08.2011 18:58, ram basnet wrote:
Dear R users,
I am trying to use "wgaim" package for QTL analysis using mixed model approach. But i am stuck with
"asreml" function while using "wgaim" package.
Do i need a separate package to activate "asreml" function beside "wgaim"
package ?
If so,
?aggregate
aggregate(X~ID, your.data.frame.goes.here, "mean")
Mikhail
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
On
> Behalf Of Julia Moeller
> Sent: Friday, August 12, 2011 10:10 AM
> To: r-help@r-project.org
> Subject: [R] recode Va
On 12.08.2011 18:43, Christopher Crooks wrote:
Hi,
I know there have been numerous posts about this but I am unable to find one,
or at least carry out one, that gives me the plot I want.
I have managed to add the error bars to the plot, but they end up not aligned
with the centre of the bars
Dear R users,
I am trying to use "wgaim" package for QTL analysis using mixed model approach.
But i am stuck with "asreml" function while using "wgaim" package.
Do i need a separate package to activate "asreml" function beside "wgaim"
package ?
If so, i tried to download "Asreml-R" package (i
Dear R users,
This is most likely very basic question but I am new to R and would really
appreciate some tips on those two problems.
1) I need to plot variables from a data frame. Because of some few high numbers
my graph is really strange looking. How could I plot a fraction of the samples
(
Hi.
I'm comparing output from rollapply.zoo, as produced by two versions
of R and package zoo. I'm illustrating with an example from a R-help
posting 'Zoo - bug ???' dated 2010-07-13.
My question is not about the first version, or the questions raised in
that posting, because the behaviour is as
Hi,
I know there have been numerous posts about this but I am unable to find one,
or at least carry out one, that gives me the plot I want.
I have managed to add the error bars to the plot, but they end up not aligned
with the centre of the bars themselves.
Here is my script:
means<-c(0.135
Hi,
as an R-beginner, I have a recoding problem and hope you can help me:
I am working on a SPSS dataset, which I loaded into R (load("C:/...)
I have 2 existing Variables: "ID" and "X" ,
and one variable to be computed: meanX.dependID (=mean of X for all rows
in which ID has the same value)
I hope this helps:
xyplot(val ~ x | type,
panel=function(...) {
panel.xyplot(...)
panel.abline(h=.6)
})
Mikhail
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
On
> Behalf Of jjap
> Sent: Friday, August 1
Sorry -- missed a tweak. The call to DataSplitsCore should read
nr = floor(NROW(Data)/2); Data1 = Data[(1:nr)]; Data2 = Data[-(1:nr)];
DataSplitsCore(Data1,Data2,alpha,level)
On Fri, Aug 12, 2011 at 11:46 AM, R. Michael Weylandt <
michael.weyla...@gmail.com> wrote:
> Hmmm, interesting problem. I
Hmmm, interesting problem. I now see your motivation for not using a data
frame set up in the split code: try this --
DataSplits <- function(Data, alpha = 0.05) {
DataSplitsCore <- function(Data1,Data2, alpha, level) {
tt <- t.test(Data1,Data2)
print(tt)
if (tt$p.value
Hello!
I have a data frame mysample (sorry for a long way of creating it
below - but I need it in this form, and it works). I regress Y onto X1
through X11 - first without weights, then with weights:
regtest1<-lm(Y~., data=mysample[-13]))
regtest2<-lm(Y~., data=mysample[-13]),weights=mysample$wei
Dear R-users,
I am unsuccessful in trying to add an horizontal line to all graphs in the
example below:
library(lattice)
val<-runif(15)
x<-rep(seq(1:5),3)
type<-c(rep("a",5), rep("b",5), rep("c",5))
xyplot(val ~ x | type, panel.abline(h=.6))
Any hints are appreciated.
Best regards,
---Jean
On 12.08.2011 12:23, BeckyHolt wrote:
Hi,
Im trying to export a very large dataset from R after i have perfomed a
predict function.
I have tried saving the data as an object and then exporting via write.table
but it is too big to fit into both a txt file and an excel.csv file...the
following e
On 12.08.2011 11:40, Peter Aberline wrote:
Hi,
I'm new to R. Apologies if this is a simple query, I've searched the mailing
lists and docs but can't find a solution to my problem.
I'm trying to make some packages available on our intranet. During development
the 'intranet' is a webserver r
I doubt what you have in mind makes too much sense, but changing the
environment of a function foo to and environment env can be done using
environment(foo) <- env
Uwe Ligges
On 12.08.2011 16:45, Frederic F wrote:
Hello,
Is there a syntax to set the environment of a function when this func
Shouldn't the "i" in your theta() function refer to the selected rows (a
"vector of indices" as referred to in the help file for boot) of the data
used by boot()?
theta <- function(data, i) {
data <- data[i, ]
data.cov <- cov(data)
data.eigen <- eigen(data.cov)
data.eigen$values[1]/sum(d
On 03.08.2011 09:03, Rainer M Krug wrote:
Hi
although the background is that it happened on an hpc cluster, this question
does *not* concern hpc computing with R.
I was using R on a cluster and had to install several packages in my home
directory. Now the head node was migrated to new hardwar
Hello,
Is there a syntax to set the environment of a function when this function is
defined?
The best I could come up with so far is using a wrapper function:
foo_internals<- function(x) {"Code of the function"}
foo<- function(x) {
environment(foo_internals)<-as.environment(target_environme
Jim Lemon wrote:
>
> On 08/12/2011 12:10 AM, zcatav wrote:
>> Hello R people,
>>
>> I have a "data.frame". Status variable has 3 values. 0->alive, 1->dead
>> and
>> 2->missed
>> Status as a factor have correct levels. Levels and labels output as
>> follows;
>>
>> levels(Adbf$status); labels(Adbf$
Hi,
My data.frame as follows;
a b c d
1 58009 2010-11-02 0 NA
2 114761 2011-07-28 1 2008-11-05
3 184440 2011-07-28 1 2009-12-08
4 189372 2011-07-28 0 NA
5 105286 NA
Hi Ista,
Thanks for your suggestion, I am still trying to wrap my head around the
functions you used, as I am not familiar with any of them, but it works
perfectly!
I do want to understand the code, if you don't mind I would like to ask a
few questions
In this line:
dfm <- melt(df[c(1, 2, 5, 8)],
Hi,
Im trying to export a very large dataset from R after i have perfomed a
predict function.
I have tried saving the data as an object and then exporting via write.table
but it is too big to fit into both a txt file and an excel.csv file...the
following error occyrs : "clipboard buffer is full a
Hi R-help,
I am working with US COOP network station data and the files are
concatenated in single rows for all years, but I need to pull these
apart into rows for each day. To do this, I need to extract part of
each row such as station id, year, mo, and repeat this against other
variables in the
Hi,
thanks for response it's work perfect. Yes 't' is not good wariable it will
be 'test', my wrong.
Best
Marcin M.
--
View this message in context:
http://r.789695.n4.nabble.com/Removing-all-duplicate-row-except-by-one-tp3736949p3738132.html
Sent from the R help mailing list archive at Nabble
Hi,
I've solved a simple differential equation describing the degradation of
amino acid carbon (THAA-C) using deSolve.
Code is a follows:
# Input of model parameters, a and b describes form of curve, i is apparent
initial age of Org. C.
parameters <- c(a = a, b = b, i=i)
# Initial val
Hi,
I'm new to R. Apologies if this is a simple query, I've searched the mailing
lists and docs but can't find a solution to my problem.
I'm trying to make some packages available on our intranet. During development
the 'intranet' is a webserver running on localhost.
* When I call "insta
On 12.08.2011 01:28, Amelia McNamara wrote:
I would like to know if there is a way to reduce the space between the
legend title and the first line of the legend, without reducing all
the vertical space using y.intersp. Because of lack of space, I would
like to differentiate my title by bolding
Hi,
It's kind of weird for me to not see a return() statement in the
function. Maybe try rolling your own, nonparametric bootstraps aren't all
that bad.
i.e.
reps=1000
stat.holder=rep(NA,reps) ###Rep of NA's so you can pick up errors easily
for(count in 1:reps)
{
bootsample=sample(data, n.data
Hi R-help,
I am trying to implement a nonparametric bootstrap to find the
standard errors of a simple statistics - the ratio of two scalars. I
am having difficulty getting boot() to work correctly. I code a
function to create the ratio of the relevant scalars. theta(data, i).
When I call the fun
On Fri, Aug 12, 2011 at 3:54 AM, Lali wrote:
> Hi Ista,
> Thanks for your suggestion, I am still trying to wrap my head around the
> functions you used, as I am not familiar with any of them, but it works
> perfectly!
> I do want to understand the code, if you don't mind I would like to ask a
> fe
Yes, that likely is the source of the difference: I'm happy to help fix it
up (won't be hard), but I want to clarify exactly how you want the data
done:
say we have 20 variables x = 1:20 if there's a split we go to 1:10, 11:20;
then 1:5, 6:10, 11:15,16:20 etc
but what about situations with very d
On 11-08-11 5:46 PM, Wei Hao wrote:
Hi all:
Having browsed Rinternals.h, it's a little unclear to me how to get
attributes that aren't in the "Symbol Table Shortcuts" section of that
file. In particular, I would like to extract the attribute
"scaled:center" from a SEXP.
This is an R-devel ques
On Fri, Aug 12, 2011 at 3:15 AM, christiaan pauw wrote:
> Hi Everybody
>
> In R, the XLConnect package can read and write named region to and from
> Excel. In order to read a named region with the readNamedRegion function you
> need to know it's name. You can check is a name exists with existsName
Doesn't:
x <- sample(0:2,100,TRUE)
y <- structure(factor(x,labels=c("alive","dead","missed")), orig.labs=x)
do what you want?
-- Bert
> The OP wanted to "associate" the label "alive" with the value 0, but didn't
> want the underlying value in x to change. The construction
>
> y <- factor(x
On Fri, Aug 12, 2011 at 11:10 AM, Chris Beeley wrote:
>
> I'm having a problem with odfWeave. I'm still testing it out, and have
> used both of these code chunks, which I copied off a blog:
>
> ...
>
> The really weird thing is that I have replicated the problem across
> two operating systems (dua
You obviously have a combination from R code in package base and
compiled C code of base R that do not match.
Point is that the "matrix" R code passes 7 arguments to the underlying
.Internal code that should also expect 7 arguments. If just 5 are passes
the R code is from an ancient version of
Hello all-
I'm having a problem with odfWeave. I'm still testing it out, and have
used both of these code chunks, which I copied off a blog:
Number 1:
A sample document last processed
\Sexpr{Sys.time()}.
This simply illustrates the output from an
R command inserted into our document.
This is usi
Thanks Uwe.
I'm aware (and have been forcefully reminded) that using a mapped drive
avoids these problems. But there is no single drive letter which I can use
site-wide, so I have problems with things like R_LIBS_SITE. As I've outlined
I'm exploring a range of solutions, including mapping a dri
On 08/12/2011 02:04 AM, Juliet Hannah wrote:
I am trying to improve the look of an HTML table for a report (that
needs to be pasted into Word).
Here is an example.
table2<- structure(c(26L, 0L, 40L, 0L, 10L, 0L, 0L, 188L, 0L, 281L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 4L), .Dim = c(6L, 3L), .Dimnames =
On 08/12/2011 12:10 AM, zcatav wrote:
Hello R people,
I have a "data.frame". Status variable has 3 values. 0->alive, 1->dead and
2->missed
Status as a factor have correct levels. Levels and labels output as follows;
levels(Adbf$status); labels(Adbf$status)
[1] "0" "1" "2"
[1] "1" "2" "3"
Hi,
Back in June I posted the message below, but had no replies. I've made a
little progress since then so this is to update anyone interested (!) and to
ask for comments.
Brief problem statement:
Under Windows, some parts of R don't handle UNC paths beginning with
backslashes. Specifically
a)
Thank you for your reply,
I used this code on my test data, but did not get the same p-values.
I think I know were the difference lies; when the data is split in 4 parts I
want to compare the two left groups (group 1 and 2) with each other and the two
right groups (group 3 and 4) with each
On 08/11/2011 07:51 PM, William Dunlap wrote:
>> -Original Message-
>> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
>> Behalf Of R. Michael
>> Weylandt
>> Sent: Thursday, August 11, 2011 10:09 AM
>> To: Srinivas Iyyer
>> Cc: r-help@r-project.org
>> Subject:
On Fri, Aug 12, 2011 at 12:15 PM, Fredrik Karlsson wrote:
> Hi,
>
> I need a custom axis function for a plot, but it seems
> that current.panel.limits() sometimes returns NaN limits for the plot, which
> it much harder to calculate anything sensible.
> An illustration:
>
> Given this axis function
Hi Everybody
In R, the XLConnect package can read and write named region to and from
Excel. In order to read a named region with the readNamedRegion function you
need to know it's name. You can check is a name exists with existsName, but
you still have to know the name. Is there a way to actually
77 matches
Mail list logo