[R] package.skeleton only exports the first 73 lines of code

2012-03-05 Thread jeff_hawkes
Hi all, apologies for the ignorance I'm about to describe:

I'm trying to create a .r file for a function I've written (~300 lines of
code).  The function is called 'total' and I've entered the most simple
package.skeleton:

package.skeleton(name=test, list=c(total)) 

The export works fine (it creates sub folders for R, man, and DESCRIPTION,
NAMESPACE and read-and-delete-me files, but  total.r is only 73 lines long
and the code stops in the middle of a phrase.

Is there a character limit to the export, or am I failing to do something
more complicated here? 

Thanks,
Jeff

--
View this message in context: 
http://r.789695.n4.nabble.com/package-skeleton-only-exports-the-first-73-lines-of-code-tp4447061p4447061.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-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] package.skeleton only exports the first 73 lines of code

2012-03-05 Thread jeff_hawkes
Copying the code as text into the incomplete .r file worked, good idea.  I
still don't know why the export didn't work though.

Thanks,
Jeff

--
View this message in context: 
http://r.789695.n4.nabble.com/package-skeleton-only-exports-the-first-73-lines-of-code-tp4447061p4447374.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-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Non linear regression with complex equation

2012-02-28 Thread jeff_hawkes
Apologies for the phrasing of the question.
I've sorted the problem (thanks Bert Gunter) by using the curly brackets {}
as below (using a simplified version of my real model). I hope this helps
someone else!

Jeff
---
 data
  Alpha ip   X
1 0.7106967  0.3616727 0.006027879
2 2.1678517  5.0615917 0.084359861
3 4.4066250 11.2282945 0.187138242
4 9.8495694 18.0534974 0.300891624
527.7247098 29.2064434 0.486774057
670.6931430 35.3946092 0.589910153
7   133.1240255 46.0347288 0.767245480
8   214.7851844 49.3811149 0.823018582
9   359.5511036 58.5069583 0.975115972
10  748.1840127 57.3744477 0.956240795
11 2129.9844080 60.000 1.0
 c-1.83e-9
 cFe=c
 model-nls({Fe1-cFe/(Alpha+1+k*c)
+ X~Alpha/(Alpha+1+k*c/(1+k*Fe1))},start=list(k=1e10))
 summary(model)

Formula: X ~ Alpha/(Alpha + 1 + k * c/(1 + k * Fe1))

Parameters:
   Estimate Std. Error t value Pr(|t|)
k 3.491e+10  7.190e+09   4.856 0.000665 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 

Residual standard error: 0.05589 on 10 degrees of freedom

Number of iterations to convergence: 8 
Achieved convergence tolerance: 2.393e-06 


--
View this message in context: 
http://r.789695.n4.nabble.com/Non-linear-regression-with-complex-equation-tp4425942p4427617.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-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Non linear regression with complex equation

2012-02-27 Thread jeff_hawkes
Hi all,
Is it possible to model a function where the unknown parameter appears both
in the fitted equation AND in the determination of other parameters?  E.g.

y = a^2 + b/2 + k

where a = 2/k  and b = k^2 

and the model needs to determine k?  I know this is a very simple equation
(its just an example), the one I am modelling is much more complicated! 

k appears in the equation which the n.l.r model fits, but it also affects
other parameters in the equation.  Please let me know if you know a way of
achieving this.  I realise it is possible to set up a loop where the
modelled value for k is fed back in to a and b, and the model is run again -
but it seems like there should be a more elegant way within one run of the
model.

Thanks,
Jeff

--
View this message in context: 
http://r.789695.n4.nabble.com/Non-linear-regression-with-complex-equation-tp4425942p4425942.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-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.