Hi,
From time to time I merge two dataframes with possibly a common field.
Then the common field is no longer present,but what are present fieldname.x
and fieldname.y. How can I fix the problem so that I can still call by the
orignal fieldname? If you don't understand my problem, please see
On 05/07/2013 04:33 PM, jpm miao wrote:
Hi,
From time to time I merge two dataframes with possibly a common field.
Then the common field is no longer present,but what are present fieldname.x
and fieldname.y. How can I fix the problem so that I can still call by the
orignal fieldname? If you
Not sure whether this really helps you but at least it works for your sample:
d3 - merge( d1, d2, by = c( a, b ) )
d3
Either d1$a and d2$a are always the same, or they are not.
If they are already the same, you can either omit one of them in the merge:
merge(d1, d2[,-2], by=b)
or you can use a set of columns for your by:
merge(d1,d2, by=c(a,b))
If the a columns are distinct, then at least one of them needs a
On Mon, 6 May 2013, ivo welch wrote:
Dear R experts: I am stumped.I am trying to pick off the mcfadden
R^2 for a probit. simple, me thinks---except my code works only in my
main program, but not in my sub!?I am probably doing something
obviously wrong, but I have stared at my code for
Breakthrough Diet Exposed: Celebrity Doctor Uncovers The Holy Grail of Weight
Loss
http://www.trainingloyalcompanions.com/yrxccw.php
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
(moving to r-help)
Dear all,
I think Paul is raising a useful question here: What is the
recommended workflow for creating a new function?
R prides itself for letting users to create and use home-brewed
functions: it's easy to maintain and re-use, doesn't clutter the
global environment with
This typically occurs because of sloppy manual data entry outside of R. To
relieve further analysis pain, you can manually clean the data (usually only
effective for one-time analyses) or use R to fix problems right after
loading the data (there are multiple methods for doing this... I prefer
On May 7, 2013, at 06:39 , Mark Coletti wrote:
I have a matrix of data that has a corresponding vector of indices. I
would like to use those indices to extract specific matrix elements into a
new vector. In other words, I have an R X C matrix with a corresponding
vector of C elements that
Hi,
I can run the code some days ago . But cant run now.
Problem 1: Output is ok
ensembl = useDataset(hsapiens_gene_ensembl,mart=ensembl)
utr5 = getSequence(chromosome=3, start=185514033, end=185535839,
type=entrezgene,seqType=5utr, mart=ensembl)
Output :
Hi,
Do you permission to write inside /mnt/ephemeral0/mysqltmp/?
Regards,
Pascal
On 05/07/2013 06:41 PM, Mohammad Tanvir Ahamed wrote:
Hi,
I can run the code some days ago . But cant run now.
Problem 1: Output is ok
ensembl = useDataset(hsapiens_gene_ensembl,mart=ensembl)
utr5 =
Dear all,
I have a large vector of durations (in seconds) and I create an histogram as
follows:
hist(durations,breaks=500,xlim=c(0,2000),main=,xlab=Duration
(Seconds),ylab=Frequency (%),prob=TRUE)
Next, I would like to superimpose the exponential distribution with the
maximum likelihood
Dears Tinn-R users,
A new version of the Editor/GUI/IDE Tinn-R (2.4.1.6) was released today.
News at: http://sourceforge.net/p/tinn-r/news/2013/05/tinn-r-2416-released/
The project now has its proper page:
http://nbcgib.uesc.br/lec/software/des/editores/tinn-r/en
Download is available in both:
Hi the list,
I am including some C code in a R program using the .C interface. I want to
deal with NA values, but the result is strange:
--- 8 C code ---
void hein(int *a, int *b, int* c){
*c = (*a + *b);
}
--- 8 ---
--- 8 - R
Hi all,
I am trying to set up logical function(s) to deal with two adjustments
to a blood glucose value.
I have been dinking around in Excel and assume this will be much easier
in R.
DF is date-time, BG value in mg/dL,test strip
4/3/13 19:20105 Aviva-491350
4/4/13 21:0374
On 07-05-2013, at 15:30, cgenolin cgeno...@u-paris10.fr wrote:
Hi the list,
I am including some C code in a R program using the .C interface. I want to
deal with NA values, but the result is strange:
--- 8 C code ---
void hein(int *a, int *b, int* c){
*c = (*a +
Damm... I am reading the WRE, but I am only at page 83. I start to try to
play with NAOK to early.
Anyway, exactly the same function for numeric instead of integer will give
different results:
--- 8 C code ---
void hein2(double *a, double *b, double* c){
*c = (*a + *b);
}
Hello,
See if the following is what you want.
dat -
structure(list(DF = c(4/3/13 19:20, 4/4/13 21:03, 4/6/13 17:40,
4/6/13 17:40, 4/6/13 22:48, 4/6/13 22:48, 4/7/13 5:32,
4/7/13 5:32), BG = c(105L, 74L, 81L, 82L, 106L, 102L, 87L,
103L), test_strip = c(Aviva-491350, Aviva-491350, Aviva-491640,
Try this:
input - read.table(text = date time BG test
+ 4/3/13 19:20105 Aviva-491350
+ 4/4/13 21:0374 Aviva-491350
+ 4/6/13 17:4081 Aviva-491640
+ 4/6/13 17:4082 Aviva-491350
+ 4/6/13 22:48106 Aviva-491640
+ 4/6/13 22:48102 Aviva-491350
+ 4/7/13
Hello,
Try
curve(dexp(x, rate=lambda), add=TRUE)
Hope this helps,
Rui Barradas
Em 07-05-2013 14:18, Manta escreveu:
Dear all,
I have a large vector of durations (in seconds) and I create an histogram as
follows:
hist(durations,breaks=500,xlim=c(0,2000),main=,xlab=Duration
Cant believe it was that
--
View this message in context:
http://r.789695.n4.nabble.com/Superimpose-exponential-density-function-to-histogram-tp4666468p4666480.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org
Hi all,
I am trying to set up logical function(s) to deal with two adjustments
to a blood glucose value.
I have been dinking around in Excel and assume this will be much easier
in R.
DF is date-time, BG value in mg/dL,test strip
4/3/13 19:20105 Aviva-491350
4/4/13 21:0374
Hello
I am having some problems for extracting the residuals from models
working with ordinal multinomial data.
Either working with the polr() function or the plsRglm () function,
the residuals are NULL. I guess this is because the data is
multinomial but I do not know how to solve it.
I have
Hi,
I'm a pgmm (plm) user and would like to know if a orthogonal transformation
is available, as in Stata xtabond2. Can someone help me? Thanks! Kinds
regards,
Eva
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list
Hi,
I am using R 3.0.0 on MacOSX 10.7.5 and I am have problem with visualizing
data in R. When I open a simple plot,
plot (1,1);
http://r.789695.n4.nabble.com/file/n4666461/Screen_Shot_2013-05-07_at_11.06.19.png
I get a rectangular window with the labels stretched (see example). I have
On Tue, May 7, 2013 at 10:02 AM, Neotropical bat risk assessments
neotropical.b...@gmail.com wrote:
Hi all,
I am trying to set up logical function(s) to deal with two adjustments
to a blood glucose value.
I have been dinking around in Excel and assume this will be much easier
in R.
DF is
If the a columns are distinct, then at least one of them needs a new name
in the
merged table, and the simplest option is to rename the columns appropriately
in d1 and
d2 (since they apparently represent different data anyway).
You can also use the 'suffixes. argument to merge to control
Mac OSX-specific questions should be directed to r-sig-mac.
Also, you should search before posting... this has been answered many times. I
recommend search terms R aspect ratio.
---
Jeff NewmillerThe
I think this means an unequal sample in different conditions. But it seems
to mean something else. . .
I have a data set like below
participgroup device width length accep thresh rating
d-rating1 RA Dingo nom nom Y 5 8
31 RA
Hi Jeff,
Thanks - I've received an answer from another forum (It had to do with DPI in
Quartz - rather than a simple aspect ratio).
Gunnar
On 7 May 2013, at 16:43, Jeff Newmiller [via R] wrote:
Mac OSX-specific questions should be directed to r-sig-mac.
Also, you should search before
Dear R-List,
I would like to recode categorial variables into binary data, so that all
values above median are coded 1 and all values below 0, separating each var
into two equally large groups (e.g. good performers = 0 vs. bad performers =1).
I have not succeeded so far in finding a nice
On May 7, 2013, at 8:33 AM, Krysta Chauncey wrote:
I think this means an unequal sample in different conditions. But it seems
to mean something else. . .
I have a data set like below
participgroup device width length accep thresh rating
d-rating1 RA Dingo
On Tue, May 7, 2013 at 11:06 AM, Gabor Grothendieck
ggrothendi...@gmail.com wrote:
On Tue, May 7, 2013 at 10:02 AM, Neotropical bat risk assessments
neotropical.b...@gmail.com wrote:
Hi all,
I am trying to set up logical function(s) to deal with two adjustments
to a blood glucose value.
I
Hello,
First of all, you don't need as.data.frame(cbind(...)). It's much better
to simply do data.frame(...).
As for the conversion, the following function doesn't use randomness but
gets the job done
df - data.frame(snr=c(1,2,3,4,5,6,7,8,9,10),
k1=c(1,1,4,2,3,2,2,5,2,2),
On May 7, 2013, at 9:20 AM, D. Alain wrote:
Dear R-List,
I would like to recode categorial variables into binary data, so that all
values above median are coded 1 and all values below 0, separating each var
into two equally large groups (e.g. good performers = 0 vs. bad performers
Hey All,
I have a dataset(dat1) like this:
ObsNumber ID Weight
1 0001 12
2 0001 13
3 0001 14
4 0002 16
5 0002 17
And another
I want to merge dat1 and dat2 based on ID in order
Have you tried merge(dat1, dat2) ?
If ID is the common column (and no others), then that should be all you
need to join (see ?merge). And then order if needed.
Chris
--
Chris Stubben
Los Alamos National Lab
Bioscience Division
MS M888
First off, stop using cbind() when it is not needed. You will not see the reason
when the columns are all numeric but you will start experiencing pain and puzzlement
when the arguments are of mixed classes. The data.frame function will do what you want.
(Where do people pick up this practice
Hi,
Try this:
dat1- read.table(text=
ObsNumber ID Weight
1 0001 12
2 0001 13
3 0001 14
4 0002 16
5 0002 17
H,
Sorry, a mistake:
dat1$UniqueID-unlist(lapply(split(dat1,dat1$ID),function(x)
with(x,as.character(interaction(ID,seq_len(nrow(x)),sep=_,use.names=FALSE)
dat1
# ObsNumber ID Weight UniqueID
#1 1 0001 12 0001_1
#2 2 0001 13 0001_2
#3 3 0001 14
Yes, I tried, but the order of the IDs in dat1 and dat2 is not exactly the
same, I simplify the data here. So in dat2, it may have records for ID=0002
first then ID=0001, also I have more than two categories under ID col.
On Tue, May 7, 2013 at 10:57 AM, Chris Stubben stub...@lanl.gov wrote:
I would like to fit a period (annual) model in glmm. Here is the script
I do:
# Generate dummy periodic counts with effect of a covariate co
# of course I plan to use this script on my own data !
d - 1:500
co - rnorm(500, 10, 2)
yco - (1+sin(2*pi*(d+100)/365))*10*co/10+co
y - floor(rnorm(500,
Yes, I tried, but the order of the IDs in dat1 and dat2 is not exactly the
same, I simplify the data here. So in dat2, it may have records for ID=0002
first then ID=0001, also I have more than two categories under ID col
I should have looked at the question more closely, sorry. Unique ids in
In each category, the order is the same. Fro example, the first match in
dat2 should return to the first record in dat2
On Tue, May 7, 2013 at 11:31 AM, Chris Stubben stub...@lanl.gov wrote:
Yes, I tried, but the order of the IDs in dat1 and dat2 is not exactly the
same, I simplify the data
On Tue, May 7, 2013 at 4:53 AM, peter dalgaard pda...@gmail.com wrote:
On May 7, 2013, at 06:39 , Mark Coletti wrote:
I have a matrix of data that has a corresponding vector of indices. I
would like to use those indices to extract specific matrix elements into
a
new vector. In other
Thanks A.K. But I have NA in ID column, so when I apply the code, it
gives me error saying the replacement as less rows than the data has.
Anyway for ID=N/A, return sth like N/A_1 in order as well?
On Tue, May 7, 2013 at 11:17 AM, arun smartpink...@yahoo.com wrote:
H,
Sorry, a mistake:
Hi,
Your question is still not clear.
May be this helps:
dat2- read.table(text=
patient_id t scores
1 0 1.6
1 1 2.6
1 2 2.2
1 3 1.8
2
HI Ye,
For the NA in ID column,
Hi
dat1- read.table(text=
ObsNumber ID Weight
1 0001 12
2 0001 13
3 0001 14
4 0002 16
5 0002 17
On May 7, 2013, at 11:52 AM, Mark Coletti wrote:
On Tue, May 7, 2013 at 4:53 AM, peter dalgaard pda...@gmail.com wrote:
On May 7, 2013, at 06:39 , Mark Coletti wrote:
I have a matrix of data that has a corresponding vector of indices. I
would like to use those indices to extract
I want to merge dat1 and dat2 based on ID in order, I know match only
returns the first match it finds. So I am thinking create unique ID col in
dat2 and dat2, then merge.
You can make a new within-group sequence number with ave():
dat1- read.table(text=
ObsNumber ID Weight
1
Hi,
Try this:
dat1- read.table(text=
ObsNumber ID Weight
1 0001 12
2 0001 13
3 0001 14
4 0002 16
5 0002 17
6
Jim,
Thanks for your comments.
KW
--
On May 6, 2013, at 5:48 PM, Jim Lemon j...@bitwrit.com.au wrote:
see inline
On 05/07/2013 02:14 AM, Keith S Weintraub wrote:
Folks,
I have been working on an R project that has a few dozen functions.
I have some questions that are only
Hi Vivek,
May be this helps:
set.seed(35)
dat1- cbind(ID=1:8,
as.data.frame(matrix(sample(1:50,8*7,replace=TRUE),ncol=7)))
set.seed(38)
dat2- cbind(ID= sample(1:20,8,replace=FALSE),
as.data.frame(matrix(sample(1:50,8*33,replace=TRUE),ncol=33)))
colnames(dat2)[-1]-gsub(V,X,colnames(dat2)[-1])
Hi all,
I want to transform a dCgMatrix from package Matrix into a matrix.csr from
package SparseM, and I found out this link :
http://stat.ethz.ch/R-manual/R-devel/library/Matrix/html/SparseM-conv.html
But there's no informaion about usage/description/arguments, so how do I
use this
HI Arun,
My data sets are as in the provided files. I am providing the sample files.
I guess this will give a better idea to the type of working I want to do
with the two files and the kind or script am trying to write. Hope you can
give me some suggestions regarding this. I am new to R so having
HI,
Assuming that out_dat.txt is the output you expected.
dat1- read.table(data1.txt,header=TRUE,stringsAsFactors=FALSE)
dat2- read.table(data2.txt,header=TRUE,stringsAsFactors=FALSE)
out_dat- read.table(out_data.txt,header=TRUE,stringsAsFactors=FALSE)
out_dat2-merge(dat1[,1:4],dat2,by=ID)
I have a big data set that includes character variables of many different
values. I'm trying to use ff to read the data and then use biglm.big.matrix
to build linear models. However, since big.matrix will convert all
character vectors to factors and the character labels will be lost. I
decided to
I have a big data set that includes character variables of many different
values. I'm trying to read the data as big.matrix and then use
biglm.big.matrix to build linear models. However, since big.matrix will
convert all character vectors to factors and the character labels will be
lost, I
Hi,
I have a vector f with some negative columns. I remember that there is
an easy expression that can find out negative items. Can someone tell me
how I can do it?
It seems to be
f[i such that f[i]0 ...]
Thanks,
Miao
d-1:7
f-(-2)^d
f
[1] -24 -8 16 -32 64 -128
Hi,
The solution can be easily found on Internet.
By the way, the following does what you are looking for:
f[f0]
Regards,
Pascal
On 05/08/2013 10:54 AM, jpm miao wrote:
Hi,
I have a vector f with some negative columns. I remember that there is
an easy expression that can find out
f [ f 0 ]
On Wed, May 8, 2013 at 11:54 AM, jpm miao miao...@gmail.com wrote:
Hi,
I have a vector f with some negative columns. I remember that there is
an easy expression that can find out negative items. Can someone tell me
how I can do it?
It seems to be
f[i such that f[i]0
Hello All,
Does anyone know if theres a function for computing 1-sided confidence
intervals for bootstrapped statistics (mean, median, percentiles,
etc.)? Thanks
in advance
Janh
[[alternative HTML version deleted]]
__
R-help@r-project.org
Hello,
You already asked that question on May 7, 2013. And David Winsemius
already responded to you:
https://stat.ethz.ch/pipermail/r-help/2013-May/353044.html
Regards,
Pascal
On 05/08/2013 12:21 PM, Janh Anni wrote:
Hello All,
Does anyone know if there’s a function for computing 1-sided
Dear All,
I have put together a simple web service that notifies you about new and
updated R packages and/or if CRAN package checks fail for your packages. It
is all done via RSS feeds and there is a short description at
http://cranky.igraph.org
The feeds are dynamically created, so you don't
Is there a function in R that calculate the mean and median for a grouped
data?
For example, a survey shows the oil price outlook in the future. How can I
calculate the mean/median?
(Of course, I understand that the groups below 80 and above 110 must be
defined more specifically)
below 80 4
Hi, dear all,
I wish to get one sample (2500-d vector) from the truncated multivariate
normal distribution, so I choose use the R function rtmvnorm() to do this.
But the error information shows that for this function, the dimension should
be lower than 1000,
So could you help me to find out if
Hi there, I am reading into R a dataset with 30 variables. It is in csv file
format but have also tried txt. While my dataset loads without warning, when
I tried to use Geomorph package (my dataset is from a 3D model) I get a
warning that is.atomic(x) is not true. I understand this is a broad
On May 7, 2013, at 8:37 PM, Pascal Oettli wrote:
Hello,
You already asked that question on May 7, 2013. And David Winsemius already
responded to you:
https://stat.ethz.ch/pipermail/r-help/2013-May/353044.html
Indeed. My response was intended drive the poster to the code, and then failing
On May 7, 2013, at 8:40 PM, jpm miao wrote:
Is there a function in R that calculate the mean and median for a grouped
data?
For example, a survey shows the oil price outlook in the future. How can I
calculate the mean/median?
(Of course, I understand that the groups below 80 and above 110
On May 7, 2013, at 8:38 PM, Alannah wrote (from Nabble):
Hi there, I am reading into R a dataset with 30 variables. It is in csv file
format but have also tried txt. While my dataset loads without warning, when
I tried to use Geomorph package (my dataset is from a 3D model) I get a
warning
This is an imponderable question, since we would have to be psychic to know
what you are doing wrong without seeing what you are actually doing.
I can hypothesize that you are testing whether a data frame is numeric, and can
warn you that a data frame will NEVER be numeric. The individual
Hi Janh,
I do not believe that a one sided or two sided bootstrap makes any
sense. It is just a resampling procedure that constructs an empirical
distribution. If you wish to examine the point where 5% of the
distribution falls in one tail instead of the ends of both tails being 5%,
you could
On 05/08/2013 01:38 PM, Alannah wrote:
Hi there, I am reading into R a dataset with 30 variables. It is in csv file
format but have also tried txt. While my dataset loads without warning, when
I tried to use Geomorph package (my dataset is from a 3D model) I get a
warning that is.atomic(x) is
Hi!
I am trying to calculate HPD for the coeficients of regression models
fitted with lm or lmrob in R, pretty much in the same way that can be
accomplished by the association of mcmcsamp and HPDinterval functions for
multilevel models fitted with lmer. Can anyone point me in the right
direction
74 matches
Mail list logo