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)
df3<-data.frame(C1=sample(LETTERS[1:10],10,replace=FALSE),B1=rnorm(10,3))
Hi,
It's working for me.
Try this:
dat1<-read.csv("test.csv")
dat2<-na.omit(dat1)
nrow(dat1)
#[1] 635
nrow(dat2)
#[1] 627
B<-gsub(" slope{0,1}\\s\\((.*)\\)","\\1",dat2$Composition_percent_part)
fun1<-function(x){
C<-gsub("(.*)/(.*)","\\1 0 0 \\2", gsub("(.*)/(.*)/(.*)","\\1 \\2 0 \\3",
gsub("
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 estimated
Hazard ratio from the model is incorrect (verified by an AFT mod
As df2 has only one column and is thus effectively a variable in this case,
you don't even need to merge.
df1[df1$gene_name%in%df2$gene_name , ]
should do.
HTH,
Daniel
wong, honkit (Stephen) wrote
>
> Dear Experienced R users,
>
> I have a looks-like simple but complicated problem urgently
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 inquiry that while I am no
I would call something like this via ssh (please note: I used "ggplot2" in
the example):
Rscript -e
'as.numeric(suppressWarnings(suppressPackageStartupMessages(require(ggplot2'
You could easily extend this to loop through the required packages and
tweak the output for your needs.
Best,
Gerge
HI Andras,
No problem.
But, i guess using colMeans() as suggested by Rainer should be faster in large
datasets.
A.K.
- Original Message -
From: Andras Farkas
To: smartpink...@yahoo.com
Cc:
Sent: Sunday, September 2, 2012 4:59 PM
Subject: Re: [R] Help on finding specific columns in
HI,
You can also try this as a function:
fun1<-function(x){
B<-gsub("percent{0,1}\\s\\((.*)\\)","\\1",x)
C<-gsub("(.*)/(.*)","\\1 0 0 \\2", gsub("(.*)/(.*)/(.*)","\\1 \\2 0 \\3",
gsub("(.*)/(.*)/(.*)/(.*)","\\1 \\2 \\3 \\4",B)))
dat1<-data.frame(do.call(rbind,strsplit(C," ")))
colnames(dat1)<-past
Hi,
I have 4 files with 1 individuals in each file and 10 columns each.
One of the columns, say C1, may have elements in common with the other
columns C1 of other files.
If I have only 2 files, I can do this check with the command:
data1[data1 %in% data2]
data2[data2 %in% data1]
How do I ch
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
Hello,
You should Cc the list, there are others presenting solutions.
What's going on should be obvious, your data example had "percent" in
it, and your data file has "slope"!
How could you expect it to work?
Just in case, I'm changing the regular expression to removing everything
but bars and
Duncan
I are getting closer to an understanding.
1. "index" is not relevant to the discussion. i am focused solely on
margin text
2. the size pf the margin text does not change between pages
3. however, the location does change, moreso on the top / right than
on the
Read the posting guide... you need to provide more specific information such as
sample data (?dput).
For this problem you should probably read
?merge
---
Jeff NewmillerThe . . Go Li
Dear Experienced R users,
I have a looks-like simple but complicated problem urgently needed to be
solved. Below is the detail:
I have two dataframes, df1, df2. df1 contains two column and many thousands
rows: column 1 is a "gene_name", column 2 is "value". df2 contains only one
column which i
I apologize, I did not intend to blame anyone. I actually thought
there may be some underlying differences in the formulas used. The
patterns overall are very similar but they are not that precise to one
another. The function I use in r is called spTransform from the
package "rgdal".
Agai
Hello,
Thanks for the indications for use epi.2by2 in svytable, however when running
the code throws warnings
that reference NANs, could help me with this? Following you show the results:
> int19<-svytable(~Perdida_peso_no_intensionada+APES_DICOT+tabaco,Muestra.comp,Ntotal
> = NULL)
> int19
summary: 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?
details:
For my work I need a few non-standard R packages. I do that work on 2
clusters. One uses environment modules,
On 12-09-02 3:52 PM, Dennis Fisher wrote:
Duncan
Perhaps I did not explain sufficiently -- the code that I sent makes the
correction in FINDCEX. But, that correction does not accomplish the intended
goal -- as evidenced by the graphic that is created from the code that I sent.
The option of
Duncan
Perhaps I did not explain sufficiently -- the code that I sent makes the
correction in FINDCEX. But, that correction does not accomplish the intended
goal -- as evidenced by the graphic that is created from the code that I sent.
The option of "brute force" would require trial and error.
Hello,
Try the following
library(XML)
url <- "http://ratings.fide.com/top.phtml?list=men";
chess <- readHTMLTable(url, header = TRUE, which = 5)
str(chess) # See what we have
# All variables are factors,
# convert these to integer
chess$Rating <- as.integer(chess$Rating)
chess$Games <- as.i
Hello,
In the mean time, I've "discovered" an R package that might do the job,
chemCal. It only implements first order linear regression (weighted),
and like I'd said in my first reply, and was repeated several times, the
standard errors are not reversed, the prediction bands follow Massart et
There is no 'reprojection' in R (which is upper case). Please attribute
blame correctly.
You seem to be talking about some contributed addon package, not
specified. But I think you should be asking this on R-sig-geo.
On 02/09/2012 19:24, Camilo Mora wrote:
Hi everyone,
I wonder if anyone
On 12-09-02 1:40 PM, Dennis Fisher wrote:
R 2.15.1
OS X (MLion)
Colleagues,
I am aware that changes in mfrow / mfcol in par() affect cex (from help: In a layout with
exactly two rows and columns the base value of ‘"cex"’ is reduced by a factor
of 0.83: if there are three or more of either row
Hi everyone,
I wonder if anyone knows the reason why the outputs of the same
reprojection in r and arcgis are different?. The magnitude of the
change can be up to 40 km in the poles.
Basically, I have a database of points equally separated by one degree
over the globe.
In ARCGIS, I am proj
Mr Arnold,
> What would be the most efficient way to load the data at the following
>> address into a dataframe?
>>
>
To what end? In other words, what are you trying to achieve with the
ratings list? -- H
--
Sent from my mobile device
Envoyait de mon portable
[[alternative HTML version
You might take a look at the link titled "Download Rating List",
in the blue box on the right side of that page...
albyn
On 2012-09-02 9:41, David Arnold wrote:
All,
What would be the most efficient way to load the data at the
following
address into a dataframe?
http://ratings.fide.com/top.
R 2.15.1
OS X (MLion)
Colleagues,
I am aware that changes in mfrow / mfcol in par() affect cex (from help: In a
layout with exactly two rows and columns the base value of ‘"cex"’ is reduced
by a factor of 0.83: if there are three or more of either rows or columns, the
reduction factor is 0.66)
All,
What would be the most efficient way to load the data at the following
address into a dataframe?
http://ratings.fide.com/top.phtml?list=men
Thanks,
David
--
View this message in context:
http://r.789695.n4.nabble.com/Loading-Chess-Data-tp4642006.html
Sent from the R help mailing list a
Thank you all. My muddle about predict.lm(..., type = "terms") was evident even
in my first sentence of my original posting
> How can I actually use the output of
> predict.lm(..., type="terms") to predict
> new term values from new response values?
the answer being that I cannot; that new re
Hi,
I am looking for the best way or best package available for simulating a
genetic association between a specific SNP and a quantitative
phenotype. All of the packages I saw in R seem to be specialised in
pedigree data or in population data where coalescence and other
evolutionary factors are sp
Hi,
No problem.
If you use join() instead of merge(), the original order of columns may not get
altered.
dat3<-aggregate(DAYS_DIFF~PT_ID,data=dat1,min)
library(plyr)
join(dat1,dat3,type="inner")
#Joining by: PT_ID, DAYS_DIFF
# PT_ID IDX_DT OBS_DATE DAYS_DIFF OBS_VALUE CATEGORY
#1 4549 2
Hi,
Try this:
which.min(apply(a,2,mean))
#[1] 1
which.max(apply(a,2,mean))
#[1] 4
A.K.
- Original Message -
From: Andras Farkas
To: "r-help@r-project.org"
Cc:
Sent: Sunday, September 2, 2012 5:49 AM
Subject: [R] Help on finding specific columns in matrix
Dear All,
I have a matr
Right, I've worked this one out - the problem is that the example (above)
I was using to test run this package only contains 3 variables. When you
add in a fourth it works fine:
d = runif(30)
And run again telling it to use GA:
babs <- glmulti(y~a*b*c*d, level = 2, fitfunc = lmer.gl
Dear list members,
Any help on this efficiency issue would be greatly appreciated.
I would like to find the most efficient way to run a non-vectorized function
(here: fisher exact test p-value) iteratively using 4 matrices with identical
dimensions. And as a result I aim for an array with ident
On Sep 2, 2012, at 12:16 AM, Luo Yinling wrote:
Dear R community
In my experiment, there are three treatments (F, R, and S), and
the storge temperatures of these seeds were 4, 10 and 15. The seeds
number of the treatment were the same. The question is whether the
treatments and stora
Hello,
You don't need a new function, what you need is to prepare your data in
such a way that the function can process it.
A <- c("percent (10/20/30)", "percent (40/20)", "percent (60/10/10/5)",
"percent (80/10)")
B <- gsub("\\(|\\)|percent| ", "", A)
fun(B)
Also, please use dput to post th
I very appreciate for good comments and tip regarding my question. All
postings are excellent to know when I am writing such expression in R.
Thank you so much, and my question is completely resolved from all your
postings.
On Sun, 2012-09-02 at 00:50 +0100, Rui Barradas wrote:
> Em 02-09-2012 00
If I understand your question correctly, you want to identify the one column
that has the lowest mean of all columns, and the one column that has the
highest mean of all columns.
Using your provided sample data, this gives you the indices:
> colMeans(a)
[1] 12.48160 17.46868 22.51761 27.59880
>
Dear list members,
I am picking up some experimental data that was collected last year and
analysed using a within subject repeated measure ANOVA using SPSS (glm).
There are 3 factors (F1, F2, F3), each with 2 levels (foc - per; on - off; l
- r) recorded within a balanced 2x2x2 design.
I want to
Dear R community
In my experiment, there are three treatments (F, R, and S), and the storge
temperatures of these seeds were 4, 10 and 15. The seeds number of the
treatment were the same. The question is whether the treatments and storage
temperatures changed the seed germinating. The dat
Dear All,
I have a matrix with 33 columns and 5000 rows. I would like to find 2 specific
columns in the set: the one that holds the highest values and the one that
holds the lowest values. In this case the column's mean would be apropriate to
use to try to find those specific columns because e
Dear List,
I'm using glmulti for model averaging in R. There are ~10 variables in my
model, making exhaustive screening impractical - I therefore need to use
the genetic algorithm (GA) (call: method = "g").
I need to include random effects so I'm using glmulti as a wrapper for
lme4. Metho
I should have added
?help.start
tells you what I did already. So you should make it your first order of
business to learn to use R's Help system.
-- Bert
On Sat, Sep 1, 2012 at 2:39 PM, Carilda Thomas wrote:
> Following the beginning tutorial, I typed help.start() and was given a
> choice of b
?options
options("browser") <- ## whatever
If you don't know how to use the Help system, read the Intro to R tutorial
-- ot type ?help at the command prompt in interactive mode fpr the help for
help.
-- Bert
On Sat, Sep 1, 2012 at 2:39 PM, Carilda Thomas wrote:
> Following the beginning tutori
44 matches
Mail list logo