Displaying 20 results from an estimated 9000 matches similar to: "Use of .Fortran"
2016 Mar 04
3
ALLOCATE in a FORTRAN subroutine
Hi,
I am a FORTRAN developer and I am 'translating' R functions in FORTRAN subroutines. I am 'new' to R. It's my first question in this mailing-list and English is not my natural language.
Very often, an R function gives an 'array' as result and you don't have to bother with the dimension of the array : R creates automatically an array with the good length.
2016 Mar 07
4
ALLOCATE in a FORTRAN subroutine
Hi Martyn,
Many thanks for your answer. If I make it short :
we can, once we know how to do it, 'drive' R from within FORTRAN for example to do a
Myarray = seq(0, mydimension)
in R once we have compute mydimension in FORTRAN. Is that correct ?
If yes : it's too 'complicated' for the time I am hired (I mean I have been hired to do FORTRAN code not to learn R !).
Second
2006 Feb 04
2
srt --- slope text with function?
[resent, plus small addition; I do not understand why gmail sent a
weird charset.]
Dear R wizards:
I would love to write a general function that matches the slope of a plotted
line in an xy-plot at a particular x,y location. something like
x<- (1:10)^2; y<- 40:50;
plot( x,y, type="l", xlim=c(0,90) )
srt.at5 = text.at.current.plot.with.slope( x, y, 5);
text(
2008 Aug 05
4
LIDAR Problem in R (THANKS for HELP)
Hi All,
I am a PhD student in forestry science and I am working with LiDAR data set
(huge data set). I am a brand-new in R and geostatistic (SORRY, my
background it?s in forestry) but I wish improve my skill for improve myself.
I wish to develop a methodology to processing a large data-set of points
(typical in LiDAR) but there is a problem with memory. I had created a
subsample data-base but
2017 Jun 04
1
nmax parameter in factor function
I'll go just a bit "fer-er." It appears the anomaly -- I hesitate to
call it a bug -- is in the C code for duplicated.default():
> duplicated(letters[1:10],nmax=10)
[1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
> duplicated(letters[1:10],nmax=9)
[1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE
> duplicated(letters[1:10],nmax=8) ## for
2017 Jun 04
0
nmax parameter in factor function
Well, you won't like this, but it is kind of wimpily (is that a word?)
documented:
If you check the code of factor(), you will see that nmax appears as
an argument in a call to unique(). ?unique says for nmax, "... see
duplicated" . And ?duplicated says:
"If nmax is set too small there is liable to be an error: nmax = 1 is
silently ignored."
So sometimes you get an error
2017 Jun 04
2
nmax parameter in factor function
I have been trying to understand how the argument 'nmax' works in
'factor' function. R-Documentation states - "Since factors typically
have quite a small number of levels, for large vectors x it is helpful
to supply nmax as an upper bound on the number of unique values."
In the code below what is the reason for error when value of nmax is
24. Why did the same error not
2013 Oct 30
1
unique(1:3,nmax=1) freezes R
Dear all,
I was playing around with factor contrasts, and found the argument nmax on function factor. When using nmax=1, R froze completely, and I had to close it from task manager. After some debugging, I found that the problem is actually in unique-function, where the internal unique function is called:
.Internal(unique(x, incomparables, fromLast, nmax))
More generally, it looks like
2010 Nov 19
2
simple loop problemo (Geo brownian motion)
I would like to plot multiple random walks onto the same graph. My p
variable dictates how may random walks there will be.
par(mfrow=c(1,1))
p <- 100
N <- 1000
S0 <- 10
mu <- 0.03
sigma <- 0.2
nu <- mu-sigma^2/2
x <- matrix(rep(0,(N+1)*p),nrow=(N+1))
y <- matrix(rep(0,(N+1)*p),nrow=(N+1))
t<- (c(0:N))/N
for (j in 1:p)
{
z <- rnorm(N,0,1)
x[1,j] <- 0
y[1,j]
2016 Mar 08
2
ALLOCATE in a FORTRAN subroutine
> You can call (some) R functionality from C
When I read about 'R api' I thought that we could call all the functionality of R. I think that in the windows world, this is called OLE automation. From a pure programmer point of view, it is very convenient and my customer is creating a team of programmers. But, if only 'some' functionalities can be called, it's not so useful.
2012 Nov 12
2
how to enter a string value
hi,
I want to know just enter a string value
entering a numeric value is make with the function scan () or scan (nmax =
..)
but it does not work for string
my goal is to enter three string: name and surname and date of birth
I try with this code but it shows me errors
print ("enter the name")
name <- scan (nmax = 1)
print ("enter the first name")
firstName <- scan
2011 Mar 19
2
problem running a function
Dear people,
I'm trying to do some analysis of a data using the models by Royle & Donazio
in their fantastic book, particular the following function:
http://www.mbr-pwrc.usgs.gov/pubanalysis/roylebook/panel4pt1.fn
that applied to my data and in the console is as follows:
> `desman.y` <- structure(c(3L,4L,3L,2L,1L), .Names = c("1", "2", "3",
2005 Jun 13
1
memory allocation problem under linux
I have some compiled code that works under winXp but not under linux (kernel
2.6.10-5). I'm also using R 2.1.0
After debugging, I've discovered that in this code:
#define NMAX 256
long **box;
...
box = (long **)R_alloc(NMAX, sizeof(long *)); //<---HERE THE SIGSEGV
for (i=0; i<NMAX; i++) box[i] = (long *) R_alloc(NMAX, sizeof(long));
inside the *first* call to the
2005 Jun 12
1
memory allocation problem under linux
I have some compiled code that works under winXp but not under linux (kernel
2.6.10-5). I'm also using R 2.1.0
After debugging, I've discovered that this code:
#define NMAX 256
long **box;
...
box = (long **)R_alloc(NMAX, sizeof(long *));
gives a null pointer, so subsequent line:
for (i=0; i<NMAX; i++) box[i] = (long *) R_alloc(NMAX, sizeof(long));
gives a SIGSEGV signal.
2011 Nov 10
2
performance of adaptIntegrate vs. integrate
Dear list,
[cross-posting from Stack Overflow where this question has remained
unanswered for two weeks]
I'd like to perform a numerical integration in one dimension,
I = int_a^b f(x) dx
where the integrand f: x in IR -> f(x) in IR^p is vector-valued.
integrate() only allows scalar integrands, thus I would need to call
it many (p=200 typically) times, which sounds suboptimal. The
2012 Feb 29
1
Replace back slashes with forward slashes?
Hello, All:
What can people tell me about converting back slashes to forward
slashes in character strings?
Several years ago, Prof. Ripley provided a solution, which I lost
and have not been able to find.
Below please find a function to do this. I do not find this very
satisfactory, however, because it uses "scan" and therefore operates on
an input not a
2004 May 01
5
skip lines on a connection
Hi,
I am looking for an efficient way of skipping big chunks of lines on a
connection (not necessarily at the beginning of the file). One way is to
use read lines, e.g. readLines(1e6), but a) this incurs the overhead of
construction of the return char vector and b) has a (fairly remote)
potential to blow up the memory.
Another way would be to use scan(), e.g.
scan(con, skip=1e6, nmax=0)
2008 Feb 08
2
Applying lm to data with combn
http://www.nabble.com/file/p15359204/test.data.csv
http://www.nabble.com/file/p15359204/test.data.csv test.data.csv
Hi,
I have used apply to have certian combinations, but when I try to use these
combinations I get the error
[Error in eval(expr, envir, enclos) : object "X.GDAXI" not found]. being a
novice I donot understand that after applying combination to the data I cant
access
2006 Apr 26
2
Memory usage and limit
Hello everyone,
I recently made a 64-bit build of R-2.2.1 under Solaris 9 using gcc v.3.4.2.
The server has 12GB memory, 6 Sparc CPUs and plenty of swap space. I was the
only user at the time of the following experiment.
I wanted to benchmark R's capability to read large data files and used a
data set consisting of 2MM records with 65 variables in each row. All but 2
of the variables are of
2009 Nov 10
3
Error: cannot allocate vector of size...
I'm trying to import a table into R the file is about 700MB. Here's my first
try:
> DD<-read.table("01uklicsam-20070301.dat",header=TRUE)
Error: cannot allocate vector of size 15.6 Mb
In addition: Warning messages:
1: In scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, :
Reached total allocation of 1535Mb: see help(memory.size)
2: In scan(file, what,