Prezados colegas da lista, estava tentando rodar este exemplo quando tive problema de alocação de memória, alguém poderia me ajudar a resolver?Att,#CMRprocessador: Intel(R) Core(TM) i3 CPU M380 @2.53GHzMemória instalada(RAM): 4,00 GB (utilizável:2,93)Sistema oeracional de 32 BitsR version 3.1.1 (2014-07-10) -- "Sock it to Me"Copyright (C) 2014 The R Foundation for Statistical ComputingPlatform: i386-w64-mingw32/i386 (32-bit)N <- 100000000x <- runif(N)y <- runif(N)ok <- sum(x^2 + y^2 < 1)mc.pi <- 4 * ok / Nsprintf("pi = %.6lf\n", mc.pi)#1ª tentativa>N <- 100000000>x <- runif(N)> y <- runif(N)Error: cannot allocate vector of size 762.9 MbIn addition: Warning messages:1: In runif(N) : Reached total allocation of 1535Mb: see help(memory.size)2: In runif(N) : Reached total allocation of 1535Mb: see help(memory.size)3: In runif(N) : Reached total allocation of 1535Mb: see help(memory.size)4: In runif(N) : Reached total allocation of 1535Mb: see help(memory.size)> ok <- sum(x^2 + y^2 < 1)Error: cannot allocate vector of size 762.9 MbIn addition: Warning messages:1: Reached total allocation of 1535Mb: see help(memory.size)2: Reached total allocation of 1535Mb: see help(memory.size)3: Reached total allocation of 1535Mb: see help(memory.size)4: Reached total allocation of 1535Mb: see help(memory.size)> mc.pi <- 4 * ok / NError: object 'ok' not found> sprintf("pi = %.6lf\n", mc.pi)Error in sprintf("pi = %.6lf\n", mc.pi) : object 'mc.pi' not foundmemory.size(2900)2ª tentativa> N <- 100000000> x <- runif(N)Error: cannot allocate vector of size 762.9 Mb> y <- runif(N)Error: cannot allocate vector of size 762.9 Mb> ok <- sum(x^2 + y^2 < 1)Error: cannot allocate vector of size 762.9 Mb> mc.pi <- 4 * ok / NError: object 'ok' not found> sprintf("pi = %.6lf\n", mc.pi)Error in sprintf("pi = %.6lf\n", mc.pi) : object 'mc.pi' not found
_______________________________________________
R-br mailing list
R-br@listas.c3sl.ufpr.br
https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br
Leia o guia de postagem (http://www.leg.ufpr.br/r-br-guia) e forneça código mínimo reproduzível.