Hello,
I'm working on bindings for the API (for zig), and was wondering if the R's C
API guarantees it won't return null pointers?
The only reference I found in the "Writing R Extensions" manual where this not
the case is `R_tryEval` and `R_tryEvalSilent`.
Otherwise it's unclear.
The reason I c
package questions are usually better posted at r-package-devel
Bert Gunter
"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
On Mon, Nov 30, 2020 at 12:45 AM Mark Clements wrot
A colleague uses a package I maintain (rstpm2) as a dependency in their
package (rsimsum) with testing using GitHub Actions. They found that
testing failed against R versions 3.3, 3.4 and 3.5 because recent
versions of RcppArmadillo (which is a dependency in rstpm2) require
C++11. As a dependency
Hello Raj,
Please include a reproducible example. If you only give a generic error
message, the best solution we can offer is to reboot your server and try it
again.
Anyway, from the information you gave, it seems like you should ask this
question in the Rstudio community(I assume you are running
Please take this discussion elsewhere... it is off-topic here. Ivan offered
options earlier in this regard.
On August 10, 2020 11:14:22 AM PDT, Raj kapoor wrote:
>Hi John,
>
>Only the particular users getting error john. Please help me
>
>
>
>
>On Mon, 10 Aug 2020, 11:43 pm Raj kapoor,
>wrote:
Hi John,
Only the particular users getting error john. Please help me
On Mon, 10 Aug 2020, 11:43 pm Raj kapoor, wrote:
> Hi John,
>
> I have 10 user in the instance, 9 user is working and access the R studio
> app, but while access the 10th user it's getting stack usage limit issues,
> then
Hi John,
I have 10 user in the instance, 9 user is working and access the R studio
app, but while access the 10th user it's getting stack usage limit issues,
then we create the new users its working fine.
On Mon, 10 Aug 2020, 10:21 pm John Harrold,
wrote:
> Hello Raj,
>
> I've gotten this type
Hello Raj,
I've gotten this type of error in the past when I've done things like use
while loops that didn't end. Basically, I think this means you're running
out of memory. If you want more users, possibly increase the amount of ram
in your machine.
John
On Mon, Aug 10, 2020 at 6:43 AM Raj kapo
On Fri, 7 Aug 2020 22:25:32 +0530
Raj kapoor wrote:
> I have one production instance in aws, in CentoOs linux environment,
> i have 5 user to access the instance for using RStudio, In case
> R-studio working 4 users running good, while we access 5th users its
> getting error,
Sorry, R-Studio sup
Hi Team,
I have one production instance in aws, in CentoOs linux environment, i have
5 user to access the instance for using RStudio, In case R-studio working 4
users running good, while we access 5th users its getting error,
First issue : C stack usage 7970372 is too close to the limit
Second I
Hi Morgan,
In the example, please ignore
`C_set_altrep_subset_method("compressedMatrix", get_subset_func)`. You do
not have to define it to run the example.
Best,
Jiefei
On Sat, Jun 15, 2019 at 11:45 AM King Jiefei wrote:
> Hi Morgan,
>
> Thanks for the context, it seems like you want to compr
Hi Morgan,
Thanks for the context, it seems like you want to compress your matrix and
you expect the "new" matrix should contain the same amount of information
as the "old" one, it is correct?
If this is the case, since you are using C++ code, a safer but imperfect
solution is to find a C++ data
Hi Jiedei,
Thank you for your reply.
To give you a bit more context, I wrote a function that find all the
positions (index) of all small matrices inside a larger matrix. At the
beginning I pre-allocate let's say a 100 by 2 matrix. However a lot of
values might remain empty in this matrix of posti
Hi,
I don't think there is a native R API to do what you want here, but if the
matrix is only used by you and not be exported to the other user, you can
hack R data structure to achieve that goal.
Because there is not too much context of your question, I will assume the
whole point of resizing a
Please do not re-post -- you have asked this before here. As this list is
about R programming help, it is perhaps not surprising that you did not
receive a reply.
You might try R-devel instead where " Questions likely to prompt discussion
unintelligible to non-programmers or topics that are too te
Hi,
Is there a way to resize a matrix defined as follows:
SEXP a = PROTECT(allocMatrix(INTSXP, 10, 2));
int *pa = INTEGER(a)
To row = 5 and col = 1 or do I have to allocate a second matrix "b" with
pointer *pb and do a "for" loop to transfer the value of a to b?
Thank you
Best regards
Morgan
Hi,
Is there a way to resize a matrix defined as follows:
SEXP a = PROTECT(allocMatrix(INTSXP, 10, 2));
int *pa = INTEGER(a)
To row = 5 and col = 1 or do I have to allocate a second matrix "b" with
pointer *pb and do a "for" loop to transfer the value of a to b?
Thank you
Best regards
Morgan
I looked into why the coefficients differ in Gabor's example and it's because
the example mistakenly switched the order of x and y. The syntax is
roll::roll_lm(x, y), which is the same as fastLm, but the example accidentally
switched them. After correcting the example, the coefficients are all e
> jeremiah rounds
> on Thu, 21 Jul 2016 13:56:17 -0700 writes:
> I appreciate the timing, so much so I changed the code to show the issue.
> It is a problem of scale.
> roll_lm probably has a heavy start-up cost but otherwise completely
> out-performs those other vers
Hi Jeremiah: I think I wasn't that clear. I'm not suggesting the kalman
filter to deal with time varying coefficients. As Roy pointed out, one can
use the kalman filter to do regular regression where one "sees" a new data
point as each time unit passes. It can be assumed that the coefficients do
n
This may be useful:
Sven Hammarling and Craig Lucas
"Updating the QR factorization and the least squares problem"
http://eprints.ma.man.ac.uk/1192/01/covered/MIMS_ep2008_111.pdf
http://www.maths.manchester.ac.uk/~clucas/updating/
2016-07-21 20:02 GMT+02:00 jeremiah rounds :
> Hi,
>
> A not unusua
I agree that when appropriate Kalman Filter/Smoothing the higher-quality
way to go about estimating a time-varying coefficient (given that is what
they do), and I have noted that both the R package "dlm" and the function
"StructTS" handle these problems quickly. I am working on that in
parallel.
I have no idea which method produces the fastest results, but the package KFAS
has a function to do recursive regressions using the Kalman filter. One
difference is that it is not, as far as a I can telll, a moving window (so past
data are being dropped), just a recursively computed regressio
Hi Jermiah: another possibly faster way would be to use a kalman filtering
framework. I forget the details but duncan and horne have a paper which
shows how a regression can be re-computed each time a new data point is
added .I
forget if they handle taking one off of the back also which is what you
I appreciate the timing, so much so I changed the code to show the issue.
It is a problem of scale.
roll_lm probably has a heavy start-up cost but otherwise completely
out-performs those other versions at scale. I suspect you are timing the
nearly constant time start-up cost in small data. I
I would be careful about making assumptions regarding what is faster.
Performance tends to be nonintuitive.
When I ran rollapply/lm, rollapply/fastLm and roll_lm on the example
you provided rollapply/fastLm was three times faster than roll_lm. Of
course this could change with data of different di
Thanks all. roll::roll_lm was essentially what I wanted. I think maybe
I would prefer it to have options to return a few more things, but it is
the coefficients, and the remaining statistics you might want can be
calculated fast enough from there.
On Thu, Jul 21, 2016 at 12:36 PM, Achim Zeile
Jeremiah,
for this purpose there are the "roll" and "RcppRoll" packages. Both use
Rcpp and the former also provides rolling lm models. The latter has a
generic interface that let's you define your own function.
One thing to pay attention to, though, is the numerical reliability.
Especially o
Just replacing lm with a faster version would speed it up. Try lm.fit
or even faster is fastLm in the RcppArmadillo package.
On Thu, Jul 21, 2016 at 2:02 PM, jeremiah rounds
wrote:
> Hi,
>
> A not unusual task is performing a multiple regression in a rolling window
> on a time-series.A stand
Hi,
A not unusual task is performing a multiple regression in a rolling window
on a time-series.A standard piece of advice for doing in R is something
like the code that follows at the end of the email. I am currently using
an "embed" variant of that code and that piece of advice is out there
Luke,
Thanks for this point out. I started removing packages one-by-one in R
v.3.3.1. Oddly enough, it went away after I removed the Matrix package.
When I restarted R, the same version of Matrix (1.2-6) had been
"reinstalled" (?), but now no C stack error. Lets see if the others that
were having
I cannot reproduce this. My best guess is that there is a problem,
maybe a version incompatibility, with one of the packages loaded when
load("problem.method.rdata"). This includes
adegenet
apex
copula
Rcpp
DBI
sp
colorspace
and any dependencies these are bringing in.
Best,
luke
On Fri, 1 Ju
Apologies for the long post. This is an issue I have been struggling with
and I have tried to be as complete, to the point, and reproducible as
possible.
In documenting a package with roxygen2, I have come across an error that
does not occur in R 3.2.4 revised, but does occur in R 3.3.0 and 3.3.1.
Hi
I have to correct myself, this last solution is not universally valid
here a better one:
tmp1 <- ( 1 - outer( max( x):1, x, FUN='-'))
tmp1[ tmp1 > 0]
On 2015-09-17 21:06:30, Frank Schwidom wrote:
>
> how abount a more complicated one?
>
> outer( 1:5, 1:5, '-')[ outer( 1:5, 1:5, '>')]
> [
Note that:
>> Also not sure about efficiency but somewhat shorter...
>> unlist(lapply(5:1, seq))
>>
>>> Peter
>>>
is almost exactly sequence(5:1)
which is
unlist(lapply(5:1,seq_len))
which is "must preferred". See ?seq for details
Cheers,
Bert
>>> On Thu, Sep 17, 2015 at 11:19 AM, Dan D
If you are interested in speed for long input vectors try the following,
which should give the same result as sequence().
mySequence <-function (nvec)
{
nvec <- as.integer(nvec)
seq_len(sum(nvec)) - rep(cumsum(c(0L, nvec[-length(nvec)])),
nvec)
}
E.g.,
> n <- rpois(1e6, 3)
> system
Very nice variety of solutions to create c(1:n, 1:(n-1), 1:(n-2), ... , 1)
#Testing the methods with n=1000 (microbenchmark)
n<-1000
# by far the nicest-looking, easiest to follow, and fastest is Frank
Schwidom's:
# it also requires the minimum amount of memory (as do several of the
others)
# 2.7
how abount a more complicated one?
outer( 1:5, 1:5, '-')[ outer( 1:5, 1:5, '>')]
[1] 1 2 3 4 1 2 3 1 2 1
On Thu, Sep 17, 2015 at 11:52:27AM -0700, David Winsemius wrote:
> You can add this to the list of options to be tested, although my bet would
> be placed on `sequence(5:1)`:
>
> > Reduce
I'm not too sure this is any better:
n<-5
c<-0; # establish result as numeric
for(i in seq(n,1,-1)){ c<-c(c,seq(1,i)); str(c); }; #generate array
c<-c[2:length(c)]; #remove the leading 0
If you're a fan of recursive programming:
> mklist <- function(x) { if (x==1) return(1) else return(
c(seq(1,
You can add this to the list of options to be tested, although my bet would be
placed on `sequence(5:1)`:
> Reduce( function(x,y){c( 1:y, x)}, 1:5)
[1] 1 2 3 4 5 1 2 3 4 1 2 3 1 2 1
On Sep 17, 2015, at 11:40 AM, Achim Zeileis wrote:
> On Thu, 17 Sep 2015, Peter Langfelder wrote:
>
>> Not sur
On Thu, 17 Sep 2015, Peter Langfelder wrote:
Not sure if this is slicker or easier to follow than your solution,
but it is shorter :)
do.call(c, lapply(n:1, function(n1) 1:n1))
Also not sure about efficiency but somewhat shorter...
unlist(lapply(5:1, seq))
Peter
On Thu, Sep 17, 2015 at 11:
sequence( 5:1)
Regards.
On Thu, Sep 17, 2015 at 11:19:05AM -0700, Dan D wrote:
> Can anyone think of a slick way to create an array that looks like c(1:n,
> 1:(n-1), 1:(n-2), ... , 1)?
>
> The following works, but it's inefficient and a little hard to follow:
> n<-5
> junk<-array(1:n,dim=c(n,n)
Not sure if this is slicker or easier to follow than your solution,
but it is shorter :)
do.call(c, lapply(n:1, function(n1) 1:n1))
Peter
On Thu, Sep 17, 2015 at 11:19 AM, Dan D wrote:
> Can anyone think of a slick way to create an array that looks like c(1:n,
> 1:(n-1), 1:(n-2), ... , 1)?
>
>
Can anyone think of a slick way to create an array that looks like c(1:n,
1:(n-1), 1:(n-2), ... , 1)?
The following works, but it's inefficient and a little hard to follow:
n<-5
junk<-array(1:n,dim=c(n,n))
junk[((lower.tri(t(junk),diag=T)))[n:1,]]
Any help would be greatly appreciated!
-Dan
-
On 08/04/2015 16:00, Sebastian L wrote:
Hi,
I am trying to use the parallel computing cluster of our university. To that
end, I would like to install the Rmpi package on the cluster. The R version
currently installed on the cluster is
This was a matter for the R-devel list as it involves com
Support for long vectors (and hence R_xlen_t) was introduced in R 3.0.0.
Your version is far outdated. If you wait a teeny but longer (after April
16) to update, you'll get R 3.2.0.
Henrik
On Apr 8, 2015 08:00, "Sebastian L" wrote:
> Hi,
>
> I am trying to use the parallel computing cluster of
Hi,
I am trying to use the parallel computing cluster of our university. To that
end, I would like to install the Rmpi package on the cluster. The R version
currently installed on the cluster is
R version 2.15.2 (2012-10-26) -- "Trick or Treat"
Platform: x86_64-redhat-linux-gnu (64-bit)
I am
I will keep this short as this might be the wrong list:
I have found one (beta) project that allows R to interface with C#.
Are there others? Any favorites.
Best,
KW
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.eth
Diogo,
For a gentle introduction to package creation see Hadley Wickham's book in
progress on the subject at http://r-pkgs.had.co.nz. This site is particularly
accessible if you use RStudio, but is not dependent on its use.
I use very simple packages that are not designed to be used by others t
On 21/11/2014, 3:02 PM, Diogo André Alagador wrote:
> Hi all,
>
>
>
> I need some assistance regarding the use of C project (set of programming
> files) as R functions in Windows OS.
>
> By now I really would like to avoid package-building.
>
> What are the steps to undergo or where can I ch
Hi all,
I need some assistance regarding the use of C project (set of programming
files) as R functions in Windows OS.
By now I really would like to avoid package-building.
What are the steps to undergo or where can I check to perform that
successfully?
Thanks in advance,
My best regard
Well duh -- type "c.Date" at the command prompt to see what is going on. I suspected I
was being dense.
Now that the behaior is clear can I follow up on David W's comment that redfining the
c.Date function as
structure(c(unlist(lapply(list(...), as.Date))), class = "Date")
allows for a
On Oct 3, 2014, at 7:19 AM, Therneau, Terry M., Ph.D. wrote:
> I'm a bit puzzled by a certain behavior with dates. (R version 3.1.1)
>
> > temp1 <- as.Date(1:2, origin="2000/5/3")
> > temp1
> [1] "2000-05-04" "2000-05-05"
>
> > temp2 <- as.POSIXct(temp1)
> > temp2
> [1] "2000-05-03 19:00:00 CD
On Oct 3, 2014, at 7:19 AM, Therneau, Terry M., Ph.D. wrote:
> I'm a bit puzzled by a certain behavior with dates. (R version 3.1.1)
>
> > temp1 <- as.Date(1:2, origin="2000/5/3")
> > temp1
> [1] "2000-05-04" "2000-05-05"
>
> > temp2 <- as.POSIXct(temp1)
> > temp2
> [1] "2000-05-03 19:00:00 CD
I'm a bit puzzled by a certain behavior with dates. (R version 3.1.1)
> temp1 <- as.Date(1:2, origin="2000/5/3")
> temp1
[1] "2000-05-04" "2000-05-05"
> temp2 <- as.POSIXct(temp1)
> temp2
[1] "2000-05-03 19:00:00 CDT" "2000-05-04 19:00:00 CDT"
So far so good. On 5/4, midnight in Greenwich it
On 03/09/2014 13:28, Filippo Monari wrote:
Hi,
I'd like to know what is the difference between the functions .C() and
.Fortran.
I noticed that by enclosing my F90 subroutines in modules .Fortran()
can't find them any more in the load table, while .C() still can. I also
checked that the subroutine
Hi,
I'd like to know what is the difference between the functions .C() and
.Fortran.
I noticed that by enclosing my F90 subroutines in modules .Fortran()
can't find them any more in the load table, while .C() still can. I also
checked that the subroutine was loaded with the is.loaded() function
On 23.06.2014 23:52, Marc Girondot wrote:
When two POSIXlt objects are combine with c(), they lost their tzone
attribute, even if they are the same.
I don't know if it is a feature, but I don't like it !
Marc
> es <- strptime("2010-02-03 10:20:30", format="%Y-%m-%d %H:%M:%S",
tz="UTC")
> es
This is a rope. Don't push it. Been there, been swatted.
The current structure of R cannot support vectors of POSIXt timestamps
that have different tzones in different elements. You can keep a parallel
vector of tzones separately and manage environment variable TZ as needed
if you really must
When two POSIXlt objects are combine with c(), they lost their tzone
attribute, even if they are the same.
I don't know if it is a feature, but I don't like it !
Marc
> es <- strptime("2010-02-03 10:20:30", format="%Y-%m-%d %H:%M:%S",
tz="UTC")
> es
[1] "2010-02-03 10:20:30 UTC"
> attributes(
: Re: [R] C: drive memory full
One program that I have found valuable in looking at the size of files on
disk is SequoiaView. It creates a 'treemap' of the sizes of the files and
lets you zoom in to specific directories and such.
Jim Holtman
Data Munger Guru
What is the problem th
...@r-project.org]
> On Behalf Of jwd
> Sent: Tuesday, June 17, 2014 8:10 PM
> To: r-help@r-project.org
> Subject: Re: [R] C: drive memory full
>
> On Tue, 17 Jun 2014 12:48:54 +
> "Hiyoshi, Ayako" wrote:
>
> > Dear Martyn and Professor Ripley,
> >
tion, TX 77840-4352
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of jwd
Sent: Tuesday, June 17, 2014 8:10 PM
To: r-help@r-project.org
Subject: Re: [R] C: drive memory full
On Tue, 17 Jun 2014 12:48:54 +
"Hiyoshi, Ayako"
On Tue, 17 Jun 2014 12:48:54 +
"Hiyoshi, Ayako" wrote:
> Dear Martyn and Professor Ripley,
>
> Thank you so much for your help. I used Window's large file search
> (it was useful! thank you), but there is no big files detected in C:
> drive . Perhaps I will have to reinstall Windows..
>
The
yn Byng
> Sent: 17 June 2014 12:10
> To: Hiyoshi, Ayako; Prof Brian Ripley; r-help@R-project.org
> Subject: RE: [R] C: drive memory full
>
> Hi,
>
> Try
>
> http://social.technet.microsoft.com/wiki/contents/articles/19295.windows-8-how
> -to-search-for-large-files
Ayako
From: Martyn Byng
Sent: 17 June 2014 12:10
To: Hiyoshi, Ayako; Prof Brian Ripley; r-help@R-project.org
Subject: RE: [R] C: drive memory full
Hi,
Try
http://social.technet.microsoft.com/wiki/contents/articles/19295.windows-8-how-to-search-for-large-files.aspx
M
drive ?
I called IT support, but they could not spot either.
Kind regards,
Ayako
From: Prof Brian Ripley
Sent: 17 June 2014 10:37
To: Hiyoshi, Ayako; r-help@R-project.org
Subject: Re: [R] C: drive memory full
tempdir() is specific to an R session.
Ripley; r-help@R-project.org
Subject: Re: [R] C: drive memory full
Dear Professor Ripley,
Thank you so much for your quick reply.
I tried 'dianame(tempdir())' and removed several 'Rtemp' and all other files.
Unfortunately it did not changed C: drive space much.
I am rea
14 10:37
To: Hiyoshi, Ayako; r-help@R-project.org
Subject: Re: [R] C: drive memory full
tempdir() is specific to an R session.
Start up R and run
dirname(tempdir())
and look at that directory. Shut down R, then remove all old
files/folders in that directory, especially those beginning with 'R
tempdir() is specific to an R session.
Start up R and run
dirname(tempdir())
and look at that directory. Shut down R, then remove all old
files/folders in that directory, especially those beginning with 'Rtmp'.
An R process tries to clean up after itself but
- it cannot do so if it segfaul
Dear R users,
Hello, I am new to R and confused about my PC's memory space after using R a
while.
My PC is Windows 8, RAM 8GB. I have run some analyses using commands like
"vglm", "aalen(Sruv())", lm()... some regressions.
I also use Stata, and when I tried to run Stata (big file), Stata
No, because I have never used Boot, or tried to use plot.boot... I just know
that there are three main styles of plotting in R and the manual pages are
usually informative on which is in use. I am glad you figured out a better
solution though, and thanks for reporting back.
-
On 1 June 2014 22:07, Jeff Newmiller wrote:
Read ?plot.boot, in particular the Side Effects section. Not a very
> friendly function... you will have to modify it if you wish to proceed.
>
I guess you were expecting me to come back at some stage to say that I'd
figured out the -Boot- package of r
.OO#. .OO#. rocks...1k
> ---
> Sent from my phone. Please excuse my brevity.
>
> On June 1, 2014 1:20:45 PM PDT, Clive Nicholas
> wrote:
> >R 3.1.0 / RStudio 0.98.507 / OpenSUSE Linux 13.1
> >
On 1 June 2014 22:07, Jeff Newmiller wrote:
> Read ?plot.boot, in particular the Side Effects section. Not a very
> friendly function... you will have to modify it if you wish to proceed.
Thank you. I shall check this out later and may return with queries,
but only if absolutely necessary.
---
Sent from my phone. Please excuse my brevity.
On June 1, 2014 1:20:45 PM PDT, Clive Nicholas
wrote:
>R 3.1.0 / RStudio 0.98.507 / OpenSUSE Linux 13.1
>
>I'm having difficulties getting -par(mfrow=c(r,c))- to work as it
>should
>after
R 3.1.0 / RStudio 0.98.507 / OpenSUSE Linux 13.1
I'm having difficulties getting -par(mfrow=c(r,c))- to work as it should
after running bootstrapped regression models using -boot-. An example
(tested):
test=data.frame(A=rnorm(500, mean=2.72, sd=5.36),
B=sample(c(12,20,24,28,32),size=500,p
Dear R Users---
I spent some time implementing the AS75 WLS regression algorithm in C
in order to learn the R interface to C. I did not find an easy, brief
C+R example of an algorithm that used persistent storage across calls.
they probably exist, but I could not find a nice brief template for
m
I'm working with some old code that worked under R 2.15.3 but gives an error
under 3.0.0 and 3.0.1 :
> 1.0 - .C("psmirnov2x", p = as.double(10.0), as.integer(1000),
> as.integer(1000))$p
Error in .C("psmirnov2x", p = as.double(10), as.integer(1000),
as.integer(1000)) :
C symbol name "psmirnov
lp-boun...@r-project.org] On
Behalf
Of Lourdes Peña Castillo
Sent: Tuesday, January 22, 2013 9:26 AM
To: r-help@r-project.org
Subject: [R] c(), rbind and cbind functions - why type of resulting object is
double
Hello Everyone,
I am using R 2.15.0 and I came across this behaviour and I was wonderi
ble"
Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
> Behalf
> Of Lourdes Peña Castillo
> Sent: Tuesday, January 22, 2013 9:26 AM
> To: r-help@r-project.org
Hello Everyone,
I am using R 2.15.0 and I came across this behaviour and I was wondering
why I don't get an integer vector or and integer matrix with the following
code:
> z <- c(1, 2:0, 3, 4:8)
> typeof(z)
[1] "double"
> z <- rbind(1, 2:0, 3, 4:8)
Warning message:
In rbind(1, 2:0, 3, 4:8) :
quot;]])
n seed
13
Bill Dunlap
Spotfire, TIBCO Software
wdunlap tibco.com
> -Original Message-
> From: William Dunlap
> Sent: Wednesday, November 07, 2012 1:24 PM
> To: 's...@gnu.org'; r-help@r-project.org
> Subject: RE: [R] c weirdness
>
> Your
TIBCO Software
wdunlap tibco.com
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
> Behalf
> Of Sam Steingold
> Sent: Wednesday, November 07, 2012 12:53 PM
> To: r-help@r-project.org
> Subject: [R] c weirdness
>
>
On 07/11/2012 3:53 PM, Sam Steingold wrote:
is there a way to avoid c() appending ".0" and ".1" to seed?
Don't give it a named vector. You can use the unname() function to
strip the names from tab:
c("nons"=1, "seed"=unname(tab[1]))
--8<---cut here---start-
is there a way to avoid c() appending ".0" and ".1" to seed?
--8<---cut here---start->8---
> c("nons"=1, "seed"=3)
nons seed ## good!
13
> c("nons"=1, "seed"=tab[1])
nons seed.0 ## don't want ".0"!
1 2344600
First, the posting guide asks you to send questions about compiled code
to the R-devel list.
These are all classic symptoms of the use of uninitialized variables or
writing out of bounds, but of which you can catch by using valgrind: see
'Writing R Extensions'. They are much harder to find on
Dear all
I have written a function in C++ , equil_distC, that I am calling from an R
script.
In the last few days, R has repeatedly crashed when calling this function, or
delivered obviously wrong outputs. However, when I restarted R after the crash,
the results turned out to be OK most of t
Hi, Prof. Ripley, Bert:
Thanks for the comments.
Might there be a function similar to "c" but retains more
attributes than just names?
Before I write such, I felt a need to ask if anyone knows where
it may already have been done -- and if people have suggestions for how
On 09/07/2012 07:12, Bert Gunter wrote:
Spencer:
Just for fun, may I hazard a guess: It would be messy to retain time zones
if your were concatenating objects with more than one time zone among them.
Actually, impossible as the design allows for only one timezone for each
object.
"Normaliz
Spencer:
Just for fun, may I hazard a guess: It would be messy to retain time zones
if your were concatenating objects with more than one time zone among them.
"Normalizing" everything to a single zone probably also makes subsequent
operations on the results much easier.
Not that it couldn't be
Hello:
What is the recommended method for retaining the tzone attributes
when concatonating POSIXct objects?
(d1 <- ISOdate(1970,1,1)) # Sets the tzone attribute = GMT
[1] "1970-01-01 12:00:00 GMT"
(d1.2 <- c(d1, d1)) # c(..) strips the tzone attribute, displays in
the time zone of
Hello:
I have some C++ code and I want to know if it is ok to load it into R using
.Call.
Also, what's the difference between using Rdefines.h or Rinternals.h
headers? It is just in the used macros?
I've been reading "Writing R Extensions" but I'm a bit confused.
Thanks,
Frederi
Dear all,
I am reading C++ code that is called in an R package. It is not clear to me
what SET_STRING_ELT, getAttrib, etc exactly do.
I understand that these are macros that have been declared in Rinternals.h and
who are used for the correct "translation" of the R data structures, but I have
n
almost certainly you restored an old workspace with a conflicting
definition of the c function.
type
c
to confirm,
also type
conflicts(detail=TRUE)
The repair is to remove the conflicting definition
rm(c)
The long term solution is to adopt the recommended practice of not saving
your worksp
My guess is that somewhere you've accidentally redefined "c" to be
another function. Try this:
Open the Terminal and type
R --vanilla
this will start R totally clean and then try
c(4,7,7)
c(1, 7:9)
I bet your issues go away. If that's the case, you can probably fix
things by clearing your old
Hi,
My best guess is that the c() you want to be calling is not the c()
you are calling. This can happen if it is masked by a function
definition in you global environment or in a package you load. What
happens when you type:
c
at the console? Also, from one of your sessions where it , c(), d
I recently changed to Mac OS X 10.7.3 from Windows and this simple function
is giving errors.
> c(4,7,7)
Error in c(4, 7, 7) : unused argument(s) (7)
> c(1,7:9)
Error in d[i, ] : incorrect number of dimensions
> c(1:5, 10.5, "next")
Error in c(1:5, 10.5, "next") : unused argument(s) ("next")
Sent from my iPod
__
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.
Hello,
I'm implementing a package (C-extension),
where one function gets data and a function
that needs to be applied to the data.
I want to apply the function to (parts of)
the data on the C-side.
1) how do I apply a function (given via SEXP) to data
2) how do I select parts of the data?
Comme
1 - 100 of 201 matches
Mail list logo