Re: [Rd] dput(as.list(function...)...) bug
Duncan Murdoch wrote: On 23/03/2009 7:37 PM, Stavros Macrakis wrote: It appears to be the zero-length name: is.name(ff$x) => TRUE as.character(ff$x) => "" This may give you a hint: > y <- ff$x > y Error: argument "y" is missing, with no default It's a special internal thing that triggers the missing value error when evaluated. It probably shouldn't be user visible at all. Yes, it actually is the zero-length name that is being used for this, but that is not really useful knowledge because it is forbidden to create them as `` or as.name(""). We did briefly consider making the missing object a real R object, but the semantics are too weird: Basically, you can only assign it once, next time you get errors: > x <- alist(a=)$a > missing(x) [1] TRUE > y <- x Error: argument "x" is missing, with no default > l <- alist(a=, b=2) > l$b <- x Error: argument "x" is missing, with no default And, as you think about it, you realize that you cannot disable these mechanisms, because _something_ has to trap use of missing arguments. It does actually work to define a function mvi() which returns the missing value indicator and have things like > list(x= mvi(), b= quote(!x)) $x $b !x work. I'd hate writing its help page, though. -- O__ Peter Dalgaard Øster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~ - (p.dalga...@biostat.ku.dk) FAX: (+45) 35327907 __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] Error in FrF2 example on Mac OS
Dear all, I just noticed that the 0.9 update for FrF2 did not work out for Mac OS due to an error in an example that ran without error on all other platforms. I do not find any reason for this. In the past, umlauts or tab characters have sometimes been an issue, but I didn't find any of these. The function definition is FrF2(nruns = NULL, nfactors = NULL, factor.names = if (!is.null(nfactors)) { if (nfactors <= 50) Letters[1:nfactors] else paste("F", 1:nfactors, sep = "")} else NULL, default.levels = c(-1, 1), generators = NULL, resolution = NULL, estimable = NULL, max.nfree2fis = FALSE, randomize = TRUE, seed = NULL, ...){...} and the simplest call to this function fails: FrF2(8,4) gives the custom error message "nruns must be a power of 2.", which is generated in the first check within function FrF2: if (!is.null(nruns)){ k <- floor(log2(nruns)) if (!2^k==nruns) stop("nruns must be a power of 2.")} Would the Mac (different from all other systems) require FrF2(nruns=8, nfactors=4) ? Or what else could be the issue here ? Thanks for any pointers! Regards, Ulrike -- View this message in context: http://www.nabble.com/Error-in-FrF2-example-on-Mac-OS-tp22675998p22675998.html Sent from the R devel mailing list archive at Nabble.com. __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] Size of (objects in) sysdata.rda
Dear all, in my package FrF2, I currently face a trade-off of object size and calculation run times. I would like to work with catalogues with some pre-calculated information, and calculate some other information on an as-needed basis. Is there any experience as to what sizes of objects in sysdata.rda will make a package difficult to handle / slow ? If I would put into the catalogues what I currently consider useful, I would most likely end up with an rda file that takes more than 30 seconds to load on my machine. With the current structure, it would consist almost exclusively of one massive list. I suspect that this is not very wise. Would it help to lazy-load data and split the list into several smaller ones (the larger ones of which will not be used all that often) ? Or do I need a different strategy altogether ? Thanks for any advice! Regards, Ulrike -- View this message in context: http://www.nabble.com/Size-of-%28objects-in%29-sysdata.rda-tp22676784p22676784.html Sent from the R devel mailing list archive at Nabble.com. __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] Is aggregate() function changing?
Hi R developers and debian users: Finally I found how to work with aggregate() function on the last patched version fo R. I you use this command it fails: aggregate(state.x77, list(Region = state.region), mean) But if you modify it in this way, it works!: aggregate(state.x77, list(Region = state.region), function(x) mean(x) ) Is it necesary to change the example? What is changing in aggregate() function? Thank you for your attention. Kenneth. >sessionInfo() R version 2.8.1 Patched (2009-03-18 r48193) x86_64-unknown-linux-gnu locale: LC_CTYPE=es_CO.UTF-8;LC_NUMERIC=C;LC_TIME=es_CO.UTF-8;LC_COLLATE=es_CO.UTF-8;LC_MONETARY=C;LC_MESSAGES=es_CO.UTF-8;LC_PAPER=es_CO.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=es_CO.UTF-8;LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Is aggregate() function changing?
On 24/03/2009 12:44 AM, Kenneth Roy Cabrera Torres wrote: Hi R developers and debian users: Finally I found how to work with aggregate() function on the last patched version fo R. I you use this command it fails: aggregate(state.x77, list(Region = state.region), mean) But if you modify it in this way, it works!: aggregate(state.x77, list(Region = state.region), function(x) mean(x) ) Is it necesary to change the example? What is changing in aggregate() function? I get identical results from those, but if I had a local variable (not a function) named "mean", the first one would not work: > mean <- 2 > aggregate(state.x77, list(Region = state.region), mean) Error in FUN(X[[1L]], ...) : element 1 is empty; the part of the args list of 'is.list' being evaluated was: (INDEX) I suspect that is what is going wrong for you. Duncan Murdoch Thank you for your attention. Kenneth. sessionInfo() R version 2.8.1 Patched (2009-03-18 r48193) x86_64-unknown-linux-gnu locale: LC_CTYPE=es_CO.UTF-8;LC_NUMERIC=C;LC_TIME=es_CO.UTF-8;LC_COLLATE=es_CO.UTF-8;LC_MONETARY=C;LC_MESSAGES=es_CO.UTF-8;LC_PAPER=es_CO.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=es_CO.UTF-8;LC_IDENTIFICATION=C attached base packages: [1] stats graphics grDevices utils datasets methods base __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Is aggregate() function changing?
On Tue, Mar 24, 2009 at 7:07 AM, Duncan Murdoch wrote: > On 24/03/2009 12:44 AM, Kenneth Roy Cabrera Torres wrote: >> >> Hi R developers and debian users: >> >> Finally I found how to work with aggregate() function >> on the last patched version fo R. >> >> I you use this command it fails: >> aggregate(state.x77, list(Region = state.region), mean) >> >> But if you modify it in this way, it works!: >> >> aggregate(state.x77, list(Region = state.region), function(x) mean(x) ) >> >> Is it necesary to change the example? >> >> What is changing in aggregate() function? > > I get identical results from those, but if I had a local variable (not a > function) named "mean", the first one would not work: > >> mean <- 2 >> aggregate(state.x77, list(Region = state.region), mean) > Error in FUN(X[[1L]], ...) : element 1 is empty; > the part of the args list of 'is.list' being evaluated was: > (INDEX) > > I suspect that is what is going wrong for you. > although "mean" in quotes works even then: > mean <- 1 > aggregate(state.x77, list(Region = state.region), "mean") Region Population Income Illiteracy Life ExpMurder HS Grad 1 Northeast 5495.111 4570.222 1.00 71.26444 4.72 53.96667 2 South 4208.125 4011.938 1.737500 69.70625 10.581250 44.34375 3 North Central 4803.000 4611.083 0.70 71.76667 5.275000 54.51667 4 West 2915.308 4702.615 1.023077 71.23462 7.215385 62.0 Frost Area 1 132.7778 18141.00 2 64.6250 54605.12 3 138.8333 62652.00 4 102.1538 134463.00 __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Error in FrF2 example on Mac OS
Ulrike Grömping wrote: Dear all, I just noticed that the 0.9 update for FrF2 did not work out for Mac OS due to an error in an example that ran without error on all other platforms. I do not find any reason for this. In the past, umlauts or tab characters have sometimes been an issue, but I didn't find any of these. The function definition is FrF2(nruns = NULL, nfactors = NULL, factor.names = if (!is.null(nfactors)) { if (nfactors <= 50) Letters[1:nfactors] else paste("F", 1:nfactors, sep = "")} else NULL, default.levels = c(-1, 1), generators = NULL, resolution = NULL, estimable = NULL, max.nfree2fis = FALSE, randomize = TRUE, seed = NULL, ...){...} and the simplest call to this function fails: FrF2(8,4) gives the custom error message "nruns must be a power of 2.", which is generated in the first check within function FrF2: if (!is.null(nruns)){ k <- floor(log2(nruns)) if (!2^k==nruns) stop("nruns must be a power of 2.")} Probably a rounding issue on different platforms? I guess the test should be something like: if (!is.null(nruns)){ if(!isTRUE(all.equal(log2(nruns) %% 1, 0))) stop("nruns must be a power of 2.") } Uwe Would the Mac (different from all other systems) require FrF2(nruns=8, nfactors=4) ? Or what else could be the issue here ? Thanks for any pointers! Regards, Ulrike __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] dput(as.list(function...)...) bug
Peter, Duncan, I understand that the missing value indicator is special and will not behave like an ordinary value in evaluation. I was only discussing its handling in the text representation functions dput and dump. Duncan, You are absolutely right that "list(x=)" is parseable (though not evaluable). My mistake. However, the point stands that dput/dget do not successfully recreate the object, and do not give an error as promised in the documentation. I said: "dput does not give a warning as specified" and you quoted ?.deparseOpts: Some exotic objects such as environments, external pointers, etc. can not [sic] be deparsed properly. This option causes a warning to be issued if any of those may give problems You apparently read this to mean that only environments and external pointers are "exotic objects": That's not what "warnIncomplete" is documented to do As far as I can see, none of those conditions apply here: ff is not one of those exotic objects or a very long string However, they are listed as examples ("such as"); and there is an "etc." indicating that there are other, unnamed, exotic objects (and the missing value indicator seems pretty exotic to me...). What's more, the sentence explicitly says that the warning is issued "if *any* of those may give problems" (not "some"); the definition is not in terms of a list of "exotic objects", but in terms of the behavior of "giving problems". That is the plain English sense of the passage, and also the substantively reasonable one. -s __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Size of (objects in) sysdata.rda
Ulrike Grömping wrote: Dear all, in my package FrF2, I currently face a trade-off of object size and calculation run times. I would like to work with catalogues with some pre-calculated information, and calculate some other information on an as-needed basis. Is there any experience as to what sizes of objects in sysdata.rda will make a package difficult to handle / slow ? If I would put into the catalogues what I currently consider useful, I would most likely end up with an rda file that takes more than 30 seconds to load on my machine. With the current structure, it would consist almost exclusively of one massive list. I suspect that this is not very wise. Would it help to lazy-load data and split the list into several smaller ones (the larger ones of which will not be used all that often) ? Sounds good! Uwe Or do I need a different strategy altogether ? Thanks for any advice! Regards, Ulrike __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Error in FrF2 example on Mac OS
On Tue, Mar 24, 2009 at 02:45:57PM +0100, Uwe Ligges wrote: > >gives the custom error message "nruns must be a power of 2.", which is > >generated in the first check within function FrF2: > > > >if (!is.null(nruns)){ > > k <- floor(log2(nruns)) > > if (!2^k==nruns) stop("nruns must be a power of 2.")} > > > Probably a rounding issue on different platforms? > I guess the test should be something like: > > if (!is.null(nruns)){ > if(!isTRUE(all.equal(log2(nruns) %% 1, 0))) > stop("nruns must be a power of 2.") > } Probably, k is needed also later. Assumig that 2^k works correctly, the following could be sufficient if (!is.null(nruns)){ k <- round(log2(nruns)) if (!2^k==nruns) stop("nruns must be a power of 2.")} In order to test the assumption, one can use x <- 2^(0:100 + 0) # use double exponent to be sure all(x == floor(x)) Powers of two are represented exactly, since they have only one significant bit. Petr. __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Error in FrF2 example on Mac OS
Thanks, Uwe, I think that's it! I'll include your fix in the next update. Regards, Ulrike -- Original Message --- From: Uwe Ligges To: Ulrike Grömping Cc: r-devel@r-project.org Sent: Tue, 24 Mar 2009 14:45:57 +0100 Subject: Re: [Rd] Error in FrF2 example on Mac OS > Ulrike Grömping wrote: > > Dear all, > > > > I just noticed that the 0.9 update for FrF2 did not work out for Mac OS due > > to an error in an example that ran without error on all other platforms. I > > do not find any reason for this. In the past, umlauts or tab characters > > have > > sometimes been an issue, but I didn't find any of these. The function > > definition is > > > > FrF2(nruns = NULL, nfactors = NULL, factor.names = if (!is.null(nfactors)) > > { > > if (nfactors <= 50) Letters[1:nfactors] else > > paste("F", 1:nfactors, sep = "")} else NULL, > > default.levels = c(-1, 1), generators = NULL, resolution = NULL, > > estimable = NULL, max.nfree2fis = FALSE, > > randomize = TRUE, seed = NULL, ...){...} > > > > and the simplest call to this function fails: > > FrF2(8,4) > > gives the custom error message "nruns must be a power of 2.", which is > > generated in the first check within function FrF2: > > > > if (!is.null(nruns)){ > > k <- floor(log2(nruns)) > > if (!2^k==nruns) stop("nruns must be a power of 2.")} > > Probably a rounding issue on different platforms? > I guess the test should be something like: > > if (!is.null(nruns)){ > if(!isTRUE(all.equal(log2(nruns) %% 1, 0))) > stop("nruns must be a power of 2.") > } > > Uwe > > > Would the Mac (different from all other systems) require FrF2(nruns=8, > > nfactors=4) ? Or what else could be the issue here ? > > > > Thanks for any pointers! > > > > Regards, Ulrike --- End of Original Message --- [[alternative HTML version deleted]] __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] dput(as.list(function...)...) bug
On 3/24/2009 10:02 AM, Stavros Macrakis wrote: Peter, Duncan, I understand that the missing value indicator is special and will not behave like an ordinary value in evaluation. I was only discussing its handling in the text representation functions dput and dump. Duncan, You are absolutely right that "list(x=)" is parseable (though not evaluable). My mistake. However, the point stands that dput/dget do not successfully recreate the object, and do not give an error as promised in the documentation. I said: "dput does not give a warning as specified" and you quoted ?.deparseOpts: Some exotic objects such as environments, external pointers, etc. can not [sic] be deparsed properly. This option causes a warning to be issued if any of those may give problems You apparently read this to mean that only environments and external pointers are "exotic objects": That's not what "warnIncomplete" is documented to do As far as I can see, none of those conditions apply here: ff is not one of those exotic objects or a very long string However, they are listed as examples ("such as"); and there is an "etc." indicating that there are other, unnamed, exotic objects (and the missing value indicator seems pretty exotic to me...). What's more, the sentence explicitly says that the warning is issued "if *any* of those may give problems" (not "some"); the definition is not in terms of a list of "exotic objects", but in terms of the behavior of "giving problems". That is the plain English sense of the passage, and also the substantively reasonable one. It's a documentation problem. There is not supposed to be a promise to warn in every case. There are two ways to fix this: the easy way is to patch the docs, the very hard way is to analyze the deparser, and make it detect every case where it will produce something that doesn't parse back to something identical to the original. If you want to volunteer to do the latter, I'll hold off, otherwise I'll fix the docs to weaken the apparent promise. Duncan Murdoch __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] savePlot export "strange" eps (PR#13620)
cgeno...@u-paris10.fr wrote: Full_Name: Christophe Genolini Version: 2.8.1 OS: Windows XP Submission from: (NULL) (82.225.59.146) savePlot export "eps" graph that seems to be incorrect. Looks like you saved an EMF rather than an eps file??? Uwe Ligges Trying to incorporate them in a LaTeX file, I get : ++ Cannot determine size of graphics in foo.eps (no BoundingBox) -- Trying to open them with GSview, I get : ++ GSview 4.9 2007-11-18 AFPL Ghostscript 8.54 (2006-05-17) Copyright (C) 2005 artofcode LLC, Benicia, CA. All rights reserved. This software comes with NO WARRANTY: see the file PUBLIC for details. Displaying non DSC file C:/Documents and Settings/Christophe/Mes documents/Recherche/Trajectoires/kmeal/trajectories/testsDev/toti.eps Error: /undefined in Operand stack: Execution stack: %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- false 1 %stopped_push 1 3 %oparray_pop 1 3 %oparray_pop 1 3 %oparray_pop 1 3 %oparray_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- Dictionary stack: --dict:1130/1686(ro)(G)-- --dict:0/20(G)-- --dict:74/200(L)-- Current allocation mode is local Last OS error: No such file or directory --- Begin offending input --- € L z f C fC EMF $6 7 l � ° €— ° G r a p h A p p % €% €% €% €% €% €% €% €% €% €% €% €K @ 0 N N y @ N N y @ % €% €: _ 8 8 8 % ; l * 6 Z õ < @ f ï ` 0 % €( % €% €K @ 0 N N y @ N N y @ % €% €: _ 8 8 8 % ; m ñ 6 Z » < @ g µ ` ÷ % €( % €% €K @ 0 ¡ ¡ ¡ ¡ % €% €: _ 8 8 8 --- End offending input --- file offset = 1024 gsapi_run_string_continue returns -101 __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Error in FrF2 example on Mac OS
Petr Savicky wrote: > > On Tue, Mar 24, 2009 at 02:45:57PM +0100, Uwe Ligges wrote: >> >gives the custom error message "nruns must be a power of 2.", which is >> >generated in the first check within function FrF2: >> > >> >if (!is.null(nruns)){ >> > k <- floor(log2(nruns)) >> > if (!2^k==nruns) stop("nruns must be a power of 2.")} >> >> >> Probably a rounding issue on different platforms? >> I guess the test should be something like: >> >> if (!is.null(nruns)){ >> if(!isTRUE(all.equal(log2(nruns) %% 1, 0))) >> stop("nruns must be a power of 2.") >> } > > Probably, k is needed also later. Assumig that 2^k works correctly, > the following could be sufficient > >if (!is.null(nruns)){ > k <- round(log2(nruns)) > if (!2^k==nruns) stop("nruns must be a power of 2.")} > > In order to test the assumption, one can use > > x <- 2^(0:100 + 0) # use double exponent to be sure > all(x == floor(x)) > > Powers of two are represented exactly, since they have only one > significant bit. > > Petr. > Yes, round instead of floor should also do the job, if rounding is the issue. But then, with powers of 2 indeed being represented exactly (I would expect even on Macs), maybe rounding is not the issue? I have no possibility to check this, since I do not have access to a Mac with R installed. On my windows machine, all(log2(x)==floor(log2(x))) with x as defined above yields TRUE. Regards, Ulrike -- View this message in context: http://www.nabble.com/Error-in-FrF2-example-on-Mac-OS-tp22675998p22681913.html Sent from the R devel mailing list archive at Nabble.com. __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] [R] variance/mean
William Dunlap wrote: > Doesn't Fortran still require that the arguments to > a function not alias each other (in whole or in part)? > what do you mean? the following works pretty fine: echo ' program foo implicit none integer, target :: a = 1 integer, pointer :: p1, p2, p3 integer :: gee p1 => a p2 => a p3 => a write(*,*) p1, p2, p3 call bar (p1, p2, p3) write(*,*) p1, p2, p3 a = gee(p1, p2, p3) write(*,*) p1, p2, p3 end program foo subroutine bar (p1, p2, p3) integer :: p1, p2, p3 p3 = p1 + p2 end subroutine bar function gee(p1, p2, p3) integer :: p1, p2, p3, gee p3 = p1 + p2 gee = p3 return end function gee ' > foo.f95 gfortran foo.f95 -o foo ./foo # 1 1 1 # 2 2 2 # 4 4 4 clearly, p1, p2, and p3 are aliases of each other, and there is an assignment made in both the subroutine and the function. have i misunderstood what you said? vQ __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] savePlot export "strange" eps (PR#13620)
Sorry for that... I find a strange behavior in "savePlot" ; before report a bug, I read the posting guide and I try to simplify my exemple as much as possible. Doing this, I change my code and I remove the " type='eps' " option... Sorry ! Let's start this again. When I use savePlot(file="toto.eps",type="eps") and I try to incorporate "toto.eps" in a LaTeX document, I get a strange behavior: LaTeX run normaly, so does dvips. But the generated postscript include a graph that overwirte the line above it. If my latex is bonjour bonjour2 bonjour3 \begin{center} \includegraphics[width=12cm]{toto.eps} \end{center} Then "bonjour2 bonjour3" is hidden by the graph. Version: 2.8.1 OS: Windows XP LaTeX : Miktex 2.7 Christophe cgeno...@u-paris10.fr wrote: Full_Name: Christophe Genolini Version: 2.8.1 OS: Windows XP Submission from: (NULL) (82.225.59.146) savePlot export "eps" graph that seems to be incorrect. Looks like you saved an EMF rather than an eps file??? Uwe Ligges Trying to incorporate them in a LaTeX file, I get : ++ Cannot determine size of graphics in foo.eps (no BoundingBox) -- Trying to open them with GSview, I get : ++ GSview 4.9 2007-11-18 AFPL Ghostscript 8.54 (2006-05-17) Copyright (C) 2005 artofcode LLC, Benicia, CA. All rights reserved. This software comes with NO WARRANTY: see the file PUBLIC for details. Displaying non DSC file C:/Documents and Settings/Christophe/Mes documents/Recherche/Trajectoires/kmeal/trajectories/testsDev/toti.eps Error: /undefined in Operand stack: Execution stack: %interp_exit .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- --nostringval-- false 1 %stopped_push 1 3 %oparray_pop 1 3 %oparray_pop 1 3 %oparray_pop 1 3 %oparray_pop .runexec2 --nostringval-- --nostringval-- --nostringval-- 2 %stopped_push --nostringval-- Dictionary stack: --dict:1130/1686(ro)(G)-- --dict:0/20(G)-- --dict:74/200(L)-- Current allocation mode is local Last OS error: No such file or directory --- Begin offending input --- € L z f C fC EMF $6 7 l � ° €— ° G r a p h A p p % €% €% €% €% €% €% €% €% €% €% €% €K @ 0 N N y @ N N y @ % €% €: _ 8 8 8 % ; l * 6 Z õ < @ f ï ` 0 % €( % €% €K @ 0 N N y @ N N y @ % €% €: _ 8 8 8% ; m ñ 6 Z » < @ g µ ` ÷ % €( % €% €K @ 0 ¡ ¡ ¡ ¡ % €% €: _ 8 8 8 --- End offending input --- file offset = 1024 gsapi_run_string_continue returns -101 __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] Write in Table with Schema (PR#13622)
Full_Name: Michael Version: actual OS: windows Submission from: (NULL) (77.87.228.65) To Save Data to MS SQL Server 2005 i take this function: ok <- sqlSave(write_channel , target_data, tablename="Import.R_Data", append=TRUE, fast=FALSE, safer=TRUE, nastring=NULL, rownames=FALSE); The Table with the name "Import.R_Data" is not writing. It always take "dbo.Import.R_Data". So it is not possible to secure Tables with the roles sucurity. Can you help me? Kind regards Michael __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Error in FrF2 example on Mac OS
On Tue, Mar 24, 2009 at 07:41:31AM -0700, Ulrike Grömping wrote: > > Probably, k is needed also later. Assumig that 2^k works correctly, > > the following could be sufficient > > > >if (!is.null(nruns)){ > > k <- round(log2(nruns)) > > if (!2^k==nruns) stop("nruns must be a power of 2.")} > > > > In order to test the assumption, one can use > > > > x <- 2^(0:100 + 0) # use double exponent to be sure > > all(x == floor(x)) > > > > Powers of two are represented exactly, since they have only one > > significant bit. > > > > Petr. > > > > Yes, round instead of floor should also do the job, if rounding is the > issue. But then, with powers of 2 indeed being represented exactly (I would > expect even on Macs), maybe rounding is not the issue? I have no possibility > to check this, since I do not have access to a Mac with R installed. On my > windows machine, > all(log2(x)==floor(log2(x))) > with x as defined above yields TRUE. Christophe Dutang tested this on Mac with the result > x <- 2^(0:100 + 0) > all(x == floor(x)) [1] TRUE > all(log2(x) == floor(log2(x))) [1] TRUE > x [1] 1.00e+00 2.00e+00 4.00e+00 8.00e+00 1.60e+01 [6] 3.20e+01 6.40e+01 1.28e+02 2.56e+02 5.12e+02 [11] 1.024000e+03 2.048000e+03 4.096000e+03 8.192000e+03 1.638400e+04 [16] 3.276800e+04 6.553600e+04 1.310720e+05 2.621440e+05 5.242880e+05 [21] 1.048576e+06 2.097152e+06 4.194304e+06 8.388608e+06 1.677722e+07 [26] 3.355443e+07 6.710886e+07 1.342177e+08 2.684355e+08 5.368709e+08 [31] 1.073742e+09 2.147484e+09 4.294967e+09 8.589935e+09 1.717987e+10 ... Without an analysis of the error directly on Mac, it is hard to guess, what is the problem. What could also be tested is, whether the input nruns is an integer or not. Either strictly, if (nruns != floor(nruns)) stop("nruns not an integer") or with some tolerance nruns0 <- nruns nruns <- round(nruns) if (!isTRUE(all.equal(nruns, nruns0))) stop("nruns not an integer") Petr. __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] More Embedding REngine in Cocoa
Hello once again, After locating the standalone REngine object set, I am having difficulty integrating them into the XCode project I intend to use them in. Suppose one started with the REngine standalone source and a blank XCode file, what special modifications need to be made to allow the source files to see inside R.framework? Importing the framework into the project, setting the header and framework search paths hasn't done anything for me yet. The files are complaining about the R.h file not existing. Using the R.app as a reference, I was unable to find specifically how it adds the R/ directory visibility to the application headers at link or compile time. I was able to compile and run the test file inside the REngine standalone. However, I don't know how to initiate my application in XCode using the R CMD command. What impacts will this have to the existing program? Finally, I was also unable to find any sort of implementation of this in RGui. Is this even necessary from XCode? I hope this is enough detail. Thanks in advance. David Zwerdling zwerd...@gmail.com __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Error in FrF2 example on Mac OS
Petr Savicky wrote: > > On Tue, Mar 24, 2009 at 07:41:31AM -0700, Ulrike Grömping wrote: >> > Probably, k is needed also later. Assumig that 2^k works correctly, >> > the following could be sufficient >> > >> >if (!is.null(nruns)){ >> > k <- round(log2(nruns)) >> > if (!2^k==nruns) stop("nruns must be a power of 2.")} >> > >> > In order to test the assumption, one can use >> > >> > x <- 2^(0:100 + 0) # use double exponent to be sure >> > all(x == floor(x)) >> > >> > Powers of two are represented exactly, since they have only one >> > significant bit. >> > >> > Petr. >> > >> >> Yes, round instead of floor should also do the job, if rounding is the >> issue. But then, with powers of 2 indeed being represented exactly (I >> would >> expect even on Macs), maybe rounding is not the issue? I have no >> possibility >> to check this, since I do not have access to a Mac with R installed. On >> my >> windows machine, >> all(log2(x)==floor(log2(x))) >> with x as defined above yields TRUE. > > Christophe Dutang tested this on Mac with the result > > x <- 2^(0:100 + 0) > > all(x == floor(x)) > [1] TRUE > > all(log2(x) == floor(log2(x))) > [1] TRUE > > x > [1] 1.00e+00 2.00e+00 4.00e+00 8.00e+00 1.60e+01 > [6] 3.20e+01 6.40e+01 1.28e+02 2.56e+02 5.12e+02 >[11] 1.024000e+03 2.048000e+03 4.096000e+03 8.192000e+03 1.638400e+04 >[16] 3.276800e+04 6.553600e+04 1.310720e+05 2.621440e+05 5.242880e+05 >[21] 1.048576e+06 2.097152e+06 4.194304e+06 8.388608e+06 1.677722e+07 >[26] 3.355443e+07 6.710886e+07 1.342177e+08 2.684355e+08 5.368709e+08 >[31] 1.073742e+09 2.147484e+09 4.294967e+09 8.589935e+09 1.717987e+10 >... > > Without an analysis of the error directly on Mac, it is hard to guess, > what > is the problem. What could also be tested is, whether the input nruns is > an > integer or not. Either strictly, > if (nruns != floor(nruns)) stop("nruns not an integer") > or with some tolerance > nruns0 <- nruns > nruns <- round(nruns) > if (!isTRUE(all.equal(nruns, nruns0))) stop("nruns not an integer") > > Petr. > > __ > R-devel@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-devel > > Thanks for this test report, sounds as though rounding may not be the issue here. I've uploaded the version with round instead of floor anyway, together with a few more bug fixes, and I'll see what happens with the Mac checks on CRAN. With Mac users being a minority, I'm not willing to complicate things for other platforms in order to accomodate Mac fixes that I can't even check myself. But I don't think that this can be all that complicated. If rounding is not the root cause, someone will certainly come up with another idea. I'll report back, whether the rounding error approach solved the problem. Regards, Ulrike -- View this message in context: http://www.nabble.com/Error-in-FrF2-example-on-Mac-OS-tp22675998p22696051.html Sent from the R devel mailing list archive at Nabble.com. __ R-devel@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-devel