similar to: Correct way to test for exact dimensions of matrix or array

Displaying 20 results from an estimated 2000 matches similar to: "Correct way to test for exact dimensions of matrix or array"

2006 Jun 15
1
Access and assign list sub-elements using a string such as "l$a$b"
If I have a list I can set a sub-element as follows on the command line: people=list() people$tom$hair="brown" people But what if I have a string containing the name of the sub-element that I want to access? subel= "people$tom$hair" get(subel) # returns error assign(subel,"red") # silent but doesn't change list people The attempts above using assign/get
2005 May 27
0
3D density estimation with library sm - no estimate returned
Dear List, I have been trying to use library sm to do density estimation on a 3D dataset. I am using the current MacOS X binary of sm from CRAN. If I do this on a 2D dataset, sm.density returns a list including the component "estimate" which contains the density estimate over a uniform grid. When doing this with 3D data, although I get a nice plot (even when I don't ask for one),
2008 Mar 31
0
3d line smoothing
Dear R People, I would like to smooth some 3d lines, which consist of line segments specified by start and end 3d coordinates. These are experimentally derived from microscope images of neurons, so there is no sense in which one axis is any different from any other (predictor vs response). I have tried doing repeated smoothing interpolation with smooth.splines (see below), but this doesn't
2008 Apr 03
0
Reloading java classes with rJava
Dear R people, I have recently started using rJava to interact with Java code that I have written and am finding it a very useful bridge. Thanks! I have now run into a problem I can't figure out. If I edit and recompile my java source code I would like to force rJava to reload the modified java class. However even doing: .jinit(force.init=TRUE) To restart the jvm doesn't seem to do
2006 Mar 14
1
Interpolate univariate data on regular 3D grid to new 3D grid
Dear R Users, I have some data that is very similar in form to a 3D image - ie univariate data on a regular 3D grid. I keep this as a 3D numeric array in R with attributes describing the sampling points along the 3 dimensions. I would like to interpolate this onto a new regular 3D grid that I specify (eg by supplying 3 vectors corresponding to the new grid locations on each of the 3
2011 Dec 06
1
Read Windows BMP format images
Hello, Does anyone know of an R package that can read Windows BMP format images? Many thanks, Greg Jefferis. -- Gregory Jefferis, PhD Division of Neurobiology MRC Laboratory of Molecular Biology, Hills Road, Cambridge, CB2 0QH, UK. http://www2.mrc-lmb.cam.ac.uk/group-leaders/h-to-m/g-jefferis
2005 Mar 05
1
Reverse plot axes with xlim=rev(range(x)) fails with asp=1
Dear R users, I would like to reverse the axes on some xy plots (for example to set the origin at the top left rather than the bottom left). I had planned to use something of the following form: plot(y=y<-c(20,4,5,6),x=x<-c(10,20,30,40),ylim=rev(range(y))) ie reversing ylim to reverse the y axis. This works fine however I also want to use the parameter asp=1 to ensure that equal
2019 May 29
3
Making a package CITATION file from BibTeX
Dear Colleagues, I would like to provide a CITATION file for my package nat.nblast [1]. I have the correct citation in BibTeX format [2]. How can I convert this BibTeX to the format needed by R for a package CITATION file (I have a lot of other packages needing citations ...). I think what I need is the opposite of RefManageR::toBiblatex [3]. This seems like it should be a common need, so I
2013 Sep 04
4
Comments requested on "changedFiles" function
In a number of places internal to R, we need to know which files have changed (e.g. after building a vignette). I've just written a general purpose function "changedFiles" that I'll probably commit to R-devel. Comments on the design (or bug reports) would be appreciated. The source for the function and the Rd page for it are inline below. ----- changedFiles.R: changedFiles
2014 Nov 10
1
subscripting a data.frame (without changing row order) changes internal row.names
Dear R-devel, Can anyone help me to understand this? It seems that subscripting the rows of a data.frame without actually changing their order, somehow changes an internal representation of row.names that is revealed by e.g. dput/dump/serialize I have read the docs and inspected the (R) code for data.frame, rownames, row.names and dput without enlightenment. df=data.frame(a=1:10, b=1)
2012 Jul 06
0
depends/suggests when making a new generic to override a function in a user package
Dear R developers, I would like to add a new S3 generic to override a function in a user package, specifically: STAR::as.repeatedTrain I have followed the recommendation here: http://cran.r-project.org/doc/manuals/R-exts.html#Adding-new-generics doing this: as.repeatedTrain<-function(x,...){ UseMethod("as.repeatedTrain") } as.repeatedTrain.default<-function(x,...) {
2020 Aug 11
2
M[cbind()] <- assignment with Matrix object loses attributes
? Does this constitute a bug, or is there something I'm missing? assigning sub-elements of a sparse Matrix via M[X]<-..., where X is a 2-column matrix, appears to drop user-assigned attributes. I dug around in the R code for Matrix trying to find the relevant machinery but my brain started to hurt too badly ... ?? Will submit this as a bug if it seems warranted. library(Matrix) m1
2013 Nov 27
1
inflate zlib compressed data using base R or CRAN package?
Hello, I have a binary file type that includes a zlib compressed data block (ie not gzip). Is anyone aware of a way using base R or a CRAN package to decompress this kind of data (from disk or memory). So far I have found Rcompression::decompress on omegahat, but I would prefer to keep dependencies on CRAN (or bioconductor). I am also trying to avoid writing yet another C level interface to
2018 Mar 14
0
Possible Improvement to sapply
>>>>> Henrik Bengtsson <henrik.bengtsson at gmail.com> >>>>> on Tue, 13 Mar 2018 10:12:55 -0700 writes: > FYI, in R devel (to become 3.5.0), there's isFALSE() which will cut > some corners compared to identical(): > > microbenchmark::microbenchmark(identical(FALSE, FALSE), isFALSE(FALSE)) > Unit: nanoseconds > expr
2007 Sep 03
3
When 1+2 != 3 (PR#9895)
Full_Name: Marco Vicentini, University of Verona Version: 2.4.1 & 2.5.1 OS: OsX & WinXP Submission from: (NULL) (157.27.253.46) When I proceed to test the following equation 1 + 2 == 3, I obviously obtain the value TRUE. But when I tryed to do the same using real number (i.e. 0.1 + 0.2 == 0.3) I obtained an unusual FALSE. In the online help there are some tricks for this problem. It
2009 Oct 10
1
isFALSE
Hello, Just wondering why there is "isTRUE" and not "isFALSE". Romain -- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://tr.im/BcPw : celebrating R commit #50000 |- http://tr.im/ztCu : RGG #158:161: examples of package IDPmisc `- http://tr.im/yw8E : New R package : sos -------------- next part -------------- An
2003 Sep 22
1
Data frame from list of lists
This seems to be a simple problem, and I feel that there ought to be a simple answer, but I can't seem to find it. I have a function that returns a number of values as a heterogeneous list - always the same length and same names(), but a number of different data types, including character. I want to apply it to many inputs, resulting in a list of lists. I would like to turn this list of
2010 Apr 07
1
Vectorized forms of isTRUE, identical and all.equal?
Dear all, I'm wondering if there exist vectorized forms of 'isTRUE()', 'identical()' and 'all.equal()'. My problem is that I wish to test if each element of a vector is equal to a particular value (or numerically close), whilst dealing carefully with NAs and so on. However, using sapply() with identical() is very slow because it makes so many separate function calls:
2008 Feb 18
2
Number of digits of a value for problem 7.31 RFAQ
Hello dear R users! I did not find a function which gives information about the number of digits of a value shown by R. Do you know one? I need it to solve the problem (see RFAQ 7.31)that 0.2==0.2+0.1-0.1 FALSE The solution suggested in RFAQ is to use isTRUE(all.equal(0.2,0.2+0.1-0.1)) But if I want to compare inequality: 0.2<=0.2 +0.1-0.1 TRUE but 0.2<=0.2 +0.1-0.1 FALSE bad! but in
2006 Jan 30
2
'all' inconsistent?
Hello, I came across the following behavior, which seems illogical to me. I don't know if it is a bug or if I'm missing something: > all(logical(0)) [1] TRUE > any(logical(0)) [1] FALSE > isTRUE(logical(0)) [1] FALSE This actually came up in practice when I did something like > all( names(x) %in% vec ) as an error-handling, and I was hoping that it would work regardless