[R] ddply error

2010-07-28 Thread jd6688
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:

[R] error: arguments imply differing number

2010-07-28 Thread jd6688
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

[R] columns mapping

2010-07-28 Thread jd6688
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

Re: [R] columns mapping

2010-07-28 Thread jd6688
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

[R] re-sampling of large sacle data

2010-07-27 Thread jd6688
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

Re: [R] re-sampling of large sacle data

2010-07-27 Thread jd6688
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 (i1){ pos_neg_pool-rbind(pos_neg_pool,pos_neg_tem) }else{ pos_neg_pool- pos_neg_tem }} -- View this

Re: [R] re-sampling of large sacle data

2010-07-27 Thread jd6688
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

[R] Column mapping

2010-07-27 Thread jd6688
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:

[R] gapped sequence data summary

2010-07-26 Thread jd6688
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

[R] data arranged by p-values

2010-07-25 Thread jd6688
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

[R] p-values calculation

2010-07-25 Thread jd6688
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

[R] p-VALUE calculation

2010-07-22 Thread jd6688
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

Re: [R] choosing a random sample by precentage

2010-07-22 Thread jd6688
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:

[R] Permutation test

2010-07-22 Thread jd6688
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:

[R] MISSING VALUE IN R

2010-07-22 Thread jd6688
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

[R] na.rm=TRUE

2010-07-22 Thread jd6688
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

[R] Filtering in R

2010-07-22 Thread jd6688
The dataframe is id salary 100500 101600 102700 103800 how can i generate a subsets if salary600? -- View this message in context: http://r.789695.n4.nabble.com/Filtering-in-R-tp2299603p2299603.html Sent from the R help mailing list

[R] invalid type error

2010-07-19 Thread jd6688
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 0.3 0.4

[R] rows process in DF

2010-07-14 Thread jd6688
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

[R] cbind in for loops

2010-07-12 Thread jd6688
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.

[R] boxplot on all the columns

2010-07-12 Thread jd6688
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

[R] String truncate

2010-07-09 Thread jd6688
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

Re: [R] String truncate

2010-07-09 Thread jd6688
Thanks this works On Fri, Jul 9, 2010 at 4:32 PM, Wu Gong [via R] ml-node+2284062-824667456-312...@n4.nabble.comml-node%2b2284062-824667456-312...@n4.nabble.com wrote: Do you mean substring? sub(.txt,, mytest.txt) A R learner. -- View message @

Re: [R] String truncate

2010-07-09 Thread jd6688
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

[R] how to process this in R

2010-07-07 Thread jd6688
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.

[R] Batch files process and String parsing

2010-07-07 Thread jd6688
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

Re: [R] how to define a function in R

2010-07-07 Thread jd6688
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 On Tue, Jul 6, 2010 at 3:48 PM, jd6688

Re: [R] how to define a function in R

2010-07-07 Thread jd6688
%2b2280308-38709657-312...@n4.nabble.com wrote: -Original Message- From: [hidden email]http://user/SendEmail.jtp?type=nodenode=2280308i=0[mailto: r-help-boun...@r- project.org] On Behalf Of jd6688 Sent: Tuesday, July 06, 2010 3:49 PM To: [hidden email]http://user/SendEmail.jtp?type

[R] how to define a function in R

2010-07-06 Thread jd6688
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

Re: [R] how to define a function in R

2010-07-06 Thread jd6688
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/SendEmail.jtp?type=nodenode=2280373i=0 wrote: 1