[R] fitting a family of curves

2014-04-23 Thread andreas betz
Hello, is it possible to fit a group of curves simultaneously to an equation with some parameters shared among the curves others fit for each curve individually. Several commercial software programs like Originlab have this option often referred to as global fit. I would appreciate any advice or

[R] mvpart - is there a convenient way to calculate deviance explained by variables?

2014-04-23 Thread Kumar Mainali
Hello, I can use mvpart function of library mvpart to get a decision tree. The output of decision tree could be something like the following. I can use it to manually calculate deviance explained by the variable in the first split as below. There should be an easy way to tabulate deviance

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

2014-04-23 Thread Frede Aakmann Tøgersen
Hi Andras I suppose you want to find the real root of your equation if such exists for the particular settings of the parameters. For that you can use uniroot(). So define a function based on your equation like this: f - function(E, D1, D2, IC501, IC502, ECON, ALPHA, M1, M2){ 1 -

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

2014-04-23 Thread Frede Aakmann Tøgersen
Sorry I made a copy and paste error. To get all the details of the curves between 0 and I had to use: E - seq(0,10, len = 2000) Sorry for the inconvenience. Yours sincerely / Med venlig hilsen Frede Aakmann Tøgersen Specialist, M.Sc., Ph.D. Plant Performance Modeling Technology Service

Re: [R] Fw: Save multiple plots as pdf or jpeg

2014-04-23 Thread Pavneet Arora
Sorry I should have been more clearer. Let me repharse. At the moment I have a loop that plots a histogram of the variable, along with rug and super-imposed normal curve over it. It does that for a lot of variables in the dataset and then compiles them into a pdf. Whereby each page on the pdf

Re: [R] Loop to extract from variables in the workspace

2014-04-23 Thread Bea GD
Dear Frede, Sorry for the late reply, yesterday I was out of office. Thanks so much for your code! It has just compacted in a few lines what I had written in several 'paragraphs'! To be honest, I'm not familiar to work with lists in R. I think one of its main advantages is the reduced size

Re: [R] Fw: Save multiple plots as pdf or jpeg

2014-04-23 Thread ONKELINX, Thierry
Have a look at the knitr package. http://yihui.name/knitr/demo/minimal/ Best regards, ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie Kwaliteitszorg / team Biometrics Quality Assurance Kliniekstraat 25 1070 Anderlecht

[R] Clear selected objects from workspace

2014-04-23 Thread Bea GD
Dear R users, I've got over a hundred R objects in the workspace. They all follow a pattern for years and months. Like this: TT_1981_1, TT_1981_2, TT_1981_3, . . . . TT_1981_12 . . . TT_2010_1, . . . If now, I'd like to remove a selection of them, how is the best way to do it? Currently I

[R] Formatting with strings

2014-04-23 Thread Nico Met
Dear all, I have object where I stored clusters in the following manner: ---CLUSTER 1 --- 3 4 5 6 ---CLUSTER 2 --- 9 10 8 11 Now want to format the data in the following way: Object Cluster 31 41 51 61 9 2 10 2 8

Re: [R] Clear selected objects from workspace

2014-04-23 Thread Jim Lemon
On 04/23/2014 07:54 PM, Bea GD wrote: Dear R users, I've got over a hundred R objects in the workspace. They all follow a pattern for years and months. Like this: TT_1981_1, TT_1981_2, TT_1981_3, . . . . TT_1981_12 . . . TT_2010_1, . . . If now, I'd like to remove a selection of them, how is

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] Clear selected objects from workspace

2014-04-23 Thread Bea GD
Thank you a lot Jim. Much cleaner now! On 23.04.2014 12:01, Jim Lemon wrote: On 04/23/2014 07:54 PM, Bea GD wrote: Dear R users, I've got over a hundred R objects in the workspace. They all follow a pattern for years and months. Like this: TT_1981_1, TT_1981_2, TT_1981_3, . . . . TT_1981_12

Re: [R] detecting the sourcing of site profile on Startup versus post-Startup

2014-04-23 Thread Duncan Murdoch
On 22/04/2014, 8:59 PM, Benjamin Tyner wrote: Greetings, Is there any way to programmatically detect whether a piece of code is being run within the initial (Startup) sourcing of the site profile? For example, say I have a site profile, /path/to/Rprofile.site. Is there any function my_func

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

2014-04-23 Thread Frede Aakmann Tøgersen
Well if 1= f(x) then 1 - f (x) = 0 So to find the x that solves the first equation you just need find the root of 1 - f (x) due to the second equation. That's pretty simple mathematics. Please check your equation and the values of the parameters you have from your source since I was just

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

Re: [R] Formatting with strings

2014-04-23 Thread jim holtman
try this: x - readLines(textConnection(---CLUSTER 1 --- + 3 + 4 + 5 + 6 + ---CLUSTER 2 --- + 9 + 10 + 8 + 11)) # create a list of where the 'clusters' are clust - c(grep(CLUSTER, x), length(x) + 1L) # get size of each cluster clustSize - diff(clust) - 1L # get cluster number clustNum -

Re: [R] Formatting with strings

2014-04-23 Thread Nico Met
Many thanks Jim. It works for my large data set! Best Regards Nico On Wed, Apr 23, 2014 at 1:45 PM, jim holtman jholt...@gmail.com wrote: try this: x - readLines(textConnection(---CLUSTER 1 --- + 3 + 4 + 5 + 6 + ---CLUSTER 2 --- + 9 + 10 + 8 + 11)) # create a list of where

[R] accessing the date stamp from an xts object

2014-04-23 Thread Erin Hodgess
Hello! I have the following xts object: time [,1] 2000 Q11 2000 Q22 2000 Q33 2000 Q44 2001 Q15 2001 Q26 2001 Q37 2001 Q48 I would like to access the date stamp values. I've tried dimnames and rownames, but no success. Any advice would be much

Re: [R] accessing the date stamp from an xts object

2014-04-23 Thread Erin Hodgess
Solved again. index(time) in case anyone wants to know. Nothing like posting to the list to solve a problem! Thanks, Erin On Wed, Apr 23, 2014 at 8:11 AM, Erin Hodgess erinm.hodg...@gmail.comwrote: Hello! I have the following xts object: time [,1] 2000 Q11 2000 Q2

[R] Derivative of expm function

2014-04-23 Thread Wagner Bonat
Hi all ! I am look for some efficient method to compute the derivative of exponential matrix function in R. For example, I have a simple matrix like log.Sigma - matrix(c(par1, rho, rho, par2),2,2) require(Matrix) Sigma - expm(log.Sigma) I want some method to compute the derivatives of Sigma

[R] meta-question about R

2014-04-23 Thread m . roth
This really isn't about R, but configuring R. We're running R 3.0.2-1, the current default package, on CentOS 6.5 On a long-running job, R is creating files in /dev/shm: each set of three files are named (8 hex digits)-(4 hex digits)-(4 hex digits)-(4 hex digits)-(12 hex digits), and then

[R] Errors with stConstruct() and STFDF()

2014-04-23 Thread Cyrus Mohammadian
Hey everyone, I’m new to R and this forum so I apologize in advance for any ambiguity in my question. What I want to do is create a spatiotemporal object (class st) out of an esri shapefile with multiple features and csv file containing data in long format (each row is one observation in

[R] cannot load rcmdr

2014-04-23 Thread Mickael Vieira Da Silva
After install the package RCMDR, I try to load it and it always apears the same error message: Error : .onAttach failed in attachNamespace() for 'Rcmdr', details: call: Commander() error: could not find function assignInMyNamespace Error: package/namespace load failed for 'Rcmdr' I have

Re: [R] R Example scripts

2014-04-23 Thread William Dunlap
library(bayesm) Rd - utils:::.getHelpFile(?rwishart) tools::Rd2ex(Rd) Or you could use example() to get a character vector of the example code in a help file. library(bayesm) example(rwishart, give.lines=TRUE) Bill Dunlap TIBCO Software wdunlap tibco.com -Original Message-

[R] packages implementing graph algorithms

2014-04-23 Thread Tom Wright
Are there any packages implementing graph search algorithms? I'm looking for the equivalent of matlab findshortestpath in the bioinfomatics toolbox. Thanks, Tom __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE

[R] illumina array - remove probes in discontinued genes

2014-04-23 Thread Kripa R
Hi I'm working with the illumina HT-12v4 array and after using LIMMA some of the most significant probes that come up are in genes that have been discontinued on NCBI (ie LOC732450). Is there a way to filter my data of these probes prior to statisitcal analysis? Thanks, .kripa

Re: [R] packages implementing graph algorithms

2014-04-23 Thread Bert Gunter
I would suggest you post this to the Bioconductor list. You might also have a look at the CRAN gR task view if you haven't already done so -- though no guarantees of finding what you want here, of course. Cheers, Bert Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374 Data is not

Re: [R] fitting a family of curves

2014-04-23 Thread Greg Snow
Can you provide some sample data and the family of curves that you would like to fit? Reproducible examples greatly increase your chances of receiving a useful response. On Wed, Apr 23, 2014 at 12:33 AM, andreas betz abet...@gmail.com wrote: Hello, is it possible to fit a group of curves

[R] Analysis of censored cost data

2014-04-23 Thread Paul Miller
Hello All, Am intested in using R to analyze censored cost data. Looks like I'd need to estimate some means and associated variances. I've got a few papers describing this. These talk about the use of re-weighted estimators (Lin), inverse probability weighted estimators (Bang-Tsiatis),

Re: [R] Analysis of censored cost data

2014-04-23 Thread Rich Shepard
On Wed, 23 Apr 2014, Paul Miller wrote: Am intested in using R to analyze censored cost data. Paul, What are censored cost data? Too high to be affordable; too low to cover materials? My best guess so far is the NADA package. Not sure if this is the best thing to do what I need though.

[R] Request for R Initial value of MLE

2014-04-23 Thread farrukh jamal
Sir I have this problem,      res - maxLik(logLik=loglik1,start=c(a=1.5,b=1.5,c=1.5,dee=2),method=BFGS) There were 50 or more warnings (use warnings() to see the first 50) summary(res) Maximum Likelihood estimation BFGS maximisation, 0 iterations Return code 100: Initial value out of range.  

Re: [R] Formatting with strings

2014-04-23 Thread arun
Hi,   You could try: Lines1 - readLines(textConnection(---CLUSTER 1 --- 3 4 5 6 ---CLUSTER 2 --- 9 10 8 11)) indx - grepl(CLUSTER, Lines1) res - data.frame(Object=Lines1[!indx], Cluster= as.numeric(as.character(factor(cumsum(indx)[-which(indx)], labels=gsub(\\D+,,Lines1[indx]) res A.K.

[R] escape characters for apostrophes in a .csv file

2014-04-23 Thread Simon Kiss
Hello: I have a .csv file that includes some character strings (open ended survey responses) that includes some apostrophe. Using read.csv() the file reads in just fine, except upon being read in the apostrophes are displayed with the double-slash, i.e. 'I've' becomes 'I\\'ve'. I'd like to

Re: [R] escape characters for apostrophes in a .csv file

2014-04-23 Thread Duncan Murdoch
On 23/04/2014 4:09 PM, Simon Kiss wrote: Hello: I have a .csv file that includes some character strings (open ended survey responses) that includes some apostrophe. Using read.csv() the file reads in just fine, except upon being read in the apostrophes are displayed with the double-slash,

[R] running something similar to bootstrap

2014-04-23 Thread Monaly Mistry
Hi, I've made a matrix with my first row being nest numbers and my second row being a score for individuals in that nest. Row after that contain the difference in score for that individual and its neighbour - i assigned a formula to each element (thus all the columns have different lengths, but

Re: [R] meta-question about R

2014-04-23 Thread Jim Lemon
On 04/23/2014 11:58 PM, m.r...@5-cent.us wrote: This really isn't about R, but configuring R. We're running R 3.0.2-1, the current default package, on CentOS 6.5 On a long-running job, R is creating files in /dev/shm: each set of three files are named (8 hex digits)-(4 hex digits)-(4 hex

Re: [R] cannot load rcmdr

2014-04-23 Thread John Fox
Dear Mickael, assignInMyNamespace() is a standard R function, in the tools package, and so with up-to-date versions of R and the Rcmdr package, you should not be experiencing this problem. Can you provide some more information, such as the operating system you're using, the R version (current

[R] rgl and axes3d() labels

2014-04-23 Thread Alex Reynolds
I am making an rgl-based 3d plot. It works fine, except when I try to remove axis value labels and tick marks with axes3d(labels=FALSE, ticks=FALSE): --- rgl.open() offset - 50 par3d(windowRect=c(offset, offset, 1280+offset, 1280+offset)) rm(offset) rgl.clear()

Re: [R] rgl and axes3d() labels

2014-04-23 Thread Alex Reynolds
Unfortunately, that doesn't help as it removes axis lines. It looks like I can't use segments3d() without knowing what the bounds are of the current axes and I don't know what to call to expose those. Thanks again for your help, though, I appreciate it. Hopefully this gets fixed in a future

Re: [R] detecting the sourcing of site profile on Startup versus post-Startup

2014-04-23 Thread Benjamin Tyner
Thanks Duncan! Yes, I considered taking advantage of .First, but was concerned that the .First defined by the site profile could be masked by a possible .First defined by the user profile (I neglected to mention that --no-init-profile [sic] in the example I gave was a

Re: [R] detecting the sourcing of site profile on Startup versus post-Startup

2014-04-23 Thread Jeff Newmiller
Regardless of whether this is possible, it seems like a bad idea (side effects in a functional programming environment). If you want to do something special in startup then write a different function that does that stuff and then call the desired functions explicitly when you want them to be

Re: [R] Loops (run the same function per different columns)

2014-04-23 Thread arun
HI, I guess you got an output like this using my script: ##Please use ?dput() to show the example data. FA - structure(list(Sample = c(L1 Control, L1 Control, L1 Control, BBM Control, BBM Control, BBM Control, L1 Ash, L1 Ash, L1 Ash, BBM Ash, BBM Ash, BBM Ash), C14.0 = c(0.456509192,

Re: [R] aggregate help

2014-04-23 Thread arun
Hi, Please use ?dput() to show the datasets as one of the rows (Id four) in first dataset didn't show 11 elements. df1 - structure(list(Id = c(one, one, two, two, three, three, three, four, five, five), col1 = c(a1, NA, b1, b1, NA, NA, c1, d1, e1, NA), col2 = c(a2, NA, b2, b2, c2, NA, c2,

Re: [R] Hi , Is it possible select a different number of rows by each group with R????

2014-04-23 Thread arun
Hi Marta, If you need random selection, you could use: do.call(rbind,lapply(split(dat2,dat2$field1),function(x) x[sample(1:nrow(x),dat1$field2[!is.na(match(dat1$field1,x$field1))],replace=FALSE),])) A.K. On Tuesday, April 22, 2014 1:45 PM, arun smartpink...@yahoo.com wrote: Hi Marta, It's

Re: [R] meta-question about R

2014-04-23 Thread William Dunlap
Aren't those files support for named semaphores (made with sem_open())? Packages like BH and RSQLite contain calls to sem_open. Is your long-running R process using such a package? I don't think you would want to delete those files, but perhaps you can look into whatever R package creates them

Re: [R] meta-question about R

2014-04-23 Thread m . roth
Jim Lemon wrote: On 04/23/2014 11:58 PM, m.r...@5-cent.us wrote: This really isn't about R, but configuring R. We're running R 3.0.2-1, the current default package, on CentOS 6.5 On a long-running job, R is creating files in /dev/shm: each set of three files are named (8 hex digits)-(4 hex

Re: [R] Loops (run the same function per different columns)

2014-04-23 Thread CRoa
Hi Arun, Your script works but it does not do what I was after. To be a bit more specific, this the table FA in which Im working on ( but the original one has 34 fatty acids instead of 3: C14.0, C15.0, and C15.1). SampleC14:0C15:0C15:1 L1 Control0.4565091920.4695626870.774909216 L1

[R] INET_NTOA equivalent?

2014-04-23 Thread Dr Eberhard Lisse
In MySQL SELECT INET_ATON('127.0.0.1') returns the integer 2130706433 Is there a function in R to reverse that, ie so that something like ip - inet_ntoa(2130706433) would put '127.0.0.1' into ip? greetings, el __