[R] evaluation of equations from Ryacas

2013-06-18 Thread Erin Hodgess
Hello again. Now I have the following: > xx [1] "Solve(1 - R/100==(2*y)/1,R)" > yacas(xx) expression(list(R == 100 * (1 - 2 * y/1))) > I would like to put in a value for y and obtain R. I've tried more stuff with eval and Eval, but no luck yet. Any suggestions would be much appreciated.

Re: [R] solving equations symbolically

2013-06-18 Thread Erin Hodgess
Solved: it's in the Ryacas vignette: > yacas("Solve(1-(R/100) == (2*y)/1,R)") expression(list(R == 100 * (1 - 2 * y/1))) > On Tue, Jun 18, 2013 at 11:33 PM, Erin Hodgess wrote: > Dear R People: > > I have the following equation: > $1 - \frac{R}{100} = \frac{2y}{1}$ > and I was wond

[R] solving equations symbolically

2013-06-18 Thread Erin Hodgess
Dear R People: I have the following equation: $1 - \frac{R}{100} = \frac{2y}{1}$ and I was wondering if there was a way in R to solve for R (no pun intended). I'm experimenting with Ryacas, but nothing yet. Version R-3.0.1 on Windows 7. Thanks, Erin -- Erin Hodgess Associate Professor De

Re: [R] Spectrum decomposition

2013-06-18 Thread Bert Gunter
1. Have you googled or binged? 2. Have you tried R Task Views: http://cran.r-project.org/web/views/ (esp. the TimeSeries one) ? No guarantees, of course. -- Bert On Tue, Jun 18, 2013 at 4:08 PM, Jessica Inskip wrote: > Hi, > > I am currently performing heart rate variability analyses on beat-t

Re: [R] install a package made using bioconductor package pdInfoBuilder

2013-06-18 Thread Martin Morgan
On 06/18/2013 04:06 PM, Johnson, Franklin Theodore wrote: Dear maintainer, I used bioconductor package, pdInfoBuilder, to make a microarray platform annotation package. I named this package, pd.pdinfo.gpl11164.ndf.txt. This "self-made package" is to be used with oligo package. Please ask q

Re: [R] data selection

2013-06-18 Thread arun
Hi, May be this helps: set.seed(24) B101<- data.frame(SID=sample(400:450,20,replace=FALSE),zGRADE=sample(0:10,20,replace=TRUE),col3=rnorm(20)) set.seed(28) B2A<- data.frame(SID=sample(400:600,50,replace=FALSE),zGRADE=sample(0:10,50,replace=TRUE),col3=rnorm(50)) set.seed(35) B2B<- data.frame(SID=

[R] Spectrum decomposition

2013-06-18 Thread Jessica Inskip
Hi, I am currently performing heart rate variability analyses on beat-to-beat heart rate data using a non-parametric approach (AR power spectral density). I am interested in decomposing a AR-spectrum into its components (main outcomes of interest are the centre frequency and the power of the bell-

[R] install a package made using bioconductor package pdInfoBuilder

2013-06-18 Thread Johnson, Franklin Theodore
Dear maintainer, I used bioconductor package, pdInfoBuilder, to make a microarray platform annotation package. I named this package, pd.pdinfo.gpl11164.ndf.txt. This "self-made package" is to be used with oligo package. Prior to using oligo package, I need to install the annotation package

[R] data selection

2013-06-18 Thread Robert Lynch
I have two different data frames ( actually a set of data frames for each class and one master one into which i want pull some data from each of the frame in the set) one is all students that have taken a course so the set of data frames is B101 B2A B2B B2C etc. . . and each one has lots of da

[R] deSolve question

2013-06-18 Thread Andras Farkas
Dear All wonder if you could provide some insights on the following: currently I have this code which produces the expected results: require(deSolve) pars <- list(k = 0.08,v=15) intimes <- c(0,0.5,12) input <- c(800,0,0) forc <- approxfun(intimes, input, method="constant", rule=2) derivs <-

[R] Automation using R2WinBUGS

2013-06-18 Thread Anamika Chaudhuri
Hi All: I am running R2WinBUGS so that I could automate the running of my Multivariate Logit Normal model on 300 simulated datasets. The problem I have is I am not able to read in the data correctly and then code it in the automation part. *Heres my model:* model { for (j in 1 : Nf) { p1[j, 1:

Re: [R] hist function in a for loop

2013-06-18 Thread Dzu
Dear, I want to do the following : #I have created a huge csv.files with 44 colums #I want to select the specific colums from these files #CL1 consist data from which I want to compute the histogramms, CL2 is the cloumn which has numbers that identifies know from which line my second histogram d

[R] Retrieving Labels from vars/cols

2013-06-18 Thread Lívio Cipriano
Hi, How can I read/retrieve the Labels strings of the $variables.label proprety of a data Frame? Regards Lívio Cipriano __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-pr

Re: [R] hist function in a for loop

2013-06-18 Thread Dzu
Hello Thanks for reply I want to compute several histograms in a for loop.I am trying to set the binsize constant in the beginning. #compute the histograms for (i in 1:12) { binsize <- -20 :20/2 hist(singlefile$GVC(singlefile$new_id[,i], freq = FALSE,xlab ="Graph i", col = "pink",

[R] Retrieving Labels from vars/cols

2013-06-18 Thread Lívio Cipriano
Hi, How can I read/retrieve the Labels strings of the $variables.label proprety of a data Frame? Regards Lívio Cipriano __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-pr

Re: [R] Failure to install RSer

2013-06-18 Thread Gene Leynes
Yes, the bioconductor packages do not install through CRAN. Now that I'm remembering it, some (maybe all) of the other packages were installed by dev_tools from github. I don't know why I was getting that "unable to move temporary installation" error for Rserve and RCurl, but today it went away a

Re: [R] find closest value in a vector based on another vector values

2013-06-18 Thread William Dunlap
> I guess I could have been a little more authoritative: the code > unique(a[sapply(b,function(x) which.min(abs(x-a)))]) is exactly what I need. That method could be written as the following function f0 <- function (a, b, unique = TRUE) { ret <- a[sapply(b, function(x) which.min(abs(x - a)))

Re: [R] hist in a for loop

2013-06-18 Thread Rui Barradas
Hello, Please post to the list, like this the odds for more and better answers are greater. I don't understand what you want with singlefile$GVC(singlefile$new_id[,i] singlefile$GVC is a function? How do you plot one single histogram? Post the code and maybe it will become more clear. Ru

Re: [R] transform 3 numeric vectors empty of 0/1

2013-06-18 Thread arun
Hi, You could also use: dat1<- data.frame(Vec1,Vec2,Vec3) Reduce(paste0,lapply(seq_len(ncol(dat1)),function(i) {x1<- as.character(factor(dat1[,i],labels=c("",LETTERS[i])))})) # [1] "ABC" "ABC" ""    "AC"  "AB"  "ABC" "A"   "B"   "ABC" "AC"  "B"   "A"  #[13] "AB"  "C"   "B"  #or library(plyr) lib

Re: [R] find closest value in a vector based on another vector values

2013-06-18 Thread Andras Farkas
Bert, I guess I could have been a little more authoritative: the code unique(a[sapply(b,function(x) which.min(abs(x-a)))]) is exactly what I need. Thanks for the input, your comments helped us make the code better, Andras --- On Tue, 6/18/13, Bert Gunter wrote: > From: Bert Gunter > Subjec

Re: [R] transform 3 numeric vectors empty of 0/1

2013-06-18 Thread David Carlson
Try this > set.seed(42) > Vec1 <- sample(0:1, 15, replace=TRUE) > Vec2 <- sample(0:1, 15, replace=TRUE) > Vec3 <- sample(0:1, 15, replace=TRUE) > paste0(ifelse(Vec1,"A",""), ifelse(Vec2,"B",""), ifelse(Vec3,"C","")) [1] "ABC" "ABC" """AC" "AB" "ABC" "A" "B" "ABC" "AC" "B" "A" [13] "A

[R] transform 3 numeric vectors empty of 0/1

2013-06-18 Thread Arnaud Michel
Dear all, Without a loop, I would like transform 3 numeric vectors empty of 0/1 of same length Vec1 : transform 1 to A and 0 to "" Vec2 : transform 1 to B and 0 to "" Vec3 : transform 1 to C and 0 to "" to obtain only 1 vector Vec who is the paste of the 3 vectors (Ex : ABC, BC, AC, AB,...) An

Re: [R] hist function in a for loop

2013-06-18 Thread Rui Barradas
Hello, Sorry, I forgot to Cc the list. Rui Barradas Em 18-06-2013 16:29, Rui Barradas escreveu: Hello, Inline. Em 18-06-2013 15:54, Dzu escreveu: Dear all, I need to create a for-loop in which I can compute multiple histograms My code is the following : #singlefile includes huge csv file #I

[R] hist function in a for loop

2013-06-18 Thread Dzu
Dear all, I need to create a for-loop in which I can compute multiple histograms My code is the following : #singlefile includes huge csv file #I want to specify the binsize #I would like to compute in the for -loop the histograms numfiles <- length(singlefile) for (i in 1 :51) {

[R] FW: Dereje Bacha

2013-06-18 Thread Dereje Bacha
wer http://www.newlineoptik.de/ooplepi/fojvlunsrc/lmnfuwv/cghhcy.phpDereje Bacha [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http

Re: [R] Problem with the mod function %%

2013-06-18 Thread arun
Hi Benjamin, Thanks for pointing that out. Sorry, didn't read the question carefully. (0.1%%1)-0.1 #[1] 0  (1.1%%1)-0.1 #[1] 8.326673e-17 (1%%1.1) #[1] 1 A.K. From: Benjamin To: arun Sent: Tuesday, June 18, 2013 11:33 AM Subject: Re: [R] Problem with the

Re: [R] Help understanding environments

2013-06-18 Thread William Dunlap
Since you set combined <- NULL at the top of the function exists("combined") will always return TRUE. If you initialize 'combined' to NULL, use is.null(combined) to see if it is still in its virgin state. If you don't initialize it to anything then use exists("combined"). In this example yo

Re: [R] package expm: matrix powers within a product of matrices: operation precedence

2013-06-18 Thread Ben Bolker
Rainer K. SACHS berkeley.edu> writes: > > Thanks, that clears everything up completely. It might be worth adding > your comment to the available documentation. This request should probably go the maintainer of the expm package (library("expm"); maintainer("expm")), who may or may not be readi

Re: [R] Help understanding environments

2013-06-18 Thread Rui Barradas
Hello, The first argument to exists() must be the name of an object given as a character string, as stated in the help page. See ?exists. You have also forgot to initialize combined to NULL, this time. Your function revised would then become c_objects <- function(FILES) { combined <- NULL

Re: [R] Help understanding environments

2013-06-18 Thread Davis, Brian
Thanks a bunch. Can't believe I missed that. -Original Message- From: Rui Barradas [mailto:ruipbarra...@sapo.pt] Sent: Tuesday, June 18, 2013 9:57 AM To: Davis, Brian Cc: r-help@r-project.org Subject: Re: [R] Help understanding environments Hello, The first argument to exists() must be

Re: [R] find closest value in a vector based on another vector values

2013-06-18 Thread Bert Gunter
Andras: No. Using the a = c(1,8,9) and b = 2:3 that ** I posted before**, you get the single unique value of 1. Please stop guessing, think carefully about what you want to do, and **test** your code. -- Bert On Tue, Jun 18, 2013 at 7:41 AM, Andras Farkas wrote: > Bert, > > thanks... The valu

Re: [R] find closest value in a vector based on another vector values

2013-06-18 Thread Andras Farkas
Bert, thanks... The values should not repeat themselves if the same a is closest to all b, so probably aruns example extended with a unique command works best? unique(a[sapply(b,function(x) which.min(abs(x-a)))]) thanks, Andras --- On Tue, 6/18/13, Bert Gunter wrote: > From: Bert Gunter >

Re: [R] Elementary Help

2013-06-18 Thread arun
Hi, May be this helps: set.seed(24) dat1<- data.frame(ID=1:200,value=sample(c(5:200,NA),200,replace=TRUE))  which(is.na(dat1$value)) #[1]  56 146 184 sum(which(is.na(dat1$value)))  #Not clear about the 2nd part of the question #[1] 386  sum(is.na(dat1$value)) #[1] 3 table(is.na(dat1$value)) #FALSE

Re: [R] find closest value in a vector based on another vector values

2013-06-18 Thread Jorge I Velez
T hank you very much, Bert. Point well taken. Regards, Jorge.- On Wed, Jun 19, 2013 at 12:07 AM, Bert Gunter wrote: > Jorge: No. > > > a <-c(1,5,8,15,32,33.5,69) > > b <-c(8.5,33) > > a[findInterval(b, a)] > [1] 8 32 ##should be 8 33.5 > > I believe it has to be done explicitly by finding

Re: [R] Problem with the mod function %%

2013-06-18 Thread arun
Hi, Possibly, R FAQ: 7.31 http://www.hep.by/gnu/r-patched/r-faq/R-FAQ_82.html (1.1%%1)-0.1 #[1] 8.326673e-17 fun1 <- function(x, y, eps = .Machine$double.eps^0.5) abs(x - y) < eps  fun1(1.1%%1,0.1) #[1] TRUE A.K. 0.1%%1==0.1 returns TRUE, which is right But 1.1%%1==0.1 returns FALSE !!

Re: [R] find closest value in a vector based on another vector values

2013-06-18 Thread Bert Gunter
Jorge: No. > a <-c(1,5,8,15,32,33.5,69) > b <-c(8.5,33) > a[findInterval(b, a)] [1] 8 32 ##should be 8 33.5 I believe it has to be done explicitly by finding all the differences and choosing those n with minimum values, depending on what n you want. Note that the problem is incompletely spe

Re: [R] Help understanding environments

2013-06-18 Thread Davis, Brian
In my haste to make a smaller example than my actual code I used 'is.null' instead of 'exists' as is in my code. Here's a small reproducible example res <- list(abc=letters, ABC=LETTERS) save(res, file="results.RData") res <- list(zyx=rev(letters), ZYX=rev(LETTERS)) save(res, file="results2.RDa

Re: [R] regression in 3D space

2013-06-18 Thread Gerrit Eichner
Dear Eliza, the more unspecific a question is formulated, the more is the poster in an urgent need for a statistical consultant nearby and -- at the same time -- the less likely is is to get a useful answer on this list ... I suggest you to read the posting guide, look at CRAN's Task Views an

Re: [R] find closest value in a vector based on another vector values

2013-06-18 Thread arun
Hi, Perhaps this works: a[sapply(b,function(x) which.min(abs(x-a)))] #[1]  8 32 A.K. - Original Message - From: Andras Farkas To: r-help@r-project.org Cc: Sent: Tuesday, June 18, 2013 8:34 AM Subject: [R] find closest value in a vector based on another vector values Dear All, would y

[R] Linear combination of time series for approximating another one.

2013-06-18 Thread Francisco Javier Santos Alamillos
Dear R community, I would like to approximate a time serie as linear combination of a set of many time series, minimizing the number of the time series involved in the linear combination. Can you recommend to me any method for this? Any paper about this? I will appreciate much your suggestions.

Re: [R] find closest value in a vector based on another vector values

2013-06-18 Thread Jorge I Velez
Dear Andras, Try > a[findInterval(b, a)] [1] 8 32 HTH, Jorge.- On Tue, Jun 18, 2013 at 10:34 PM, Andras Farkas wrote: > Dear All, > > would you please provide your thoughts on the following: > let us say I have: > > a <-c(1,5,8,15,32,69) > b <-c(8.5,33) > > and I would like to extract from

Re: [R] Package zoo - na.rm ignored?

2013-06-18 Thread Gabor Grothendieck
On Mon, Jun 17, 2013 at 7:03 PM, Katharina May wrote: > many thanks for the enlightenment - I guess I completely misunderstood the > na.rm option here... > Looking at the help file the na argument seems not suffiiciently well explained. Will improve. -- GKX Group, GKX Associates Inc. tel: 1-877-

[R] find closest value in a vector based on another vector values

2013-06-18 Thread Andras Farkas
Dear All, would you please provide your thoughts on the following: let us say I have: a <-c(1,5,8,15,32,69) b <-c(8.5,33) and I would like to extract from "a" the two values that are closest to the values in "b", where the length of this vectors may change but b will allways be shorter than "a

[R] Problem in Two way Matrix

2013-06-18 Thread Fazli Raziq
Hello, Where is the problem in this programming. I want two way matrix, but it gives problem. The program is given below: rep = 2 genes = 5 pred = c() iter   = array (dim = c(rep, pred)) pred = array(dim = c(1, genes)) m = c() l = 1 w = 1 for(m in 1:rep) {   

[R] regression in 3D space

2013-06-18 Thread eliza botto
Dear UseRs,I need to know that is there a way in R for a 3D regression analysis?i actually have a data in 3 dimensional space showing differences between regimes in 3D space and i want to do its regression analysis with another data which is also in 3D space. thanks in advance for your help, E