Hello everyone
I am relatively new to R and wanted some help on creating adjacency matrix
I have a dataset as given below and wanted to create an adjacency matrix in
R. For creating an adjacency matrix, the matrix should be a square matrix.
I tried creating a matrix directly, but it would not be
On Jun 14, 2013, at 7:18, jpm miao wrote:
> Hi,
>
> I try to build a toy package by running the following codes in an R
> program
>
> require(stats)
> f <- function(x,y) x+y
> g <- function(x,y) x-y
> d <- data.frame(a=1, b=2)
> e <- rnorm(1000)
> package.skeleton(list=c("f","g","d","e"), na
hi r users:
I have a datadset and want to write into a file .
when i use :
write.table(u_bar, file = "u_test.txt")
the data in the outpuf file is shown as below which included the
row number from "1" to "14" and colname .e.g."X32N"
How could I output the numbers and excluded the colname and ro
how about reading the help file on 'write.table' and look at row.names and
col.names.
Sent from my iPad
On Jun 14, 2013, at 3:27, Jie Tang wrote:
> hi r users:
> I have a datadset and want to write into a file .
>
> when i use :
> write.table(u_bar, file = "u_test.txt")
>
> the data in the
Hello,
As for Inf, the mean value of Inf and anything is Inf, so there's no way
to solve it. As for NaN, you can set them to NA prior to calling the
function.
That leaves us with NA handling. forecast::ma handles NAs, it propagates
them, as it should. An alternative function using filter() lik
Hello,
Suppose, I have P = 100 genes variables and each consists of n = 50 values.
Now I want to Bootstrap (With Replacement) 50 times and 100 iterations.
I want P in columns and Bootstrap iterations in Rows.
Also, when genes are selected in Bootstrap (WR) give it value "1", if not
selected "0".
Hello everyone ,
I am facing a simple problem , I trying to add functionality in one of R
package .
I want a profiling library to link to R package so that when R package is
used the profiling out put comes automatically with that.
Problem is that I am not able to link it with the package , I trie
Dear all,
I have different data frames for which I would like to modify names of each
column such that the new name would include the name of the first column
added to the name of other columns; I came up with the following code.
Nothing changes when I run the following code. I would be grateful i
HI,
May be this helps:
dat1<- read.table(text="
Col1 Col2 Weight
A D 0.1
B C 0.4
C M 0.6
D P 0.8
E W 1
F D 1.2
G C 3.1
H M 4
",sep="",header=TRUE,stringsAsFactors=FALSE)
vec1<- c(unique(dat1[,1]),unique(dat1[,2]))
datNew<- expand.grid(vec1,vec1)
colnames(datNew)<- colnames(dat1)
On 13-06-14 3:47 AM, Gaurav Sehrawat wrote:
Hello everyone ,
I am facing a simple problem , I trying to add functionality in one of R
package .
I want a profiling library to link to R package so that when R package is
used the profiling out put comes automatically with that.
Problem is that I am
Hi,
rename_columns<- function(dat){
for(i in 2:(ncol(dat))){
names(dat)[i]<- paste(names(dat)[1],names(dat)[i],sep="_")
}
dat
}
dat1<- read.table(text="
chr pos ref alt
chr1 5 A G
chr1 8 T C
chr2 2 C T
",sep="",header=TRUE,stringsAsFactors=FALSE
On Fri, Jun 14, 2013 at 10:01 AM, arun wrote:
> Hi,
> rename_columns<- function(dat){
> for(i in 2:(ncol(dat))){
> names(dat)[i]<- paste(names(dat)[1],names(dat)[i],sep="_")
>
> }
> dat
> }
Or even better, get rid of the unnecessary loop:
rename_columns <- function(DF) {
names(DF
Dear R forum,
I have a data frame
dat = data.frame(
ABC = c(25.28000732,48.33857234,19.8013245,10.68361461),
DEF = c(14.02722251,10.57985168,11.81890316,21.40171514),
GHI = c(1,1,1,1),
JKL = c(45.96423231,44.52986236,16.56514176,32.14545122),
MNO = c(45.38438063,15.54338206,18.78444777,24.29486
Thanks all!
On Fri, Jun 14, 2013 at 6:40 PM, Rainer Schuermann <
rainer.schuerm...@gmx.net> wrote:
> df1 <- data.frame( A = runif( 10 ), B = runif( 10 ) * 5, C = runif( 10 ) *
> 10, D = runif( 10 ) * 20 )
> df2 <- data.frame( X = runif( 10 ), Y = runif( 10 ) * 5, Z = runif( 10 ) *
> 10 )
> renam
HI,
Try:
dat1<-dat[sapply(dat,function(x) length(unique(x)))>1]
cor(dat1)
# ABC DEF JKL MNO
#ABC 1.000 -0.75600764 0.55245223 -0.2735585
#DEF -0.7560076 1. -0.06479082 0.2020781
#JKL 0.5524522 -0.06479082 1. 0.4564568
#MNO -0.2735585 0.2
Probably, this also works:
dat2<-dat[,(colSums(dat)/dat[1,])!=nrow(dat)]
cor(dat2)
dat$NewCol<-5
dat3<-dat[,(colSums(dat)/dat[1,])!=nrow(dat)]
cor(dat3)
# ABC DEF JKL MNO
#ABC 1.000 -0.75600764 0.55245223 -0.2735585
#DEF -0.7560076 1. -0.06479082
df1 <- data.frame( A = runif( 10 ), B = runif( 10 ) * 5, C = runif( 10 ) * 10,
D = runif( 10 ) * 20 )
df2 <- data.frame( X = runif( 10 ), Y = runif( 10 ) * 5, Z = runif( 10 ) * 10 )
rename_columns <- function( dataset )
{
for( i in 2:ncol( dataset ) )
colnames( dataset )[i]
I would typically use rle() for this kind of thing:
> tmp <- cumsum(rle(id)$lengths)
> c(1, tmp[-length(tmp)]+1)
[1] 1 4 9
It does assume that all rows for each unique value of id are grouped
together, but does not require that the rows be sorted by id.
-Don
--
Don MacQueen
Lawrence Livermor
On Jun 14, 2013, at 7:03 AM, Katherine Gobin wrote:
> Dear R forum,
>
> I have a data frame
>
>
> dat = data.frame(
> ABC = c(25.28000732,48.33857234,19.8013245,10.68361461),
> DEF = c(14.02722251,10.57985168,11.81890316,21.40171514),
> GHI = c(1,1,1,1),
> JKL = c(45.96423231,44.52986236,16.5
On Jun 14, 2013, at 6:34 AM, Arman Eshaghi wrote:
> Dear all,
>
> I have different data frames for which I would like to modify names of each
> column such that the new name would include the name of the first column
> added to the name of other columns; I came up with the following code.
> Noth
I have posted the question on stackoverflow but no satisfied there.
Here is the Link :
http://stackoverflow.com/questions/17049966/how-to-include-a-shared-library-so-or-library-in-a-r-package
Thanks
On Fri, Jun 14, 2013 at 7:15 PM, Duncan Murdoch wrote:
> On 13-06-14 3:47 AM, Gaurav Sehrawat wr
I am new in using R. I want to know all about building decision tree model
in R.
Few options which I searched are rpart and rattle to build a decision
tree.Both the functions are giving me splits which are statistically
appropriate.
But I am not able to figure out how to change those splits as p
All:
Recently my R session freezes when I try to open a file or save a new script
after I have run existing scripts. The session freezes so that I can no longer
click on any windows within the R session -- including other scripts that are
open or the R console. (I hear the "ding" sound when
It would probably help if you posted your sessionInfo()
Just before everything freezes issue the command
sessionInfor()
copy the output and paste it into an email.
John Kane
Kingston ON Canada
> -Original Message-
> From: anferg...@aol.com
> Sent: Fri, 14 Jun 2013 10:52:03 -0400 (EDT
Dear R users, I'm trying to get the 'Digitize' package but it has been removed
from the CRAN repository. I tried to download the .tar.gz file from the archive
but I haven't been able to install it. Anyone has a clue on how I could proceed
to access this package? Thanks Jean-Michel Fortin Univers
You need to do some reading, both about decision trees and R!
What you need to do for R is to use cut() on Age (?cut) to create a
new categorical variable, ageCat, say, and then use that in your tree
building instead of Age.
Cheers,
Bert
On Fri, Jun 14, 2013 at 7:24 AM, Neelesh Gupta wrote:
> I
You can check the archive section of your CRAN mirror to see if there are
older versions of the package there that may work for you.
An alternative approach if you have a graphics file of a plot that you want
to extract the data from by clicking on the points (ignore the rest of this
if I am misre
Dear guRus
Can I use R inside Microsoft access Macros and programmes? I understand
that R-Excel is compatible but wish to know if I can use R inside Access
programmes please?
Many thanks
Raghu
[[alternative HTML version deleted]]
__
R-help@r-p
On Jun 14, 2013, at 10:04 AM, Raghuraman Ramachandran wrote:
> Dear guRus
>
> Can I use R inside Microsoft access Macros and programmes? I understand
> that R-Excel is compatible but wish to know if I can use R inside Access
> programmes please?
>
RExcel has a separate mailing list. You should
You will probably need to read the Posting Guide and follow its recommendations
to get a constructive response. Things like posting in text instead of HTML and
providing the output of sessionInfo go a long way toward speeding up the
troubleshooting process.
You can also begin the process of ide
Hrm, thanks. The uncertainties are what they are, though (and the
model is what it is, too) -- is there an alternative to modifying
them? Maybe another type of analysis that handles upper limits?
Kyle
On Thu, Jun 13, 2013 at 5:46 AM, Andrews, Chris wrote:
> It seems a line through the origin d
Hello,
I am trying to add a summary generated by summary () to a plot.The output of
the summary is an object of class (summaryDefault,table)
When I try to add it with addtable2plot (x="topright",sum_1)
I get an error:Error in dim(table) : 'table' is missing
Here is some info about sum_1:> print
For the record:
...
>
> A bit of commentary: Something did happen. It's just that you didn't do
> anything with _what_ happened. The copy of the 'dataset'-object got modified
> but you never returned it from the function, and and also didn't reassign it
> to the original 'dataset'
Hi,
I changed the fun1(). Now, it should be possible to get all the possible
combinations within each group.
final3New<-read.table(file="real_data_cecilia.txt",sep="\t",header=T)
final3New1<-read.csv("real_data_cecilia_new.csv")
fun1New<- function(dat,percent,number){
lst1<- split(dat,list(
Hello,
I have a matrix m and I want to know how often does 1 (or !0) simultanously
appear in A and REF, B and REF, C and REF.
So actually I wish to automate following expression:
> length (which (m[,1]!=0&m[,4]!=0))
[1] 2
> length (which (m[,2]!=0&m[,4]!=0))
[1] 1
Thanks
Hermann
> m
A B C
I have a question regarding significance testing for the difference in the
ratio of means.
The data consists of a control and a test group, each with and without
treatment. I am interested in testing if the treatment has a significantly
different effect (say, in terms of fold-activation) on the te
Hi,
sapply(colnames(m)[-ncol(m)],function(i) {x1<-cbind(m[,i],m[,ncol(m)]);
length(which(x1[,1]!=0 & x1[,2]!=0))})
#A B C
#2 1 2
A.K.
- Original Message -
From: Hermann Norpois
To: r-help
Cc:
Sent: Friday, June 14, 2013 3:51 PM
Subject: [R] combination of columns in a matrix
Hello
Sigh...
(Again!) These are primarily statistical, not R, issues. I would urge
that you seek local statistical help. You appear to be approaching
this with a good deal of semi-informed adhoc-ery. Standard methodology
should be applicable, but it would be presumptuous and ill-advised of
me to offer
On Jun 14, 2013, at 1:25 PM, Bert Gunter wrote:
> For the record:
>
> ...
>
>
>>
>> A bit of commentary: Something did happen. It's just that you didn't do
>> anything with _what_ happened. The copy of the 'dataset'-object got modified
>> but you never returned it from the funct
I am using xtable version 1.7-1 built for R 3.0.1 on:
R version 3.0.1 (2013-05-16)
Platform: i686-pc-linux-gnu (32-bit)
Sometimes, not every time, when I load xtable or attempt to load the
help, I get an error such as this "Error: cannot allocate vector of
size 1.9 Gb" (Stacktrace from recover()
My apologies if my request is off topic and for my admittedly
half-baked understanding of the topic. I'm afraid trying to talk with
the "local statistical help", and trying to post on several general
statistical forums to look for proper guidance has not yielded any
response much less any helpful
The fact that your currents are apparently intrinsically positive and
the variance increases with current plus the fact that you are
interested in ratio statistics suggests that your data would benefit
from an initial log transform of the data. All of your issues would
then disappear, given tha
Hi,
I need to check whether certain digits of a number, say, last five digits,
appear in a column of a data frame. For instance,
For example,103 in "000103" ( data [data[,3] == "...103"] instead of
data [data[,3] == "000103"] ) or 54780 in "12354780". Can someone let me
know how to do so.
Thank
On Jun 14, 2013, at 9:33 PM, Yasin Gocgun wrote:
> Hi,
>
> I need to check whether certain digits of a number, say, last five digits,
> appear in a column of a data frame. For instance,
>
> For example,103 in "000103" ( data [data[,3] == "...103"] instead of
> data [data[,3] == "000103"] ) or
Try
?grep
or
library( stringr )
?str_detect
On Saturday 15 June 2013 00:33:31 Yasin Gocgun wrote:
> Hi,
>
> I need to check whether certain digits of a number, say, last five digits,
> appear in a column of a data frame. For instance,
>
> For example,103 in "000103" ( data [data[,3] == "...
45 matches
Mail list logo