[R] plotly: ability to drag points on x axis only and prevent change of y axis value

2020-12-10 Thread Andras Farkas via R-help
Hello, wonder if you could provide input on the following: please see toy example below, wanted to see if there is a way to have restrictions on how the points are dragged on the plot. More specifically I would like the points draggable horizontally ONLY and have their y axis value remain

[R] (almost) rolling or fill function?

2020-06-08 Thread Andras Farkas via R-help
Thanks Bert, here it is in plain. Hello, please see if you have a thought on how to achieve the following: we have: df<-data.frame(a=Sys.Date()+1:10,                b=Sys.Date()+c(NA,NA,NA,rep(3,4),NA,NA,3),                c=Sys.Date()+c(NA,NA,NA,rep(9,4),NA,NA,9)) the idea I have

[R] (almost) rolling function or fill?

2020-06-08 Thread Andras Farkas via R-help
Hello, please see if you have a thought on how to achieve the following: we have: df<-data.frame(a=Sys.Date()+1:10,                b=Sys.Date()+c(NA,NA,NA,rep(3,4),NA,NA,3),                c=Sys.Date()+c(NA,NA,NA,rep(9,4),NA,NA,9)) the idea I have difficulty wrapping my head around is to do the

[R] MuMIn package with gamlss error

2019-04-13 Thread Andras Farkas via R-help
Hello, could you please provide your thoughts on what I may be missing? gamlss models are supposedly supported by MuMIn yet this one fails: library(MuMIn) #this lm runs linearMod <- lm(Sepal.Length ~ ., data=iris)  options(na.action = "na.fail") res <-dredge(linearMod,beta = T, evaluate = T)

[R] data frame solution

2019-03-19 Thread Andras Farkas via R-help
Hello All, wonder if you have thoughts on a clever solution for this code: df       <- data.frame(a = c(6,1), b = c(1000,1200), c =c(-1,3))  #the caveat here is that the number of rows for df can be anything from 1 row to in the hundreds. I kept it to 2 to have minimal reproducible

Re: [R] reduce and intersect question (maybe)?

2019-02-21 Thread Andras Farkas via R-help
Works well! Thanks! Andras  On Thursday, February 21, 2019, 8:47:51 AM EST, Jeff Newmiller wrote: Use ?merge instead of intersect. On February 21, 2019 5:22:46 AM PST, Andras Farkas via R-help wrote: >Hello All, > >wonder if you have a suggestion for the following: &

[R] reduce and intersect question (maybe)?

2019-02-21 Thread Andras Farkas via R-help
Hello All, wonder if you have a suggestion for the following: we have a<-data.frame(ID=c(1,2,3,4,5,6,7),date=as.POSIXct(seq(as.Date('2011-01-01'),as.Date('2011-01-07'),by = 1),format='%m/%d/%Y %H:%M'),z=rnorm(7,1,1))

Re: [R] list with list function

2019-02-05 Thread Andras Farkas via R-help
Thanks Rui and Ivan, works perfectly... Andras On Monday, February 4, 2019, 4:18:39 PM EST, Rui Barradas wrote: Hello, Like this? Map('[', listA, lapply(listB, '*', -1)) Hope this helps, Rui Barradas Às 21:01 de 04/02/2019, Andras Farkas via R-help escreveu: > Hello every

[R] list with list function

2019-02-04 Thread Andras Farkas via R-help
Hello everyone, wonder if you would have a thought on a function for the following: we have a<-sample(seq(as.Date('1999/01/01'), as.Date('2000/01/01'), by="day"),5) b<-sample(seq(as.Date('1999/01/01'), as.Date('2000/01/01'), by="day"), 4) c<-sample(seq(as.Date('1999/01/01'),

Re: [R] data frame transformation

2019-01-07 Thread Andras Farkas via R-help
keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Sun, Jan 6, 2019 at 5:16 AM Andras Farkas via R-help wrote: Hello Everyone, would you be able to assist with some expertise on how to get the following do

[R] data frame transformation

2019-01-06 Thread Andras Farkas via R-help
Hello Everyone, would you be able to assist with some expertise on how to get the following done in a way that can be applied to a data set with different dimensions and without all the line items here? we have: id<-c(1,1,1,2,2,2,2,3,3,4,4,4,4,5,5,5,5)#length of unique IDs may differ of

Re: [R] ddply (or other suitable solution) question

2018-09-14 Thread Andras Farkas via R-help
cking things into it." > -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) > > On Thu, Sep 13, 2018 at 12:11 PM Andras Farkas via R-help > wrote: > > > > Dear All, > > > > I have data frame: > > set.seed(123.456

[R] ddply (or other suitable solution) question

2018-09-13 Thread Andras Farkas via R-help
Dear All, I have data frame: set.seed(123.456) df <-data.frame(ID=c(1,1,2,2,2,3,3,3,3,4,4,5,5),                 read=c(1,1,0,1,1,1,0,0,0,1,0,0,0),                 int=c(1,1,0,0,0,1,1,0,0,1,1,1,1),                 z=rnorm(13,1,5),                 y=rnorm(13,1,5)) what I would like to achieve (as

[R] kSamples ad.test question

2018-08-02 Thread Andras Farkas via R-help
Dear All, once we run the following code, the results of the test will give us the expected obvious, samples are from the common distribution... library(kSamples) u1 <- sample(rnorm(500,10,1),20,replace = TRUE) u2 <- sample(rnorm(500,10,1),20,replace = TRUE) u3 <-

[R] MICE data analysis with glmulti

2018-01-30 Thread Andras Farkas via R-help
Dear All, wonder if you have some thoughts on running the with() function (and perhaps including the pool() function to get the results?) in glmulti? In other words, how to run glmulti with a data set that is produced by mice()? publicly available code: data <- airquality data[4:10,3] <-

[R] summary.rms help

2018-01-03 Thread Andras Farkas via R-help
Dear All, using the example from the help of summary.rms library(rms) n <- 1000# define sample size set.seed(17) # so can reproduce the results age<- rnorm(n, 50, 10) blood.pressure <- rnorm(n, 120, 15) cholesterol<- rnorm(n, 200, 25) sex<-

[R] effects package x axis labels

2017-11-10 Thread Andras Farkas via R-help
Dear All, probably a simple enough solution but don;t seem to be able to get my head around it...example based on a publicly available data set: mydata <- read.csv("https://stats.idre.ucla.edu/stat/data/binary.csv;) mylogit <- glm(admit ~ gre + gpa + rank, data = mydata, family = "binomial")

[R] bquote question

2017-08-18 Thread Andras Farkas via R-help
Dear All, could you please provide input on the following: plot(1:10,main=paste("\n ","\nABCD","\n","\n","\n"),cex.main=1.3) a<-500 b<-12 mtext(bquote(bold(.(formatC(1.2*a,decimal.mark=",",digits=2,format="f")))~ " words "~bold(.(b))~" words"~"\n"~"\n")) as you

Re: [R] data frame question

2017-08-06 Thread Andras Farkas via R-help
t; b <- c(0:4,0:7) >> f(a,b) > [1] 1 1 1 1 1 2 2 2 2 2 2 2 2 > > > >Bert Gunter > >"The trouble with having an open mind is that people keep coming along >and sticking things into it." >-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )

[R] data frame question

2017-08-06 Thread Andras Farkas via R-help
Dear All, wonder if you have thoughts on the following: let us say we have: df<-data.frame(a=c(1,2,3,4,5,1,2,3,4,5,6,7,8),b=c(0,1,2,3,4,0,1,2,3,4,5,6,7)) I would like to rewrite values in column name "a" based on values in column name "b", where based on a certain value of column "b" the

Re: [R] select from data frame

2017-07-16 Thread Andras Farkas via R-help
> [1] 3 3 > > > > Cheers, > > Bert > > > Bert Gunter > > "The trouble with having an open mind is that people keep coming along > and sticking things into it." > -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) > > &

[R] select from data frame

2017-07-15 Thread Andras Farkas via R-help
Dear All, wonder if you could please assist with the following df<-data.frame(ID=c(1,1,1,2,2,3,3,4,4,5,5),samples=c("A","B","C","A","C","A","D","C","B","A","C")) from this data frame the goal is to extract the value of 3 from the ID column based on the logic that the ID=3 in the data frame

Re: [R] "reverse" quantile function

2017-06-16 Thread Andras Farkas via R-help
in your one liner would be the first 4 column values of each row and "q" is the last (5fth) column value of each row.. thanks again for all the help, Andras Farkas On Friday, June 16, 2017 4:58 AM, peter dalgaard <pda...@gmail.com> wrote: It would depend on which one of t

Re: [R] "reverse" quantile function

2017-06-16 Thread Andras Farkas via R-help
Never mind, I think i figured: z<-df apply(df,1,function(x) approx(sort(x[1:4]), seq(0,1,,length(x[1:4])), x[5])$y) thanks again for the help Andras Farkas, On Friday, June 16, 2017 5:34 AM, Andras Farkas via R-help <r-help@r-project.org> wrote: Peter, thanks,

Re: [R] "reverse" quantile function

2017-06-16 Thread Andras Farkas via R-help
in your one liner would be the first 4 column values of each row and "q" is the last (5fth) column value of each row.. thanks again for all the help, Andras Farkas __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://sta

Re: [R] "reverse" quantile function

2017-06-15 Thread Andras Farkas via R-help
xample assuming : k<-c(1:100) f<-30 ecdf(k)(f) would give us the value of 0.3... so same idea as this, but instead of "k" we have data frame "z", and instead of "f" we have "res", and need to find the value of 0.3... Does that make sense? m

[R] "reverse" quantile function

2017-06-15 Thread Andras Farkas via R-help
)) #to get 0.33 back... any suggestions on how I could to that for a data frame? thank you,Andras Farkas __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

Re: [R] Prophet package

2017-03-19 Thread Andras Farkas
a plot from your plot command? It looks to me as thought there was an error, perhaps because the plot command tried to treat "forecast" as a vector. Jim On Mon, Mar 20, 2017 at 5:43 AM, Andras Farkas via R-help <r-help@r-project.org> wrote: > Dear All > > > wonder if y

[R] Prophet package

2017-03-19 Thread Andras Farkas via R-help
) points(x=as.Date('2017-02-01'),y=0.5) results in error message : Error in plot.xy(xy.coords(x, y), type = type, ...) : plot.new has not been called yet would you have a solution to plot the point on the plot? appreiate the help, Andras Farkas, __

[R] extend lines of prediction interval ggplot2

2017-03-14 Thread Andras Farkas via R-help
int(shape=15,aes(x=c(8),y=new_df[,2][8]), color="black",cex=4)+ geom_point(shape=17,aes(x=c(19),y=0.3403275*100), color="black",cex=4)+ geom_point(shape=17,aes(x=c(20),y=0.2973978*100), color="black",cex=4) as you will see the regresssion line and confidence inte

[R] extending lines for prediction intervals

2017-03-14 Thread Andras Farkas
color="black",cex=4)+ geom_point(shape=15,aes(x=c(8),y=new_df[,2][8]), color="black",cex=4)+ geom_point(shape=17,aes(x=c(19),y=0.3403275*100), color="black",cex=4)+ geom_point(shape=17,aes(x=c(20),y=0.2973978*100), color="black",cex=4) as you will see t

[R] log log regression model

2016-01-01 Thread Andras Farkas
Dear All, wonder if you have a thought on the followimg: if I have a simple model like model <- lm(log(y)~log(x)+log(z),data=data), where both, the dependent and independent variables are log transformed, is it ok just to use ypred <- predict(model,type=response) to get the predictions ,

[R] help with subscript on axis lables

2014-10-03 Thread Andras Farkas
Dear All, wonder if you could help with the following:we have:vals - 1:5names(vals) - paste0(ke,1:length(vals))mp - barplot(vals, ylim = c(0, 6),ylab=expression(paste(Hour^-10))) In would like to make the numbers (ke1 to ke5, respectively) in the labels of the x axis a subscript. There is

Re: [R] optimization question

2014-10-02 Thread Andras Farkas
(1,1,1,1,0,1,0,0,0)df -rbind(a,b,c,d)df -cbind(df,h=c(sum(a)*8,sum(b)*8,sum(c)*8,sum(d)*8))df -cbind(df,df[,8]*c(1,2,3,2)) Jean On Wed, Oct 1, 2014 at 7:30 PM, Andras Farkas motyoc...@yahoo.com wrote: Dear All, please provide help with the following: we have a -c(0,1,1,0,1,0,0,0,0) b -c

[R] optimization question

2014-10-01 Thread Andras Farkas
Dear All, please provide help with the following: we have a -c(0,1,1,0,1,0,0,0,0) b -c(0,0,0,1,0,0,0,0,0) c -c(1,0,1,0,1,1,0,0,0) d -c(0,1,0,1,0,1,0,0,0) df -rbind(a,b,c,d) df -cbind(df,h=c(sum(a)*8,sum(b)*8,sum(c)*8,sum(d)*8)) df -cbind(df,df[,8]*c(1,2,3,2)) I would like to minimize the value

[R] help with splitting parts of data frame

2014-09-28 Thread Andras Farkas
Dear All, please help with the following if you can: we have: simt -seq(0,147,by=1) simc -50*exp(-0.01*simt) out1.2 -data.frame(simt,simc) AUC -c(0,apply(matrix(simc),2,function(x) (diff(simt)*(x[-1]+x[-length(x)]))/2 )) df -cbind(out1.2,AUC) z -cumsum(rep(24,max(out1.2$simt/24)))

[R] nlxb generating no SE

2014-08-27 Thread Andras Farkas
Dear All please provide insights to the following, if possible: we have E -c(8.2638 ,7.9634, 7.5636, 6.8669, 5.7599, 8.1890, 8.2960, 8.1481, 8.1371, 8.1322 ,7.9488, 7.8416, 8.0650, 8.1753, 8.0986 ,8.0224, 8.0942, 8.0357, 7.8794, 7.8691, 8.0660, 8.0753, 8.0447, 7.8647, 7.8837, 7.8416,

[R] nlxb CI

2014-07-19 Thread Andras Farkas
Dear All, wonder if someone could point me in the direction of calculating confidence intervals for model parameters generated by nlxb() in the nlmrt package? confint() as is gives the following message: no applicable method for 'vcov' applied to an object of class nlmrt. appreciate the input,

[R] help with apply and nleqslv

2014-06-12 Thread Andras Farkas
Dear All, please provide insights into the following problem; this part is the reproducible example: library(nleqslv) S1 -0.5 S2 -0.5 Z -7.2598 M1 --5.7831 M2 -24.597 mk501 -1.2827 mk502 -4.7964 AL --0.5623  f - function(H1){   1 -

[R] optFederov question

2014-06-08 Thread Andras Farkas
Dear All, seeking input (or assurance) that I am using the optFederov in AlgDesign apropriatelly... I have: require(AlgDesign) c -seq(1,64,by=0.1) econ=9.16 ic=4.796 hill=1.217 x=5.618 eff -econ-(ic*(c^hill/(x^hill+c^hill))) cand.list -data.frame(c=c,eff=eff,econ=econ,ic=ic,hill=hill,x=x)

[R] question about wfct in minpack.lm package

2014-05-15 Thread Andras Farkas
Dear All,   made some headways with my nls model, thanks for the help... I would like to ask if you could provide some insights to the following:   I am trying to use wfct() from minpack.lm so that I could do the weighting using one of the predictors, but getting an error message:  

[R] nls() help please

2014-05-13 Thread Andras Farkas
Dear All,   please help with writing the function for the following:   we have data frame raw   D1 -c(2, 2, 2, 2, 2, 5, 5, 5, 5, 5, 10, 10, 10, 10, 10, 20, 20, 20, 20, 20, 50, 50, 50, 50, 50) D2 -c(0.2, 0.5, 1, 2, 5, 0.2, 0.5, 1, 2, 5, 0.2, 0.5, 1, 2, 5, 0.2, 0.5, 1, 2, 5, 0.2, 0.5, 1, 2, 5) E

Re: [R] finding value for a parameter in an equation

2014-04-23 Thread Andras Farkas
Frede Thank you very much for the help. Indeed, I am trying to do exactly what you wrote the code for. I may have caused some confusion though as a result of a typographic error in my equation: the result of the equation should EQUAL to the value of 1. I see you have inputted the equation

Re: [R] finding value for a parameter in an equation, much appreciate the help. I will double check sources.

2014-04-23 Thread Andras Farkas
Frede Thank you for the explanation, now I better understand how to write functions like this, Andras [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read

[R] finding value for a parameter in an equation

2014-04-22 Thread Andras Farkas
Dear All,   please provide some insights for the following:   we have:   D1 -c(0.2,0.6,0.8) D2 -c(114,190,304) IC501 -0.62 IC502 -137.8 ECON -5.95 ALPHA -0.5 M1 -0.84 M2 -0.96   and the equation:   1 =

[R] expression in xlab for a plot

2014-01-01 Thread Andras Farkas
Dear All, Happy new year! wonder if you could help with the following: we have: hist(runif(1000,0,100),xlab=expression(AUC[0 - 24]~ (xyz)),ylab=Frequency) the plan is to have part of the xlab expression change dynamically, specifically the values of 0 and 24 should be able to update

[R] data frame question

2013-12-09 Thread Andras Farkas
Dear All please help with the following: I have: a -seq(0,10,by=1) b -c(10:20) d -cbind(a,b) f -16 I would like to select the value in column a based on a value in column b, where the value in column b is the 1st value that is smaller then f. Thus I should end up with the number 5 because

[R] apply question

2013-10-27 Thread Andras Farkas
Dear All, please help with the following problem: I have t -seq(0,24,by=6) a -600 g -0.05 b -a*exp(-g*t)    I would like to establish a vector called z (for example) based on b where the results are calculated as : z -c(a-b[1],b[1]-b[2],b[2]-b[3],b[3]-b[4],b[4]-b[5]) so the results are:

Re: [R] apply question

2013-10-27 Thread Andras Farkas
not homework, but thanks for the hint! Andras On Sunday, October 27, 2013 7:51 AM, Patrick Burns pbu...@pburns.seanet.com wrote: Homework?  A hint is: ?diff Pat On 27/10/2013 11:37, Andras Farkas wrote: Dear All, please help with the following problem: I have t -seq(0,24,by=6

[R] selection based on dates

2013-07-30 Thread Andras Farkas
Dear All   please provide your insigths on the following:   I have:   a -c(1/1/13,15,20) b -c(1/5/13,15,25) c -c(1/9/13,15,28) d -c(2/1/13,18,30) e -c(2/5/13,18,35) f -c(2/9/13,18,38) x -matrix(c(a,b,c,d,e,f),ncol=3,byrow=TRUE)   What I would like to do is to eliminate certain rows of this matrix

[R] help on selecting values of an object

2013-07-04 Thread Andras Farkas
Dear List, please provide some input on the following: we have a -c(0,1,2,3) b -c(4,5,6,7) d -cbind(a,b) k -c(0,0,2,2,3,3,2) k in this case consists of some values of d[,1] in a random sequence. What I am trying to do is to create an object f that would have the values of d[,2] in it based on

Re: [R] overlay 2 dot plots

2013-06-22 Thread Andras Farkas
dot plots To: Andras Farkas motyoc...@yahoo.com Cc: r-help@r-project.org Date: Friday, June 21, 2013, 4:37 PM dotplot is a lattice function. add is an argument to some base graphics. Never the twain shall meet. There is no add argument to dotplot -- did you read the lattice Help for dotplot

[R] hdr.den plot colors help

2013-06-21 Thread Andras Farkas
Dear All, I have the following code: a -rnorm(5000,10,2) hdr.den(a,prob = c(25, 50, 75,95)) is there a way to change the colors of the horizontal bars representing the given highest density regions from the current white, green, red and black to colors of the shades of grey going from lighter

Re: [R] hdr.den plot colors help

2013-06-21 Thread Andras Farkas
Rui, package is hdrcde, and thanks for the input, Andras --- On Fri, 6/21/13, Rui Barradas ruipbarra...@sapo.pt wrote: From: Rui Barradas ruipbarra...@sapo.pt Subject: Re: [R] hdr.den plot colors help To: Andras Farkas motyoc...@yahoo.com Cc: r-help@r-project.org Date: Friday, June 21

[R] overlay 2 dot plots

2013-06-21 Thread Andras Farkas
Dear All, wonder if you would provide your insights on the following: the code: library(lattice) y -c(1:58) x -runif(58,5,10) z -runif(58,8,12) dataset -data.frame(y,x) dotplot(y ~ x, data = dataset) dataset -data.frame(y,z) dotplot(y~z,data = dataset,col=red) I would like to overlay the two

[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. So

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

2013-06-18 Thread Andras Farkas
: From: Bert Gunter gunter.ber...@gene.com Subject: Re: [R] find closest value in a vector based on another vector values To: Jorge I Velez jorgeivanve...@gmail.com Cc: Andras Farkas motyoc...@yahoo.com, R mailing list r-help@r-project.org Date: Tuesday, June 18, 2013, 10:07 AM Jorge

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

2013-06-18 Thread Andras Farkas
: Bert Gunter gunter.ber...@gene.com Subject: Re: [R] find closest value in a vector based on another vector values To: Andras Farkas motyoc...@yahoo.com Cc: Jorge I Velez jorgeivanve...@gmail.com, R mailing list r-help@r-project.org Date: Tuesday, June 18, 2013, 10:55 AM Andras: No. Using

[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] vector question

2013-06-17 Thread Andras Farkas
Dear All, would you please help with the following: let us say I have: a -c(0,1,12,13,24,25,36,37) b -c(6,24.6,27) #then I extract every 2nd element from a d -a[seq(1, length(a), 2)] and what I need help with is to extract the 1st value from d that is greater than the values in b, so as a

[R] help with data.frame

2013-05-21 Thread Andras Farkas
Dear All I have the following code for list a: a -list(structure(c(0, 4, 8, 12, 0, 19.5581076131386, 10.7499105081144, 5.91923975728553, 0, 4.08916328337685, 2.26872955281708, 1.24929641535359 ), .Dim = c(4L, 3L), .Dimnames = list(NULL, c(time, y, b )), istate = c(2L, 107L, 250L, NA, 5L, 5L,

Re: [R] help with data.frame

2013-05-21 Thread Andras Farkas
that is exactly what I wanted! Thank you Sarah! Andras --- On Tue, 5/21/13, Sarah Goslee sarah.gos...@gmail.com wrote: From: Sarah Goslee sarah.gos...@gmail.com Subject: Re: [R] help with data.frame To: Andras Farkas motyoc...@yahoo.com Cc: r-help@r-project.org Date: Tuesday, May 21, 2013

[R] Help on sound identification of distance between lines

2013-05-11 Thread Andras Farkas
Dear List I would like to ask for some input on the following (here is a simplified version of the code): t -t(seq(0,120,by=120/48)) d -500 k -0.1 x -matrix((d/20)*exp(-k*0.9*t)) y -matrix((d/15)*exp(-k*0.7*t)) z-matrix((d/22)*exp(-k*1.1*t)) w-matrix((d/17)*exp(-k*0.2*t)) t

[R] date and time coding question

2013-05-10 Thread Andras Farkas
Dear All   I have the following code:   datetime -c(1/1/13 00:00,1/1/13 12:00,1/2/13 00:00,1/2/13 12:00) datetime -as.POSIXct(datetime,format='%m/%d/%Y %H:%M') times

[R] modMCMC runs in FME package

2013-05-02 Thread Andras Farkas
Dear All,   please help with some thoughts on overcoming the following issues, if possible:   #R Code   require(deSolve) require(FME) pars - list(k = 0.06,v=18) intimes - c(0,0.5,12,12.5,50) input   - c(800,0,800,0,0) forc - approxfun(intimes, input, method=constant) model - function(pars,

[R] lsoda question from deSolve package

2013-04-21 Thread Andras Farkas
Dear List, Wonder if you have some thoughts on the following question using lsoda in desolve: I have the following data and function: require(deSolve) times - c(0:24) tin  - 0.5 D - 400 V    - 26.3 k -0.056 k12  - 0.197118 k21  - 0.022665 yini - c(dy1 = 0,dy2 = 0)  events - data.frame(var

[R] lognormal sampleing using covariance matrix

2013-04-01 Thread Andras Farkas
Dear All,   wondering if someine can access the link to the randsamp code referenced in the R-help archive here: http://www.mail-archive.com/r-help@stat.math.ethz.ch/msg75645.html ? I have tried but for whatever reason I can not get trough. My problem seems to be  similar to what the author

[R] QUESTION ON ROUNDING

2013-03-28 Thread Andras Farkas
Dear All,   wonder if you have a thought on the following: I am using the round(x,digits=3) command, but some of my values come out as: 0.07099 AND 0.06901. Any thoughts on why this maty be happening or how to eliminate the problem?   apreciate the help,   Andras

[R] help on writing a function

2013-03-23 Thread Andras Farkas
Dear All   If you could please help me with a solution on the following: we have:   a -matrix(c(1,2,3,4,5)) x -matrix(c(0.3,0.2,0.1,0.08,0.05)) b -50*exp(-x[1]*a[1]) d -b*exp(-x[2]*a[2]) e -d*exp(-x[3]*a[3]) f -e*exp(-x[4]*a[4]) g -f*exp(-x[5]*a[5])   I would like to be able to calculate g with

Re: [R] how to skip part of the code

2013-03-21 Thread Andras Farkas
guys!   Andras --- On Wed, 3/20/13, Robert Baer rb...@atsu.edu wrote: From: Robert Baer rb...@atsu.edu Subject: Re: [R] how to skip part of the code To: PIKAL Petr petr.pi...@precheza.cz Cc: Andras Farkas motyoc...@yahoo.com, r-help@r-project.org r-help@r-project.org Date: Wednesday, March 20, 2013

[R] help on extracting values from a matrix

2013-03-20 Thread Andras Farkas
Dear All,   any thoughts on how I can do the following:   let us say we have:   a -c(2,4,16,28,48) b -c(10,4,2,0.4,0.03) d -cbind(a,b)   what I would like to do is to extract values of column b in the matrix based on the corresponding values of column a. For example: I would like to extract all

[R] how to skip part of the code

2013-03-20 Thread Andras Farkas
Dear All,   another quick question, this one is on skipping part of my code, so let us say:   a -5 b -2 e -0   d -a+b f -a-b   what I would like to do is to have R NOT to calculate the value for d in case the value of e equals to zero (essentially skip that chunk), but instead move on to

Re: [R] how to skip part of the code

2013-03-20 Thread Andras Farkas
To: PIKAL Petr petr.pi...@precheza.cz Cc: Andras Farkas motyoc...@yahoo.com, r-help@r-project.org r-help@r-project.org Date: Wednesday, March 20, 2013, 9:27 AM On 3/20/2013 8:21 AM, PIKAL Petr wrote: Hi -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r

[R] remove specific number of rows from a matrix

2013-03-20 Thread Andras Farkas
Dear All,   sorry, got stuck again on the following: let us say we have:   a -c(1:5) b -c(6:10) d -cbind(a,b)     from d I would like to remove total number of rows based on the length of f. So if:   f -c(1)   my result is working great with the following solution:   d[-length(f),]   so I get:

[R] map question

2013-03-14 Thread Andras Farkas
Dear All,   wondering if anyone could help with a working code for the following:   I would like to plot a map using R that includes New York City (with counties of Kings, Queens, Bronx, New York and Richmond), Westchester, Nassau, Suffolk  and Rockland counties (any color would be ok per county

[R] Help on a code

2013-02-26 Thread Andras Farkas
Dear List,   I have the following code:   x -c(0, 13.8, 38.16667, 62.16667, 85.91667, 108.9167) y -c(1.77, 2.39, 3, 2.65, 2.62, 1.8) Interpolated - approx(x, y,xout=0:tail(x, n=1),method=linear) plot(Interpolated)   in this code x is time in hours

Re: [R] Loop question?

2013-01-26 Thread Andras Farkas
...@dcn.davis.ca.us wrote: From: Jeff Newmiller jdnew...@dcn.davis.ca.us Subject: Re: [R] Loop question? To: Andras Farkas motyoc...@yahoo.com, r-help@r-project.org r-help@r-project.org Date: Saturday, January 26, 2013, 2:09 AM Please read the Posting Guide no html email reproducible example

[R] Loop question?

2013-01-25 Thread Andras Farkas
Dear All   I have the following data (somewhat simplyfied):   TINF -1 a -c(500,750,1000,1250,1500,1750,2000) b -c(8,12,18,24,36,48,60,72,96)   following function:   infcprodessa -function (D, tin, tau, ts)   (D * (1 - exp(-0.048 * tin))/(tin * (0.048*79) * (1 - exp(-0.048 * tau * exp(-0.048

[R] Lambert W question

2013-01-10 Thread Andras Farkas
Dear All,   I am using the following model equation:   k*(lambertW_base(b=0,((a)/k)*exp(((a)-z*(t-t0))/k)))   I would like to run this through OpenBUGS, but it does not recognize the lambert function. Would you have any thoughts on how to re-vrite this equation matemathically so that it could be

[R] How to use predict function from R2OpenBUGS results

2013-01-05 Thread Andras Farkas
Dear All,   I made some headways on my ODE problem in R2OpenBUGS, but got stuck again. Wonder if someone could help on the following:   I am running the following code:   library(R2OpenBUGS) dosetotal -c(500,250) z -c(4,2) grid -c(4,15) n.grid -2 tol -0.001 dim -2 T -2 origin -0 dosetime

Re: [R] R2OpenBUGS question with differential equations

2013-01-04 Thread Andras Farkas
Thomas,   thanks for your reply. I will switch to desolve. Unfortunatelly, the differential equation can not be re-written to an analytical solution in this case (to the best of my knowledge) because it is a non-linear process, which may not have an exact analytical solution. Thank you  

[R] R2OpenBUGS question with differential equations

2013-01-03 Thread Andras Farkas
Dear All,   Currently I am running the following code:   library(stats4) library(odesolve) library(rgenoud) Input-data.frame(SUB=c(1),time=c(0.5,3,10,15),lev=c(2.05,12.08,9.02,8)) XD-500 IT-3 diffeqfun-function(time, y, parms) {   if(time=IT)      dCpdt - (XD/IT)/parms[Vol] -

[R] simplifying code

2012-12-17 Thread Andras Farkas
Dear All,   I was wondering if you could help me with the following: I have the code:   tin -0.5 tau -24 output0 -10 TIMELOW -tin TIMEHIGH -1*tau TIME1 -c(seq(TIMELOW,TIMEHIGH, by = sign(TIMEHIGH-TIMELOW)*(tau-tin)/3))   then I would like to calculate:   cp1 -output0*exp(-0.3*TIME1[1]) cp2

[R] help on interpreting nonlinear regresson modelling results

2012-12-03 Thread Andras Farkas
Dear All,   wondering if you know of a good resource on-line to read on interpreting the parameter estimate result statistics' for the output of a nonlinear regression model. I am specifically having a hard time finding information on the interpretation  of t value and Pr /t/ in layman terms.

[R] screen if a value is within range

2012-12-01 Thread Andras Farkas
Dear all,   could you please give me some pointers on how I could make R screen for a value if it falls within a certain range? I looked at the subset function, but is not doing it, perhaps because I only have 1 value to screen?   aptreciate the input   ex: a -16.5 I would like to screen to see

[R] help on stacking matrices up

2012-11-30 Thread Andras Farkas
Dear All,   #I have the following code   Dose-1000 Tinf -0.5 INTERVAL -8 TIME8 -matrix(c((0*INTERVAL):(1*INTERVAL))) TIME7 -matrix(c((0*INTERVAL):(2*INTERVAL))) TIME6 -matrix(c((0*INTERVAL):(3*INTERVAL))) TIME5 -matrix(c((0*INTERVAL):(4*INTERVAL))) TIME4 -matrix(c((0*INTERVAL):(5*INTERVAL))) TIME3

Re: [R] help on stacking matrices up

2012-11-30 Thread Andras Farkas
] On Behalf Of Andras Farkas Sent: Friday, November 30, 2012 12:51 PM To: r-help@r-project.org Subject: [R] help on stacking matrices up Dear All, #I have the following code Dose-1000 Tinf -0.5 INTERVAL -8 TIME8 -matrix(c((0*INTERVAL):(1*INTERVAL))) TIME7 -matrix(c((0*INTERVAL):(2*INTERVAL

Re: [R] help on stacking matrices up

2012-11-30 Thread Andras Farkas
I cannot understand what shall the final plot look like. Regards Petr -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Andras Farkas Sent: Friday, November 30, 2012 12:51 PM To: r-help@r-project.org Subject: [R] help

[R] Help on function please

2012-11-26 Thread Andras Farkas
Dear All,   I could use a bit of help here, this function is hard to figure out (for me at least) I have the following so far:   PKindex-data.frame(Subject=c(1),time=c(1,2,3,4,6,10,12),conc=c(32,28,25,22,18,14,11)) Dose-200 Tinf -0.5   defun- function(time, y, parms) {  dCpdt - -parms[kel] *

[R] simple coversion of matrix rows to matrix columns

2012-11-07 Thread Andras Farkas
Dear All   I would like to convert matrix rows to columns. I am thinking the t() function should help, but am having a hard time converting the matrix into the dimensions I would like them to. Example:   a -matrix(c(1:30),ncol=3) gives me:[,1] [,2] [,3] [1,]1 11 21 [2,]2 12 22

[R] multivariate lognormal distribution simulation in compositions

2012-10-14 Thread Andras Farkas
Dear All,   thanks to Berend, my question posted yesturday was solved succesfully here: http://r.789695.n4.nabble.com/hep-on-arithmetic-covariance-conversion-to-log-covariance-td4646068.html . I posted the question with the assumption of using the results with rlnorm.rplus() from compositions.

[R] hep on arithmetic covariance conversion to log-covariance

2012-10-13 Thread Andras Farkas
Dear All,   is there a function in R that would help me convert a covariance matrix built based on arithmetic returns to a covariance matrix from log-returns?   As an example of the means and covariance from arithmetic:   mu -c(0.094,0.006,1.337,1.046,0.263) sigma

[R] better example for multivariate data simulation question-please help if you can

2012-10-12 Thread Andras Farkas
Dear All,   a few weeks ago I have posted a question on the R help listserv that some of you have responded to with a great solution, would like to thank you for that  again. I thought I would reach out to you with the issue I am trying to solve now. I have posted the question a few days ago,

[R] Help on probability distribution question

2012-10-11 Thread Andras Farkas
Dear All,   I have a questions I would like to ask about and wonder if you have any thoughts to make it work in R.   1. I work in the field of medicine where physiologic variables are often simulated, and they can not have negative values. Most often the assumption is made to simulate this

Re: [R] Help on probability distribution question

2012-10-11 Thread Andras Farkas
Andras Farkas wrote: Dear All, I have a questions I would like to ask about and wonder if you have any thoughts to make it work in R. 1. I work in the field of medicine where physiologic variables are often simulated, and they can not have negative values. Most often the assumption is made

[R] Please help on Sweave question

2012-09-30 Thread Andras Farkas
Dear All,     I have reviewed some examples over the net on this issue, but still not getting the results. I have the following text and code i would like to place into a pdf with sweave, but I would like to change the margins on the produced document. The options(width=60) I guess should do

[R] Help on converting a Sweave document to PDF

2012-09-12 Thread Andras Farkas
Dear All,   I am working with a Sweave document to be converted into PDF using Rstudio. It seems to me that my R code will also show up after conversion, which I would like not to happen. Is there a way to specify a command that I could place on the beggining and at the end of the R code that

[R] Help on calculating AUC with caTools trapz(a,b) command

2012-09-08 Thread Andras Farkas
Dear All,   I have the following example:   a -matrix(c(1:100),ncol=10) b -matrix(c(2,4,6,8,10,12,14,16,18,20))   trapz(b,a)   will give me a result of 99, which it seems to me is the AUC of the 1st column only. Is it possible to get the AUC results by columns of a using the same b values in the

[R] Apply a function to columns of a matrix

2012-09-08 Thread Andras Farkas
Dear All,   as a follow up to my previous e-mail (I think I am getting closer...):   I am trying to apply the trapezoidal functions to a matric column by column. I have the following code:   a -matrix(c(1:100),ncol=10) b -matrix(c(2,4,6,8,10,12,14,16,18,20))   apply(a,2,function(b,a)

[R] Help on finding specific columns in matrix

2012-09-02 Thread Andras Farkas
Dear All,   I have a matrix with 33 columns and 5000 rows. I would like to find 2 specific columns in the set: the one that holds the highest values and the one that holds the lowest values. In this case the column's mean would be apropriate to use to try to find those specific columns because

  1   2   >