Hi
But i still wonder what is wrong on aggregate?
aggregate(iris, list(iris$Species), summary)
gives you somewhat complicated data frame with numeric values, which you can
extract as you wish.
names(aggregate(iris, list(iris$Species), summary)[2])
[1] Sepal.Length
aggregate(iris,
Greetings!
I have the following vector already in decreasing order:
125, 124, 111, 108, 107, 107, 105,
I want to find out the rank, so I do the following:
rank(-x, ties.method=min)
Then I get the following:
1, 2, 3, 4, 5, 5, 7,
but that is not what I want. I want it to give:
1.
Hi
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
project.org] On Behalf Of kallu
Sent: Thursday, October 11, 2012 3:05 PM
To: r-help@r-project.org
Subject: [R] Exporting each row in the table as new table
Dear all,
I am new to R and I am
If they are already in decreasing order, you might be able to work
something out like (untested):
cumsum(c(1, diff(x) 0))
Cheers,
Michael
On Fri, Oct 12, 2012 at 8:05 AM, Henri-Paul Indiogine
hindiog...@gmail.com wrote:
Greetings!
I have the following vector already in decreasing order:
Dear All,
I'm dealing with a case, where 'manhattan' distance of each of 100
vectors is calculated from 1 other vectors. For achieving this,
following 4 scenarios are tested:
1) scenario 1:
x-read.table(query.vec)
v-read.table(query.vec2)
d-matrix(nrow=nrow(v),ncol=nrow(x))
for (i in
Le jeudi 11 octobre 2012 à 15:50 -0700, Christopher R. Dolanc a écrit :
Hello,
I'm having trouble figuring out how to see resulting groups (clusters)
from my hclust() output. I have a very large matrix of 4371 plots and 29
species, so simply looking at the graph is impossible. There must
Roey Angel angel at mpi-marburg.mpg.de writes:
Hi,
Using Vegan package I was wondering if there's a way to use a distance
matrix as an input for adonis (or any of the other similar hypothesis
testing functions) instead of the usual species by sample table.
Working in the field of
Hi Michael!
2012/10/12 R. Michael Weylandt michael.weyla...@gmail.com:
If they are already in decreasing order, you might be able to work
something out like (untested):
cumsum(c(1, diff(x) 0))
Thanks seems to work. Thanks a bunch!
Henri-Paul
--
Henri-Paul Indiogine
Curriculum
Smooth terms are constrained to sum to zero over the covariate values.
This is an identifiability constraint designed to avoid confounding with
the intercept (particularly important if you have more than one smooth).
If you remove the intercept from you model altogether (m2) then the
smooth
Dear Prof. Lumley,
Thank You very much for Your reply. I implemented Your idea
not to directly call get from sapply, but inside a function, supplied to sapply.
In this way the 3-rd parent frame is always the correct one, no matter
whether I invoke testfun2()
all by itself or inside another
Hello,
First of all, you should say which packages you are using. There is a
function ks.boot in package Matching and there are functions pgev in
several packages. For instance, package evd.
Apparently there is nothing wrong with ks.test, you simply are unable to
call ks.boot. So, write a
This is pretty confusing writeup, but if you have iterations, then yes, you
need a loop or a recursion.
A loop is probably easier, take a look at
?for
or
?apply
for this.
there are several derivates of apply
for example, say your outputs are what the code below gives you for each file,
I get this error : Error in file(file, rt) : cannot open
the connection
...
saspath=\C:/Program Files/SAS/SASFoundation/9.2,
I don't know the package but your saspath only contains one quote mark, so you
have given it C:/Program Files/SAS/SASFoundation/9.2 to open. Would it not
[mailto:r-help-boun...@r-project.org] On Behalf Of William Dunlap
Subject: Re: [R] characters, mathematical expressions and computed values
I think that bquote, with its .() operator, suffices for
[almost?] any single title;
...
E.g.,
hist(new, main=bquote(Heart Attack ( *
On 12 Oct 2012, at 09:46, Purna chander wrote:
4) scenario4:
x-read.table(query.vec)
v-read.table(query.vec2)
v-as.matrix(v)
d-dist(rbind(v,x),method=manhattan)
m-as.matrix(d)
m2-m[1:nrow(v),(nrow(v)+1):nrow(x)]
print(m2[1,1:10])
time taken for running the code:
real0m0.445s
It is easy to get a cumulative hazard curve.
First, decide what values of age, a, and b you want curves for
tdata- data.frame(age=55, a=2, b=6)
Get the curves, there will be one for each strata in the output
sfit- survfit(coxPhMod, newdata= tdata)
Plot them
plot(sfit, fun='cumhaz',
I wish to create a matrix of all possible percentages with two decimal place
percision. I then want each row to sum to 100%. I started with the code
below with the intent to then subset the data based on the row sum. This
works great for 2 or 3 columns, but if I try 4 or more columns the number
I recently gave a talk to the Ottawa PC Users Group about Sweave, knitR and
odfWeave. The
last is sometimes cranky, but I've found I can use it for word-processing
documents, and
if these are saved in odt format (open office), then odfWeave can process them
to
finalized odt form.
Recognize
If you are after all the possible percentages with two decimal places, why
don't you use this:
seq(from=0, to=100, by=.01)/100
I'm not really sure what you are trying to do in terms of rows and columns,
however. Can you be a bit more specific on what each row/column is?
Are you trying to
To avoid FAQ 7.31, you probably should use:
seq(0, 1) / 1
On Fri, Oct 12, 2012 at 11:12 AM, Mark Lamias mlam...@yahoo.com wrote:
If you are after all the possible percentages with two decimal places, why
don't you use this:
seq(from=0, to=100, by=.01)/100
I'm not really sure what
Why does R2wd not work?
I already got it working on a 64-bit PC, but I think you need a different
statconn if I recall correctly.
If you already have some scripts with R2wd, it's maybe easier to invest some
time to get it working than switching to rtf.
Anyway thanks for the tip, if I need it, I
when i am installing Rmysql packages i get error like
Warning in install.packages :
package ‘RMySQL’ is not available (for R version 2.15.0)
which is earliest version should i used ?how should i know the specific
version
--
View this message in context:
But i need to read my data from XML.
barplot
cd
name表/name
value13/value1
value22.9/value2
/cd
cd
name笔/name
value13.3/value1
value23/value2
/cd
when i am installing package manually (using below command) i get error about
cygwin as,
install.packages(C:\\Users\\trendwise\\Downloads\\RMySQL_0.9-3.tar.gz,lib=getOption(lib),
repos = NULL, type=source)
error:--
Installing package(s) into
Hi, i'm trying to simplify some R code but i got stucked in this:
test-data.frame(cbind(id,x1,x2,x3,x4,x5,x6,x7))
test
test
id x1 x2 x3 x4 x5 x6 x7
1 1 36 26 21 32 31 27 31
2 2 45 21 46 50 22 36 29
3 3 49 47 35 44 33 31 46
4 4 42 32 38 28 39 45 32
5 5 29 42 39 48 25 35 34
6 6 39
Apologies for re-posting, my original message seems to have been
overlooked by the moderators.
-- Forwarded message --
From: Ed icelus...@gmail.com
Date: 11 October 2012 19:03
Subject: party for prediction
To: R-help@r-project.org
Hi there
I'm experiencing some problems using
Hi all,
I've been wondering for a long time why R drops the dimensions of an
array/matrix when you try to take a subset of one column. I mean this:
dim(A)
[1] 2 5 2
B=A[1,,]
dim(B)
5 2 # so now dim(B)[3] doesn't work
C=B[2,]
dim(C)
NULL # so now nrow(C) doesn't work
Typically, you can get
Hi there,
I tried this code from homepage:
http://myowelt.blogspot.de/2008/04/beautiful-correlation-tables-in-r.html
http://myowelt.blogspot.de/2008/04/beautiful-correlation-tables-in-r.html
corstarsl - function(x){
require(Hmisc)
x - as.matrix(x)
R - rcorr(x)$r
p - rcorr(x)$P
## define
Suppose I have Orange1 data like this.
TIME1
RESPONSE
RESPSTAT
RESPUT
REFID
ARM
SUBARM
0
299.5
Mean
8-item scale
68
0
0
0
287
Median
8-item scale
68
0
0
0
303.9
Mean
8-item scale
68
1
0
0
286
Median
8-item scale
68
1
0
0
295
Mean
8-item scale
85
0
0
12
lau pel wrote
Hi,
I'm going crazy trying to plot a quite simple graph.
i need to plot estimated hazard rate from a cox model.
supposing the model i like this:
coxPhMod=coxph(Surv(TIME, EV) ~ AGE+A+B+strata(C) data=data)
with 4 level for C.
how can i obtain a graph with 4 estimated (better
Hej,
i need the which() funktion to find the positions of an entry in a matrix.
the entries i'm looking for are : seq(begin,end,0.01) and there are no
empty spaces
i'm searching in the right range.
so i was looking for the results R can find and i recieved this answer.
for (l in
Hi again! Just in case someone ends up googling this for the same thing I
did, here is a modification to get around a little problem:
dat1-data.frame(keys=paste(key,5:1,sep=),value=1:5)
splitlist - split(dat1,dat1$keys)
list3-sapply(splitlist,`[`,2)
names(list3)-names(splitlist)
list3$key2
Hello,
Something like this?
g[rowSums(g) == 100, ]
Hope this helps,
Rui Barradas
Em 12-10-2012 15:30, wwreith escreveu:
I wish to create a matrix of all possible percentages with two decimal place
percision. I then want each row to sum to 100%. I started with the code
below with the intent
Dear useRs,
I have a slightly complicated data structure and am stuck trying to extract
what I need. I'm pasting an example of this data below. In some cases, there
are duplicates in the gene_id column because there are two different sample
1 values for a given sample 2 value. Where these
That was exacly what i was looking for! Thanks a lot!
Cheers!
--
View this message in context:
http://r.789695.n4.nabble.com/ifelse-reformulation-tp4645981p4645990.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org
On Oct 12, 2012, at 4:52 AM, Markku Karhunen markku.karhu...@helsinki.fi
wrote:
Hi all,
I've been wondering for a long time why R drops the dimensions of an
array/matrix when you try to take a subset of one column. I mean this:
dim(A)
[1] 2 5 2
B=A[1,,]
dim(B)
5 2 # so now
On 12-10-2012, at 11:52, Markku Karhunen markku.karhu...@helsinki.fi wrote:
Hi all,
I've been wondering for a long time why R drops the dimensions of an
array/matrix when you try to take a subset of one column. I mean this:
dim(A)
[1] 2 5 2
B=A[1,,]
Use
B - A[1,,,drop=FALSE]
On Oct 12, 2012, at 1:37 AM, Ed wrote:
Apologies for re-posting, my original message seems to have been
overlooked by the moderators.
No. Your original post _was_ forwarded to the list. On my machine it appeared
at October 11, 2012 11:03:08 AM PDT. No one responded. It seems possible that
On Oct 12, 2012, at 1:07 AM, Henri-Paul Indiogine wrote:
Hi Michael!
2012/10/12 R. Michael Weylandt michael.weyla...@gmail.com:
If they are already in decreasing order, you might be able to work
something out like (untested):
cumsum(c(1, diff(x) 0))
Thanks seems to work. Thanks a
Sorry, my mistake, I didn't get a notification or see it send. Thanks
for clearing that up.
Best wishes
Ed
On 12 October 2012 16:58, David Winsemius dwinsem...@comcast.net wrote:
On Oct 12, 2012, at 1:37 AM, Ed wrote:
Apologies for re-posting, my original message seems to have been
When trying to start RWinEdt on a new laptop I am getting the following
sequence of error messages
540Errors have occured while loading *.png images:
C:\Program Files (x86)\WinEdt Team\WinEdt 7\Bitmaps\Images\Abbreviation.png
Can't Open Macro File ?
Exe(?);
Can't Open Macro File Readonly
On Oct 12, 2012, at 2:52 AM, Markku Karhunen wrote:
Hi all,
I've been wondering for a long time why R drops the dimensions of an
array/matrix when you try to take a subset of one column. I mean this:
dim(A)
[1] 2 5 2
B=A[1,,]
dim(B)
5 2 # so now dim(B)[3] doesn't work
C=B[2,]
HI,
Try this:
count40- ifelse(test1$x3==40|test1$x4==40|test1$x5==40,0,1)
count40
# [1] 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1
as.vector(apply(test1,1,function(x) ifelse(any(x[4:6]==40),0,1)))
# [1] 1 1 1 1 1 1 1 1 1 1 1 1 0 1 1
A.K.
- Original Message -
From: brunosm brunos...@gmail.com
See R FAQ 7.31.
---
Jeff NewmillerThe . . Go Live...
DCN:jdnew...@dcn.davis.ca.usBasics: ##.#. ##.#. Live Go...
Live: OO#..
It will be helpful for us of you have some information about OS you are working.
Anyways for windows , there is a similar post in nabble or r-help , so some
googling will not hurt you.
Best Regards,
Bhupendrasinh Thakre
Sent from my iPhone
On Oct 12, 2012, at 12:52 AM, sagarnikam123
Hello,
It could be a job for tapply, but I find it more suited for ?ave.
dat - read.table(text =
gene_id sample_1 sample_2 FL_EARLY FL_LATE
763938 Eucgr.A00054 fl_S1E fl_S1L 13.170800 22.2605
763979 Eucgr.A00101 fl_S1E fl_S1L 0.367960 14.1202
1273243 Eucgr.A00101fl_S2
Greetings,
My data set has dates and times that I am working with. Some of the times
in Time_of_end are blank. This is supposed to dictate that the particular
experiment lasted 48 hours. I would like to add 48 hours to the start
Start_of_Experiment for another column as End_of_Experiment
HI,
You can also try this:
dat1-read.table(text=
gene_id sample_1 sample_2 FL_EARLY FL_LATE
763938 Eucgr.A00054 fl_S1E fl_S1L 13.170800 22.2605
763979 Eucgr.A00101 fl_S1E fl_S1L 0.367960 14.1202
1273243 Eucgr.A00101 fl_S2 fl_S1L 0.356625 14.1202
764169
Hello,
Try the following.
dat - read.table(text=
IDgroup Start_date Time_of_experiment Time_of_end
120209 402/02/2009 12:38:00
26 30209 3 03/02/2009 12:40:00 13:32:00
27 31609 4 03/16/2009 11:28:00
Dear All,
a few weeks ago I have posted a question on the R help listserv that some of
you have responded to with a great solution, would like to thank you for that
again. I thought I would reach out to you with the issue I am trying to solve
now. I have posted the question a few days ago,
Hi arun kirshna
just let me ask you something else.
Imagin that i only want to search in the variables x3,x4 and x5. How can i
do this?
Regards,
Bruno
--
View this message in context:
http://r.789695.n4.nabble.com/ifelse-reformulation-tp4645981p4646013.html
Sent from the R help mailing
Hello,
I am trying to create parcels for a CFA model. I am trying to average 6 sets
of 3 variables each into parcels. I don't understand why I am getting an error
message as follows:
Thanks for your help,
Catherine
atds1par - rowMeans(semHW1dat1[, c(atds1, atds2, atds3)], na.rm=TRUE)
Hi Francisco
The code gives me the correct results, and it works for you on a Windows
machine.
So while it could be different versions of software (e.g. libcurl, RCurl, etc.),
the presence of the word squid in the HTML suggests to me that
your machine/network is using the proxy/caching
Hello,
I am closely following the RTAQ documentation in order to load my dataset
into R, however I get this warning when running the convert function in the
following way:
convert(from=2010-11-01, to=2010-11-01,datasource=datasource,
Le vendredi 12 octobre 2012 à 11:33 -0700, Christopher R. Dolanc a
écrit :
That command gives me the same result. Do you see that R is not listing
the plot numbers? Just all the numbers between 1 and 137, 138 and 310,
etc. It's like it has reordered the dendrogram, so that everything
occurs
Hi all,
I have a problem to read csv file with comma as decimal. The numbers were
readed as strings.
I used the following string in R, but I do not understand why it does not
work.
tab - read.csv2(Specimen_RawData_1.csv, header = TRUE, sep = ;, dec =
,, nrows = -1)
In addition, I copy/past into
do.call(rbind,
by(df, INDICES=df$ID, FUN=function(DF) tail(DF, 2) ))
Another way to approach this sort of problem is to use ave() to
assign a within-group sequence number to each row and then
select the rows with the sequence numbers you want. You can
also use ave() to make a column
I tried changing that to simplysaspath= C:/Program
Files/SAS/SASFoundation/9.2
Still the same error :(
Thanks for reply though
Navin
On Fri, Oct 12, 2012 at 8:24 AM, S Ellison s.elli...@lgcgroup.com wrote:
I get this error : Error in file(file, rt) : cannot open
the connection
...
This works perfect, thank you very much Rui!
On Fri, Oct 12, 2012 at 1:35 PM, Rui Barradas ruipbarra...@sapo.pt wrote:
Hello,
Try the following.
dat - read.table(text=
IDgroup Start_date Time_of_experiment Time_of_end
120209 402/02/2009 12:38:00
Duncan's answer is probably the easiest, but another alternative is to
use the tikz device instead of .eps files, then you can find the code
within the figure for the parts that you want to appear later and
enclose them in the beamer commands that will make them appear later.
Unfortunately this is
On Oct 12, 2012, at 18:45 , Roberto wrote:
Hi all,
I have a problem to read csv file with comma as decimal. The numbers were
readed as strings.
I used the following string in R, but I do not understand why it does not
work.
tab - read.csv2(Specimen_RawData_1.csv, header = TRUE, sep = ;,
I'm forwarding this to the R-SIG-Finance list, where ou'll have a more
specialized audience.
In the meanwhile, you may wish to look at
http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example
Finally, I note you're posting from Nabble. Please do include context in
You can use subscripting on the matrix, e.g. ind - test == 40 and the
test[ind] - 1. Just deal with the id column when you set the rest to 0.
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
project.org] On Behalf Of brunosm
Sent: Friday 12 October 2012
Thanks for the example.
On Thu, Oct 11, 2012 at 7:24 PM, William Dunlap [via R]
ml-node+s789695n4645934...@n4.nabble.com wrote:
I think that bquote, with its .() operator, suffices for [almost?] any
single title;
don't bother fiddling with expression(), substitute(), or parse(). (You
can
You will have to split() the data and unsplit() it after making the
alterations. Have a look at the plyr package for such functions.
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
project.org] On Behalf Of Vining, Kelly
Sent: Friday 12 October 2012
In my case R was not built with X support, and I was also missing some openGL
libraries. The info I needed was in the README inside the unzipped tarball
for rgl. But rgl cleaned up after failing the install, and deleted the
README, so I never new the README was there until I manually untarr'ed
Hi sheenmaria,
Please reread my first post and try to do well any of what I asked of you.
Cheers,
Michael
On Fri, Oct 12, 2012 at 6:13 AM, sheenmaria sheenmar...@gmail.com wrote:
Thanks for your reply .
And i have a doubt
why cant get the result of chart.performanceSummary() with
Hi there,
I just wanted to install gfortran via homebrew on mac os x mountain
lion. It uses the package gcc-42-5666.3-darwin11.pkg for installation.
Unfortunately I recognized that this package is not available anymore.
But the google cache told me that it was available at
arun kirshna wrote
Hi,
Try this:
tab1-read.csv2(Specimen_RawData_1.csv,sep=\t,nrows=-1)
tab2-as.data.frame(sapply(tab1,function(x)
gsub([,],.,x)),stringsAsFactors=FALSE)
tab3-tab2[-1,]
tab3[]-sapply(tab3,as.numeric)
row.names(tab3)-1:nrow(tab3)
head(tab3)
# Carico.compressione
I'm having an sorting problem in dotchart. I want to change the order of the
BA in groups to AB, but I haven't found any solution yet. What should I do?
And what if I want to change the groups order as well? At the bottom from
Conrol up to 10 mg/L on the top. Thank you!
x = c(39, 23, 23, 35, 30,
On Fri, Oct 12, 2012 at 5:50 PM, Torben Griebe torbengri...@gmx.de wrote:
Hi there,
I just wanted to install gfortran via homebrew on mac os x mountain
lion. It uses the package gcc-42-5666.3-darwin11.pkg for installation.
Unfortunately I recognized that this package is not available anymore.
Hi,
You can reorder the matrix:
dotchart(a[c(2,1), 7:1], main=Dotchart, xlim=c(0,50))
Sarah
On Fri, Oct 12, 2012 at 4:38 PM, Zenonn87 zsolt.tar...@hotmail.com wrote:
I'm having an sorting problem in dotchart. I want to change the order of the
BA in groups to AB, but I haven't found any
Reorder the rows and/or columns of your matrix: e.g. dotchart(a[2:1,7:1],
main=Dotchart, xlim=c(0,50))
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org]
On Behalf Of Zenonn87
Sent: Friday, October 12, 2012 23:39
To: r-help@r-project.org
This should also work:
Using the dat1 data frame that arun created:
#1
dat2 - t(dat1[,2:4])
dim(dat2) - prod(dim(dat2))
dat2 - data.frame(Col1=dat2, stringsAsFactors=FALSE)
dat2
Col1
1 A
2 E
3 H
4 B
5 F
6 I
7 C
8 G
9 J
10D
11K
12
#2
dat3
HI,
Try this:
Hi,
Try this:
#For your first question:
dotchart(a[rev(order(rownames(a))),],main=Dotchart,xlim=c(0,50))
#For your second question:
dotchart(a[rev(order(rownames(a))),rev(1:ncol(a))],main=Dotchart,xlim=c(0,50))
A.K.
- Original Message -
From: Zenonn87
I am making exploratory analyses on a complex survey data by using survey
package. Could you help me how to see the goodness of fit for the model
below? Should I use AIC, BIC, ROC, or what? What code would let me run a
goodness of fit test for the model? Here are my codes:
#incorporating design
Hi,
This may be such a general question that my searches are just failing. I
installed the pscl lib, all appears fine, installed it several different
ways to be sure, but I am getting:
Error: could not find function zeroinfl
I double checked my spelling of the function and that it had not been
On 10/10/2012 12:58 PM, Greg Snow wrote:
I finally was able to compile/load it under windows 7. I had similar
problems to what you show below.
I set the MYSQL_HOME environmental variable through windows (start
button control panel System and Security system Advanced
System Settings
I think the issue is that the with expand.grid and times = 4 you are likely to
run out of memory before subscripting (at least on my machine).
A simplification is to realize that you are looking for points in a lattice in
the interior of a (p - 1)-dimensional simplex for p
nprause Nicole.Prause at gmail.com writes:
This may be such a general question that my searches are just failing. I
installed the pscl lib, all appears fine, installed it several different
ways to be sure, but I am getting:
Error: could not find function zeroinfl
I double checked my spelling
HI,
My earlier solutions averaged FL_EARLY values for duplicated gene_ids so that
the resultant dataframe had unique rows. But, if you want to keep the
duplicated rows with average values, you can also try this:
dat$FL_EARLY-unlist(lapply(lapply(split(dat,dat$gene_id),`[`,4),function(x)
i m installing RMySQL under windows -7 64bit,
i have wamp server(which has mysql5.5.16)
i have given MYSQL_HOME path in environment variable as
MYSQL_HOME=C:\wamp\bin\mysql\mysql5.5.16\bin ,
also create Renviron.site file in C:\Program Files\R\R-2.15.0\etc
giving
hi all,
i am using a dcc model for my senior thesis, it looks at stock returns
during times of market uncertainty.
my current rfile is below.
library(SparseM)
library(quantreg)
library(zoo)
library(nortest)
library(MASS)
library(fEcofin)
library(mvtnorm)
library(ccgarch)
library(stats)
83 matches
Mail list logo