[R] missing NEWS.pdf

2019-09-10 Thread Jim Maas
I usually compile my own version of R on Ubuntu, now 18.04 and it works
fine. I recently tried to compile v 3.6.1 and it all worked until the end
of the "make install" which did not complete because it said it was missing
"NEWS.pdf".  Is this a bug or oversight, or have I done something wrong?
Thanks
J

-- 
Jim Maas
jimmaasuk  at gmail.com

[[alternative HTML version deleted]]

__
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 guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] problem installing Rmpi

2016-12-15 Thread Jim Maas
Can anyone tell me to start looking to fix this, when attempting to install
Rmpi on Ubuntu 16.04, just updated R version to 3.3.2


** building package indices
** testing if installed package can be loaded
Error in system2(file.path(R.home("bin"), "R"), c(if (nzchar(arch))
paste0("--arch=",  :
  error in running command
* removing ‘/usr/local/lib/R/site-library/Rmpi’

​Thanks, J​

-- 
Jim Maas

[[alternative HTML version deleted]]

__
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 guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

[R] age old problem with rJava

2016-10-27 Thread Jim Maas
I've installed oracle java 8, at least think I have and tried many things
but still getting this error.  For some reason if I run R as sudo, then the
library rJava loads just fine, but not as user.  Any suggestions most
welcome.

Ubuntu 16.04 linux, R 3.3.1 64-bit

Thanks

J


> library(rJava)
Error : .onLoad failed in loadNamespace() for 'rJava', details:
  call: dyn.load(file, DLLpath = DLLpath, ...)
  error: unable to load shared object
'/usr/local/lib/R/site-library/rJava/libs/rJava.so':
  libjvm.so: cannot open shared object file: No such file or directory
Error: package or namespace load failed for ‘rJava’


-- 
Jim Maas

[[alternative HTML version deleted]]

__
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 guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

[R] apply a function containing a reduce statement to all rows of a 2d array?

2014-03-14 Thread Jim Maas
If possible I would like to apply a function, that contains a reduce
statement, across the rows of 2d array. This code works for me right up
until the last. Can it be done or is there a better way? My next challenge
is to pass it a vector of starting values, i.e. each row will have a
different initial value.

func1 - function (x,y) {x * 0.6}
Reduce(func1, x = seq_len(10), accumulate = TRUE, init = 3)

totalfunc - function (x) {Reduce(func1, x = seq_len(10),
   accumulate = TRUE, init = 3)
   }

totalfunc(0)

startarray - t(array(1:100, c(10,10)))

newarray - apply(x = startarray, margin = 1, fun = totalfunc)


Thanks

J

-- 
Jim Maas

[[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://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] fill an array by rows

2012-02-09 Thread Jim Maas
I've dug around but not been able to find anything, am probably missing 
something obvious.


How can I fill a three-dimensional (or higher dimension) array by rows 
instead of columns.


eg

new1 - array(c(1:125), c(5,5,5))

works fine for me but fills it by columns and

new2 - array(c(1:125), c(5,5,5), byrow=TRUE)

throws an error.

Am I missing something obvious?  I also tried transposing the 3-d array 
but that didn't work either.


TIA

Jim

--
Dr. Jim Maas
University of East Anglia

__
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] constrain min and max of output

2011-10-25 Thread Jim Maas

Hello,

Is there a simple way/function to constrain the minimum and maximum 
value of an output from an assignment?


if I have

z - x +y

but I want z to always be between 1 and 5, such that z=5 if (x+y = 5)  
and z=1 if (x+y = 1).


I know it sounds simple, I can do it with if statements but just 
wondered if there is a simpler way?


Thanks a bunch,

J

--

Jim Maas
University of East Anglia

__
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] procedure Power in module Math

2011-09-04 Thread Jim Maas

Hi All,

I'm attempting to compile and run a BUGS model using OpenBUGS from R and 
getting this message.  I've googled around not found much, it may well 
be a problem with OpenBUGS and not R.  Any suggestions or clues as to 
how to find the problem would be welcome.


** Sorry something went wrong in procedure Power in module Math **


Thanks a bunch,

Jim

__
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] cannot correct step size, geweke.diag of coda

2011-09-01 Thread Jim Maas
Intermittently I'm getting this error from the geweke.diag function of 
the coda package.  Would anyone be kind enough to enlighten me as to the 
possible source of such an error, or how to debug/locate it?


Error in { : task 22 failed - inner loop 1; cannot correct step size

Thanks a bunch.

J

--
Dr. Jim Maas
University of East Anglia

__
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] deSolve, extracting variable values from inside ode function

2011-08-16 Thread Jim Maas
I'm just getting to grips with using ode function and have used the 
examples and vignettes to produce a small model of a one-pool, 
michaelis-menten, enzyme kinetic reaction. The rate of flux of substrate 
into pool A is constant (fluxoa) however the rate of flux out of pool A 
is controlled by the HMM equation (v = Vmax/ ( 1 + (Km / Concentration A 
)) ).  This function works fine and gives correct answers for the 
size of the pool of quantity of substrate in pool A at all times, 
however if possible I'd like to also extract the values of interim 
variables at each time t.  Could anyone give me a clue of how to include 
the value of CA at each time t, along with QA in the results?


Thanks

Jim

R code
==
parameters - c(vola = 17.3629, vmax = 4.7, mmk = 0.5435, fluxoa =
2.389)
state - c(QA=9.437)

MM - function(t, state, parameters) {
  with(as.list(c(state, parameters)),{
## concentration of substrate in pool A, quantity
## divided by the volume of the solvent pool
CA - QA/vola
## output of substrate from pool A
fluxao - vmax / (1 + (mmk/CA))
## rate of change of quantity of substrate
## in pool A
dA - fluxoa - fluxao
## return the rate of change
list(dA)
  })
}

times - seq(0, 100, by = 5)
library(deSolve)
out1 - ode(y = state, times = times, func = MM, parms = parameters)
head(out1)


--
Dr. Jim Maas
University of East Anglia

__
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] elegant way of removing NA's and selecting specific values from a data.frame

2011-07-06 Thread Jim Maas
I have a data.frame e and would like to extract the 23rd column, 
remove any NA's and then remove any values = 30.  I can do it in steps 
such as this but have failed to figure out how to do it in a single line 
 any suggestions?


first - e[,23]
second - first[!is.na(first)]
third - second[second=30]

thanks a bunch

J

--
Dr. Jim Maas
University of East Anglia

__
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] calculating mean of list components

2010-12-15 Thread Jim Maas
I get a list object from an iterative function.  I'm trying to figure 
out the most efficient way to calculate the mean of one element, across 
all components of the overall list.


I've tried

output - mean (listobject[[1:5]]$element)

to get the mean of element in the first five components?

It doesn't like the $.  I'm suspect one of the apply functions will 
work, but again I've not had success



Thanks a bunch.

J


Jim Maas
University of East Anglia

__
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] simplify if statement in R ?

2010-07-20 Thread Jim Maas
I found a form of the if statement that works but it is very long.  I'm 
attempting to check the value of of two different variables to see if 
they evaluate to either of two different values, which will result in a 
division by 0 in the final equation.  This first if statement works for me

___

 if ((x0.trial01 == 0.0)||(x0.trial01 == npt01)||(x1.trial01 == 
0.0)||(x1.trial01 == npt01))

{
x0.trial01.in - x0.trial01 + 0.5
x1.trial01.in - x1.trial01 + 0.5
npt01.in - npt01 + 1.0
}
else
{
x0.trial01.in - x0.trial01
x1.trial01.in - x1.trial01
npt01.in - npt01
}
__

I've tried
if ( ( x0.trial01 || x1.trial01) == ( 0.0 || npt01) )
..


but it doesn't seem to work correctly.  Is there a simpler way to check 
two variables for two different valuables?


Thanks

J


Jim Maas

__
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.