1. how to write a R script?
2.How to write a SAS like macro/generic process to process multiple files by
using the same funstion in R?
Thanks in advance
--
View this message in context:
http://r.789695.n4.nabble.com/how-to-define-a-function-in-R-tp2280290p2280290.html
Sent from the R help maili
gmail use basic text format instead of html, code is sent
> poorly, so you can trundle off here to see the example, if you like.
>
> http://gist.github.com/466164
>
> Cheers,
>
> Josh
>
> On Tue, Jul 6, 2010 at 3:48 PM, jd6688 <[hidden
> email]<http://user/SendE
Here are what i am going to accomplish:
I have 400 files named as xxx.txt. the content of the file looks like the
following:
namecount
1. aaa 100
2. bbb2000
3. ccc300
4. ddd 3000
more that 1000 rows in each files.
these are the areas i need help:
1. ho
Here are what i am going to accomplish:
I have 400 files named as xxx.txt. the content of the file looks like the
following:
namecount
1. aaa 100
2. bbb2000
3. ccc300
4. ddd 3000
more that 1000 rows in each files.
these are the areas i need help:
1. how can i on
. I tried to explicitly name all the
> arguments in any functions I used.
>
> When I make gmail use basic text format instead of html, code is sent
> poorly, so you can trundle off here to see the example, if you like.
>
> http://gist.github.com/466164
>
> Cheers,
>
> Josh
com
> wrote:
> > -Original Message-
> > From: [hidden
> > email]<http://user/SendEmail.jtp?type=node&node=2280308&i=0>[mailto:
> r-help-boun...@r-
> > project.org] On Behalf Of jd6688
> > Sent: Tuesday, July 06, 2010 3:49 PM
> > To:
one string named as: mytest.txt
how can I remove the .txt and return the mytest only.
i tried split substr, and grep didn't work it out,
Thanks so lot
--
View this message in context:
http://r.789695.n4.nabble.com/String-truncate-tp2284045p2284045.html
Sent from the R help mailing list archi
Thanks this works
On Fri, Jul 9, 2010 at 4:32 PM, Wu Gong [via R] <
ml-node+2284062-824667456-312...@n4.nabble.com
> wrote:
> Do you mean substring?
>
> sub(".txt","", "mytest.txt")
> A R learner.
>
>
> --
> View message @
> http://r.789695.n4.nabble.com/String-trunc
Thanks so lot
--
View this message in context:
http://r.789695.n4.nabble.com/String-truncate-tp2284045p2284069.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-h
I have 30 files in the current directories, i would like to perform the
cbind(fil1,file2,file3,file4file30)
how could i do this in a for loop:
such as:
file2 <- list.files(pattern=".out3$")
for (j in file2) {
cbind(j)...how to implement cbind here
}
Thanks.
how to use boxplot on all the columns from he date frame instead of manually
entering the columns like below
bhtest1 <- read.table("bhtest1.txt", header=TRUE)
boxplot (bhtest1[,2], bhtest1[,3], bhtest1[, 4], bhtest1[,5], bhtest1[,6],
bhtest1[,7])
please help, Thanks,
--
View this mes
I have the following datasets:
id d1 d2 d3 d4 d5 d6 d7 d8
1 100 0.3 0.4 -0.2 -0.3 0.5 0.6 -0.9 -0.8
2 101 0.3 0.4 0.5 0.6 -0.2 -0.4 -0.5 -0.6
what I am trying to accomplish:
loop through the rows && do the following:
if the values from the columns of the current row >0
>myDF =
data.frame(id=c("A10","A20"),d1=c(.3,.3),d2=c(.4,.4),d3=c(-.2,.5),d4=c(-.3,.6),d5=c(.5,-.2),d6=c(.6,-.4),d7=c(-.9,-.5),d8=c(-.8,-.6))
>doit=function(x)c(x[1],sum_LK_positive=sum(x[-1][x[-1]>0]),sum_LK_negative=sum(x[-1][x[-1]<0]))
> myDF
id d1 d2 d3 d4 d5 d6 d7 d8
1 A10
Here is my dataframe with 1000 rows:
employee_id weigth p-value
100 150
101 200
102 300
103 180
.
My question:
how can I calculate the p-value in R for each employee? the
distributio
Hi Joshua:
how to do a permutation test on the following sample with the sample size in
2 :
idweight P VALUE
100 100
101 200
102 200
103 150
...
Thanks
--
View this message in context:
http://r.789695.n4.nabble.com/choosing-a-random-sample-by-pr
I have a sample in size of 2 rows, for instanse:
idweightp value
100 125
101160
102 150
,
how can I calculate the p value after the permutation and how the
permutation test cab be done?
Thanks,
--
View this message in context:
http://r.789695.n4.nabble.com/Permut
I have a DF
ID VALUE
100 120
101 100
102 100
103
104
105
when i calculate the sum of the values, it returned NA. should I populate
the blank value as 0?
Thanks,
--
View this message in context:
http://r.789695.n4.nabble.com/MISSING-VALUE-IN-R-tp2299586p2299586.html
Sent from
POS=sum(x[-1][x[-1]>0],na.rm=TRUE)
is this the correct syntax?
--
View this message in context:
http://r.789695.n4.nabble.com/na-rm-TRUE-tp2299596p2299596.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing li
The dataframe is
id salary
100500
101600
102700
103800
how can i generate a subsets if salary>600?
--
View this message in context:
http://r.789695.n4.nabble.com/Filtering-in-R-tp2299603p2299603.html
Sent from the R help mailing list arc
Id cat1locationitem_values p-valuessequence
a1111 3002737 0.196504377 0.011
a1121 3017821 0.196504377 0.052
a1131 3027730 0.196504377 0.023
a1141 3036220 0.196504377 0.04
Id cat1locationitem_values p-valuessequence
a1111 3002737 0.196504377 0.011
a1121 3017821 0.196504377 0.052
a1131 3027730 0.196504377 0.023
a1141 3036220 0.196504377 0.044
a1151 3053984 0
Id cat1 location item_values p-values sequence
a111 1 3002737 100 0.01 1
a112 1 3017821 102 0.05 2
a113 2 3027730 103 0.02 3
a114 2 3036220 104 0.04 4
a115 1 3053984 105 0.03 5
a
myDF:
d1 d2 d3 d4
d5
-0.1669103510.022304377 -0.00825924 0.008330689 -0.000925938
-0.1669103510.022304377 -0.00825924 0.008330689 -0.000925938
-0.1669103510.022304377 -0.00825924 0.0
I am trying to do the following to accomplish the tasks, can anybody to
simplify the solutions.
Thanks,
for (i in 1:1){
d<-apply(s,2,sample)
pos_neg_tem<-t(apply(d,1,doit))
if (i>1){
pos_neg_pool<-rbind(pos_neg_pool,pos_neg_tem)
}else{
pos_neg_pool<- pos_neg_tem
}}
--
View
d <- apply(s, 2, sample, size = 1*nrow(s), replace = TRUE)
why the code above return the following error
Error: cannot allocate vector of size 218.8 Mb
--
View this message in context:
http://r.789695.n4.nabble.com/re-sampling-of-large-sacle-data-tp2304165p2304413.html
Sent from the R he
DF1
nameOTHER
ABC O
KKK O
QQQ O
DDD O
PPP O
DF2
name
ABC
KKK
DDD
If the names in df1 mapped the names in df2, then add the mapped name to df1
as a separate column, for instance "mappedColumn"
how to implement this? Thanks
--
View this message in context:
http
ddply(z, .(groupId,location),function(d)with(d,
c(startLoc=Pos[1],endLoc=Pos[length(Pos)],
peakValue=max(sumoo),other=map[1])))
startLoc=Pos[1],endLoc=Pos[length(Pos)], peakValue=max(sumoo),numeric
value
other=map[1]===charactor value
as a result:
c(startLoc=Pos[1],endLoc=Pos[length(Pos)]
mydata <- read.table(textConnection("
Id cat1 location item_values p-values sequence
a111 1 3002737 100 0.01 1
a112 1 3017821 102 0.05 2
a113 2 3027730 103 0.02 3
a114 2 3036220 104 0.04 4
a115 1 3053984
DF1
name OTHER
ABC O
KKK O
QQQ O
DDD O
PPP O
DF2
name
ABC
KKK
DDD
If the names in df1 resides in df2, then add the mapped name to df1 as a
separate column, for instance "mappedColumn"
the output should be:
DF1
name OTHER mappedColumn
ABCOABC
KKKO KKK
QQQ
Thank you so much. it worked as expected.
you have been great help
--
View this message in context:
http://r.789695.n4.nabble.com/columns-mapping-tp2305213p2305401.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org m
30 matches
Mail list logo