Displaying 20 results from an estimated 1000 matches similar to: "unique(1:3,nmax=1) freezes R"
2012 Apr 30
2
The constant part of the log-likelihood in StructTS
Dear all,
I'd like to discuss about a possible bug in function StructTS of stats
package. It seems that the function returns wrong value of the
log-likelihood, as the added constant to the relevant part of the
log-likelihood is misspecified. Here is an simple example:
> data(Nile)
> fit <- StructTS(Nile, type = "level")
> fit$loglik
[1] -367.5194
When computing the
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
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
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
2012 Dec 02
6
Warning message: In scan(file, what, nmax...)
Dear R-users,
When i try -
Data1<-read.table("/Users/kama/Analysis/GDP10.csv",header=TRUE,sep=";") i
am getting this error: Warning message: In scan(file, what, nmax, sep, dec,
quote, skip, nlines, na.strings, :
number of items read is not a multiple of the number of columns
I wonder what Iam doing wrong. i guess it is something simple, however, i do
not understand
2010 Jun 18
3
Use of .Fortran
I have no experience with incorporating Fortran code and am probably
doing something pretty stupid.
I want to use the following Fortran subroutine (not written by me) in
the file SSFcoef.f
subroutine SSFcoef(nmax,nu,A,nrowA,ncolA)
implicit double precision(a-h,o-z)
implicit integer (i-n)
integer l,i,nmax
double precision nu,A(0:nmax,0:nmax)
A(0,0) =
2010 Jun 18
3
Use of .Fortran
I have no experience with incorporating Fortran code and am probably
doing something pretty stupid.
I want to use the following Fortran subroutine (not written by me) in
the file SSFcoef.f
subroutine SSFcoef(nmax,nu,A,nrowA,ncolA)
implicit double precision(a-h,o-z)
implicit integer (i-n)
integer l,i,nmax
double precision nu,A(0:nmax,0:nmax)
A(0,0) =
2015 Feb 11
0
CRAN check fails on Solaris, any hints why?
Dear all,
I recently uploaded a new package Rlibeemd to CRAN (http://cran.r-project.org/web/packages/Rlibeemd/index.html, and in github: https://github.com/helske/Rlibeemd), and simple example in help files seems to throw an error on Solaris:
Version: 1.3.1
Check: examples
Result: ERROR
Running examples in ?Rlibeemd-Ex.R? failed
The error most likely occurred in:
> ### Name:
2013 Dec 20
2
Problemas con "encoding"
Buenas noches a todos,
Estoy descarganado tweets a través del paquete twitteR en dos sistemas
diferentes. La configuración del primero, un MacBook Pro, es
R version 3.0.2 Patched (2013-12-11 r64449)
Platform: x86_64-apple-darwin10.8.0 (64-bit)
locale:
[1] en_AU.UTF-8/en_AU.UTF-8/en_AU.UTF-8/C/en_AU.UTF-8/en_AU.UTF-8
attached base packages:
[1] compiler stats graphics grDevices utils
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,
2012 Jun 10
1
Convert "\" to "/"?
Hello, All:
I have for years copied an address like "C:\Program
Files\R\R-2.15.0\library\MASS\scripts" from Windows Explorer into R,
then manually replaced "\" with "/". I have a function to automate this
added to the development version of "sos". However, it generates a
warning in "R CMD check" ("parse error: unexpected