similar to: Array changing address unexpectedly

Displaying 20 results from an estimated 10000 matches similar to: "Array changing address unexpectedly"

2017 Nov 12
1
Array changing address unexpectedly
Hi David, ? Thanks for the correction concerning the "else" issue. ? Taking your code and removing some lines (to increase readability): ? library(pryr) ? data <- array(dim = c(5)) for(x in 1:5) { ?? data[x] <- as.integer(x * 2) } ? #print(data) ? add = address(data) for(x in 1:5) { ?? data[x] <- as.integer(0) } ? if (add == address(data)) { print("Address did not
2017 Nov 01
2
Memory address of character datatype
Hi, ? To get the memory address of where the value of variable "x" (of datatype "numeric") is stored one does the following in R (in 32 bit): ? ??? ? library(pryr) ? ?? ?x <- 1024 ?? ?? addr <- as.numeric(address(x)) +?24?? ?# 24 is needed to jump the variable info and point to the data itself (i.e. 1024) ? The question now is what is the value of the jump?so that one
2017 Nov 12
0
Array changing address unexpectedly
> On Nov 12, 2017, at 8:47 AM, lille stor <lille.stor at gmx.com> wrote: > > Hi, > > Given the following R code: > > library(pryr) > > data <- array(dim = c(5)) > > for(x in 1:5) > { > data[x] <- as.integer(x * 2) > } > > add = address(data) # save address of "data" > > for(x in
2017 Sep 08
1
Change of variable address due to GC
Hi, ? I would like to know if the Garbage Collector (GC) changes the address of a variable in R. In other words, assuming the following code: ? ??? ? library(pryr) ? ? ??? x <- 1:1024 ? ??? ? addr <- address(x)? # save address of variable "x" in "addr" ??????? ? . ?? ????? ? . ???? ??? ? . ????? (execution of operations that create/destroy many small/big
2017 Nov 02
0
Memory address of character datatype
If you were curious about the hidden details of the memory layout in R, the best reference is the source code. In your example, you are not getting to your string because there is one more pointer in the way, "x" is a vector of strings, each string is represented by a pointer. At C level, there is an API for getting an address of the value, e.g. INTEGER(x) or CHAR(STRING_ELT(x)). At
2020 Jan 09
6
Get memory address of an R data frame
Hello, I would like for my C function to be able to manipulate some values stored in an R data frame. To achieve this, a need the (real) memory address where the R data frame stores its data (hopefully in a contiguous way). Then, from R, I call the C function and passing this memory address as a parameter. The question: how can we get the memory address of the R data frame? Thank you! L.
2017 Sep 19
3
R and Visual Studio
Hi, ? I am trying to build R using Visual Studio 2010 but without success. My question is if it possible build?R with this compiler anyway? ? If not, could someone please tell how to link one's C code against both the static and shared libraries of R for Windows (that comes from the official website found here https://cran.r-project.org/mirrors.html)? ? Thank you!
2020 Mar 27
1
object.size vs lobstr::obj_size
On 3/27/20 15:19, Hadley Wickham wrote: > > > On Fri, Mar 27, 2020 at 4:01 PM Herv? Pag?s <hpages at fredhutch.org > <mailto:hpages at fredhutch.org>> wrote: > > > > On 3/27/20 12:00, Hadley Wickham wrote: > > > > > > On Fri, Mar 27, 2020 at 10:39 AM Herv? Pag?s > <hpages at fredhutch.org <mailto:hpages at
2020 Jan 09
1
Get memory address of an R data frame
On 1/9/20 06:56, Stepan wrote: > On 09. 01. 20 15:41, lille stor wrote: > >> I believe this could be done without creating side effects (e.g. >> crash) as we are just talking about changing values. A crash would certainly be an annoying "side effect" ;-) As Stepan explained, data.frame objects like most objects in R should never be modified in-place. If you're
2018 May 13
1
different type of modification when code is sourced and pasted
Dear all, I have a question about R's modification in place and replacement functions. I was working through Hadley Wickham's Advanced R section on Replacement Functions and in a file (say test.R) I wrote: `second<-` <- function(x, value) { x[2] <- value x } x <- 1:10 second(x) <- 5L print(x) library(pryr) x <- 1:10 print(address(x)) second(x) <- 6L
2020 Mar 27
2
object.size vs lobstr::obj_size
On 3/27/20 12:00, Hadley Wickham wrote: > > > On Fri, Mar 27, 2020 at 10:39 AM Herv? Pag?s <hpages at fredhutch.org > <mailto:hpages at fredhutch.org>> wrote: > > Hi Tomas, > > On 3/27/20 07:01, Tomas Kalibera wrote: > > they provide an over-approximation > > They can also provide an "under-approximation" (to say the
2017 Dec 25
2
LSD-test
The model should be class aov or lm and my model class is aovlist. tried tidy from broom library but did not work. To make it class aov, I had to remove the error term; model <- aov(Rotationdata_R$`GY(Mg/ha)`~Rep+code*as.factor(Nitrogen),data=Rotationdata_R) Ahmed Attia, Ph.D. Agronomist & Soil Scientist On Mon, Dec 25, 2017 at 7:38 PM, David Winsemius <dwinsemius at
2017 Jun 12
2
Possible with enableJIT function
In this email to the R-help list: https://stat.ethz.ch/pipermail/r-help/2017-June/447474.html and in this question on Stackoverflow: https://stackoverflow.com/questions/44486643/nleqslv-memory-use-in-r Andrew Leach has raised a question about the memory usage of my package nleqslv. In a model with a loop within a function he has experienced continuously increasing memory usage by package nleqslv
2017 Nov 02
2
"prob" package alternative
Thanks. I found that, and installed it and got the same message. Here: RTools version 3.4 install.packages("fAsianOptions_3010.tar.gz", dependencies=TRUE, repos=NULL, type = "source") Installing package into ?C:/Users/Tlk7/Documents/R/win-library/3.4? (as ?lib? is unspecified) Warning: invalid package 'fAsianOptions_3010.tar.gz' Error: ERROR: no packages specified
2017 Nov 02
2
"prob" package alternative
Rtools is not available for the current version of R. What I'm looking for is an alternative package or how others have managed to create workarounds. On Thu, Nov 2, 2017 at 4:25 PM, David Winsemius <dwinsemius at comcast.net> wrote: > > > On Nov 2, 2017, at 1:09 PM, Tiby Kantrowitz <tlkantro at gmail.com> wrote: > > > > Yes, that is exactly what I was doing
2017 Dec 09
2
Remove
> On Dec 8, 2017, at 4:48 PM, Ashta <sewashm at gmail.com> wrote: > > Hi David, Ista and all, > > I have one related question Within one group I want to keep records > conditionally. > example within > group A I want keep rows that have " x" values ranged between 15 and 30. > group B I want keep rows that have " x" values ranged
2018 Apr 06
3
Obtain gradient at multiple values for exponential decay model
> On Apr 6, 2018, at 8:03 AM, David Winsemius <dwinsemius at comcast.net> wrote: > > >> On Apr 6, 2018, at 3:43 AM, g l <gnulinux at gmx.com> wrote: >> >>> Sent: Friday, April 06, 2018 at 5:55 AM >>> From: "David Winsemius" <dwinsemius at comcast.net> >>> >>> >>> Not correct. You already have
2017 Sep 07
2
ISO3 code to 7 continents names
df is a data frame consisting of one variable (iso3 codes) such as USA RUS ARG BGD ITA FRA Some of these iso3 codes are repeated and I would like the corresponding continent name, the countrycode package does not seem to distinguish between North and South America. Thanks. Sincerely, Milu On Thu, Sep 7, 2017 at 9:00 PM, David Winsemius <dwinsemius at comcast.net> wrote: > > >
2017 Nov 02
2
"prob" package alternative
Yes, that is exactly what I was doing two days ago. Warning in install.packages : installation of package ?fAsianOptions_3010.79.tar.gz? had non-zero exit status Which is what a reading of the explanation for why "prob" was retired leads one to expect. Do you have some other suggestion about how to get it to work? I notice you're not using Windows which might have a relationship
2017 Dec 07
4
Remove
> On Dec 6, 2017, at 4:27 PM, Ashta <sewashm at gmail.com> wrote: > > Thank you Ista! Worked fine. Here's another (possibly more direct in its logic?): DM[ !ave(DM$x, DM$GR, FUN= function(x) {!length(unique(x))==1}), ] GR x y 5 B 25 321 6 B 25 512 7 B 25 123 8 B 25 451 -- David > On Wed, Dec 6, 2017 at 5:59 PM, Ista Zahn <istazahn at gmail.com> wrote: