Displaying 20 results from an estimated 5000 matches similar to: "Matrix package breaks as.matrix method"
2017 Jan 30
0
Matrix package breaks as.matrix method
Georgi,
Brilliant, thank you very much for the helpful reply and explanation! I added 'importFrom("Matrix","as.matrix")' to my NAMESPACE and all worked fine! As my 'as.matrix' method is used entirely internally to the 'testmat' function (and not "used outside the package"), I don't think I actually need to export it. In my case, testmat is
2017 Jan 29
0
R-devel Digest, Vol 167, Issue 25
Hi,
Short answer: import 'as.matrix' and export your method(s) for it. From WRE:
"All S4 classes to be used outside the package need to be listed in an exportClasses directive. Alternatively, they can be specified using exportClassPattern.(46) in the same style as for exportPattern. To export methods for generics from other packages an exportMethods directive can be used."
2017 Jun 16
2
'ordered' destroyed to 'factor'
> On 16 Jun 2017, at 15:59 , Robert McGehee <rmcgehee at walleyetrading.net> wrote:
>
> For instance, what would you expect to get from unlist() if each element of the list had different levels, or were both ordered, but in a different way, or if some elements of the list were factors and others were ordered factors?
>> unlist(list(ordered(c("a","b")),
2007 Feb 16
0
re : array searches
Hi,
I am not sure to get the issue, but assuming your data are arranged as
in your example with dates in column x$V1 and signals as x$V2 ,
I think that you could use "rle" in the following way :
test<-rle(x$V2)
testmat<-matrix(NA,length(test$values),2)
testmat[,1]<-x[c(1,cumsum(test$length)[1:(length(test$values)-1)]+1),1]
testmat[,2]<-test$values
And you'll get your
2017 Jun 18
0
'ordered' destroyed to 'factor'
Defending the status quo misses the point that R *could* handle ordinal data with a fixed set of levels but actually *does not*. Although it would be useful. Even if this does not imply to handle any possible straw-man situations. Having data-types for nominal, ordinal, and interval-scale data is - in theory - one of the major advantages of S over SAS. But *having* without *handling* means: only
2017 Apr 05
2
Very hard to reproduce bug (?) in R-devel
On Wed, Apr 5, 2017 at 2:24 PM, Robert McGehee <rmcgehee at walleyetrading.net>
wrote:
> Winston,
> I had a similar experience to you tracking down an insanely difficult bug
> in my R code that "disappeared" whenever slight changes were made to the
> script (e.g. like adding cat() statements). In my case, it coincided with
> my over-eager compilation of R and its
2005 Mar 29
2
strange error with rw2010dev
With rw2010dev I get a strange protect(): protection stack overflow
error with a small data frame which otherwise is usable:
If anybody wants to have a look I can provide an RData file
with the problematic data frame.
Doesn't seem to be necessary, the following simulated example
generates the error:
> testmat <- matrix(1:80, 20,4)
> dim(testmat)
[1] 20 4
> str(testmat)
int
2018 Jan 22
1
as.character(list(NA))
I tend to avoid using as.<type> functions on lists, since they act oddly in
several ways.
E.g, if the list "L" consists entirely of scalar elements then
as.numeric(L) acts like
as.numeric(unlist(L)) but if any element is not a scalar there is an
error. as.character()
does not seem to make a distinction between the all-scalar and
not-all-scalar cases
but does various things with
2017 Jan 18
0
[FORGED] Taking determinant of a matrix of NAs results in intermittent memory corruption
On 19/01/17 11:54, Ian Erickson wrote:
> Greetings; I've posted the following to R's bug tracking system (at https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17210 ) and Martin Maechler requested that I post to this list as well.
> If I start R from the command line with --vanilla, then repeatedly execute the following line:
>
> det(matrix(nrow=10,ncol=10))
>
> ... I
2017 Apr 16
1
Getting high precision values from qnorm in the tail
Hello All
I am looking for high precision values for the normal distribution in the
tail,(1e-10 and 1 - 1e-10) as the R package that I am using sets any number
which is out of this range to these values and then calls the qnorm and qt
function.
What I have noticed is that the qnorm implementation in R is not symmetric
when looking at the tails. This is quite surprising to me, as it is well
known
2010 Nov 18
1
dmultinomial
Hello All,
I'm trying to run a maximum likelihood analysis using dmultinomial (i'm
avoiding dmultinom as I'd like to run it with vectors for the ML stuff).
However, I'm having a hard time getting even the simplest example
running. Any help would be greatly appreciated.
> library(mc2d)
> dmultinomial(x=c(0,0,1),prob=c(1,1,1),size=1,log=TRUE)
Error in if (ncol(x) != K)
2017 Jan 18
3
Taking determinant of a matrix of NAs results in intermittent memory corruption
Greetings; I've posted the following to R's bug tracking system (at https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17210 ) and Martin Maechler requested that I post to this list as well.
If I start R from the command line with --vanilla, then repeatedly execute the following line:
det(matrix(nrow=10,ncol=10))
... I eventually get a crash, with error:
*** Error in
2017 Jul 13
0
Extracting sentences with combinations of target words/terms from cancer patient text medical records
Hi Paul,
No need to collapse the information into a single text string, gregexpr() can take a vector of strings (sentences in your case). You can split your sentences up, number them how you want, then search for your pattern either via regex or via these extra packages you use which probably use the PCRE regex library anyway. However, as this is basically what you did, I'm not sure why
2017 Jul 13
1
Extracting sentences with combinations of target words/terms from cancer patient text medical records
Hi Robert,
Thank you for your reply. An attempt to solve this via a regular expression query is particularly helpful. Unfortunately, I don't have much time to play around with this just now. Ultimately though, I think I would like to implement a solution something along the lines of what you have done. I have a book on regular expressions that I am now starting to read. In the meantime, the
2017 Apr 05
0
Very hard to reproduce bug (?) in R-devel
On 5 April 2017 at 15:46, Winston Chang wrote:
| On Wed, Apr 5, 2017 at 2:24 PM, Robert McGehee <rmcgehee at walleyetrading.net>
| wrote:
|
| > Winston,
| > I had a similar experience to you tracking down an insanely difficult bug
| > in my R code that "disappeared" whenever slight changes were made to the
| > script (e.g. like adding cat() statements). In my case, it
2017 Mar 15
1
Error: memory exhausted (limit reached?)
Hi,
I first posted this message on r-help, but got redirected here.
I encounter a strange memory error, and I'd like some help to determine if I'm doing something wrong or if there's a bug in recent R versions...
I'm currently working on a DeepNet project @home, with an old PC with 4Gb RAM, running Ubuntu 16.04.
For efficiency reason, I preprocessed my dataset and stored it as
2017 Jul 12
0
Extracting sentences with combinations of target words/terms from cancer patient text medical records
Hi Paul,
Sounds like you have your answer, but for fun I thought I'd try solving your problem using only a regular expression query and base R. I believe this works:
> txt <- "Patient had stage IV breast cancer. Nothing matches this sentence. Metastatic and breast match this sentence. French bike champion takes stage IV victory in Tour de France."
> pattern <-
2007 Oct 21
2
xattrs: Permission denied?
I've found a(nother) bug with the xattr code:
kiwiw:~/x terpstra$ uname -a
Darwin kiwiw.lan 8.10.0 Darwin Kernel Version 8.10.0: Wed May 23
16:50:59 PDT 2007; root:xnu-792.21.3~1/RELEASE_PPC Power Macintosh
powerpc
kiwiw:~/x terpstra$ echo test > bar
kiwiw:~/x terpstra$ xattr --set broken demo bar
kiwiw:~/x terpstra$ chmod 0444 bar
kiwiw:~/x terpstra$ rsync-3.0 -aHAXSx bar
2019 Mar 21
3
prettyNum digits=0 not compatible with scientific notation
R developers,
Seems I get a bad result ("%#4.0-1e" in particular) when trying to use prettyNum digits=0 with scientific notation. I tried on both my Linux box and on an online R evaluator and saw the same problem, so it's not limited to my box at least. I see the problem in both R 3.5.3 and R 3.3.2.
options(scipen=-100)
prettyNum(1, digits=0)
[1] "%#4.0-1e"
prettyNum(2,
2016 Oct 31
1
problems with ESS 16.10-1 and R version 3.3.2
Hello everyone,
does anyone reported similar problems with ess 16.10-1 and R version 3.3.2
RC?
These are the steps I do to reproduce it
- Open any R script
- C-c C-n (or C-c C-j) on any line to start the interactive session
- the R process is started but it's hanging and emacs "freeze" (any command
is ignored)
R version 3.3.2 RC (2016-10-23 r71578) -- "Sincere Pumpkin