search for: codefile

Displaying 20 results from an estimated 34 matches for "codefile".

2006 Jul 13
1
writeForeignSAS and potential extensions
...### adQuote here to (temporarily) avoid ':::' adQuote <- function (x) paste("\"", x, "\"", sep = "") dfile <- file.path(tempdir(), "test.dat") cfile <- file.path(tempdir(), "test.sas") write.foreign(d, datafile = dfile, codefile = cfile, package = "SAS7", validvarname = "V6") file.show(dfile) file.show(cfile) Sincerely, Stephen :::::::::::::::::::::::::::::::::: Stephen Weigand Division of Biostatistics Mayo Clinic Rochester, Minn., USA Phone (507) 266-1650, fax 284-9542 ----------...
2013 Mar 19
1
source, sys.source and error line numbers
...ng a file in a tryCatch statement? Is it stored somewhere accessible? It is not found in the error object. Consider the following code/output and note the difference in the traceback between source (has line number) and sys.source (has no line number). Thank you, Renaud ######## # code ######## codefile <- tempfile() write("# some comment # some good lines a <- 1 # a bad line stop('an error') # another good line b <- 2 ", file=codefile) # with source() the line number is displayed source(codefile) traceback() tryCatch(source(codefile), error= function(e){ str(e) }) # w...
2006 Jan 11
3
SPSS and R ? do they like each other?
... and is there also such a nice tool (like spss.get) for exporting data frames to SPSS? write.table does not keep the data frame labels - neither did the other exporting tools that I found. Thanks! Michael [[alternative HTML version deleted]]
2010 Jul 31
3
a problem
dear: when I read a Excel file(exp-11),The R project give me a error ,Just like this: ??'datafile' > write.foreign("exp-11.xls") ???list(df = df, datafile = datafile, codefile = codefile) : ??'datafile' > write.foreign("exp-11.xls") ???list(df = df, datafile = datafile, codefile = codefile) : ??'datafile' > write.foreign("exp-11.xls") ???list(df = df, datafile = datafile, codefile = codefile) : ??'datafile' >...
2006 Dec 11
2
FW: R
...;base") 2: solve.default(rgb) 3: solve(rgb) 4: drop(whitexyz %*% solve(rgb)) 5: make.rgb(red = c(0.625, 0.34), green = c(0.28, 0.595), blue = c(0.155, 0.07), gamma = 1.8, white = "D65", name = "Apple RGB") 6: eval(expr, envir, enclos) 7: eval(i, envir) 8: sys.source(codeFile, env, keep.source = keep.source) 9: try(sys.source(codeFile, env, keep.source = keep.source)) 10: loadNamespace(package, c(which.lib.loc, lib.loc), keep.source = keep.source) 11: try({ ns <- loadNamespace(package, c(which.lib.loc, lib.loc), keep.source = keep.source) dataPath <- file.path...
2001 Nov 06
1
R CMD check, undoc and package checking
...n undoc(dir = "/home/a296180/tmp/pyri.port") : cannot source package code Again, I am sent to line 932, but still don't know what file to look in. Looking into the undoc code, I see (line 455-458): if (file.exists(codeDir <- file.path(dir, "R"))) { codeFile <- tempfile("Rbuild") on.exit(unlink(codeFile)) codeExts <- c("R", "r", "S", "s", "q") It seems like the on.exit command is key. The error is in codeFile, but there is no way to save codeFile, other than comm...
2020 Feb 18
2
Possible Regression in setClassUnion between 3.5.0 and 3.6.0
...facilitate method dispatch. When I execute code in the global environment, everything acts as expected, however when I put the same code in the context of a package, selectMethod can no longer find the correct method. This first block below puts the code in the context of a package: fn <- "codefile.R" writeLines( c( "setClass('x', slots = list(slot ='character'))", "setClass('y', slots = list(slot ='character'))", "setClass('a', slots = list(slot ='character'))", "setCla...
2006 Nov 21
1
R dataframe into a SAS dataset
Hi experts, The below is the code I wrote for expoting an R dataframe into a SAS data set. I get the below error. So, what is the problem? Could somebody help me on this? * write.foreign(x,"Z:\\new","Z:\\new",package="SAS") Error in file(file, ifelse(append, "a", "w")) : unable to open connection In addition: Warning
2002 Nov 18
2
library() help for Windows
...file)) testRversion(descfile) if (exists("packageHasNamespace") && packageHasNamespace(package, which.lib.loc)) return(doNamespaceLibrary(package, which.lib.loc, lib.loc, logical.return)) codeFile <- file.path(which.lib.loc, package, "R", package) loadenv <- new.env(hash = TRUE, parent = .GlobalEnv) (v1.6.1) which.lib.loc <- dirname(pkgpath) descfile <- system.file("DESCRIPTION", package = package, lib...
2020 Feb 19
2
Possible Regression in setClassUnion between 3.5.0 and 3.6.0
...n the global environment, everything acts as > > expected, however when I put the same code in the context of a package, > > selectMethod can no longer find the correct method. This first block below > > puts the code in the context of a package: > > > > fn <- "codefile.R" > > writeLines( > > c( > > "setClass('x', slots = list(slot ='character'))", > > "setClass('y', slots = list(slot ='character'))", > > "setClass('a', slots = list(s...
2016 Feb 04
0
[PATCH] aarch64: Use a common table of AAVMF paths.
.../aarch64/vars-template-pflash.raw", - - NULL -}; - -#else - -static const char *uefi_firmware[] = { NULL }; - -#endif - int guestfs_int_get_uefi (guestfs_h *g, char **code, char **vars) { +#ifdef __aarch64__ size_t i; - for (i = 0; uefi_firmware[i] != NULL; i += 2) { - const char *codefile = uefi_firmware[i]; - const char *varsfile = uefi_firmware[i+1]; + for (i = 0; guestfs_int_aavmf_firmware[i] != NULL; i += 2) { + const char *codefile = guestfs_int_aavmf_firmware[i]; + const char *varsfile = guestfs_int_aavmf_firmware[i+1]; if (access (codefile, R_OK) == 0 &&a...
2006 Jul 18
1
possibly stupid question about RPM building
...hook) : internal error in R_decompress1 Execution halted Thereafter, going to /usr/src/redhat/BUILD/R-2.3.1/src/library/tools and executing "make" gives essentially the same result. digging deeper finds the error message within library/tools/R/makeLazyLoad.R: if (file.info(codeFile)["size"] == file.info(loaderFile)["size"]) warning("package seems to be using lazy loading already") hacking this file to produce more output identifies codeFile as /usr/lib/R/library/tools/R/tools and loaderFile as below: [root at bolker-cluster tools]# ls...
2009 Mar 01
1
SPSS repeated interaction contrast in R
..." = 2), CongruenceBefore= list("con vs. inc" = 1, "inc vs. neu" = 2), TaskSwitch = list("rep vs. se" = 1))) # export to spss require(foreign) codefile<-tempfile() write.foreign(m, paste("C:/m.sav",sep = ''), codefile,package="SPSS") SPSS: ###### BEGIN: SPSS code ########################################################################### # GET DATA # /TYPE=TXT /FILE='C:\m.sav' /DELCASE=LINE /DEL...
2020 Feb 26
1
Possible Regression in setClassUnion between 3.5.0 and 3.6.0
...> expected, however when I put the same code in the context of a > package, > > > > selectMethod can no longer find the correct method. This first block > below > > > > puts the code in the context of a package: > > > > > > > > fn <- "codefile.R" > > > > writeLines( > > > > c( > > > > "setClass('x', slots = list(slot ='character'))", > > > > "setClass('y', slots = list(slot ='character'))", > > > >...
2006 Oct 24
0
problem compilation on AIX
...e") 4: solve.default(rgb) 5: solve(rgb) 6: drop(whitexyz %*% solve(rgb)) 7: make.rgb(red = c(0.625, 0.34), green = c(0.28, 0.595), blue = c(0.155, 0.07), gamma = 1.8, white = "D65", name = "Apple RGB") 8: eval(expr, envir, enclos) 9: eval(i, envir) 10: sys.source(codeFile, env, keep.source = keep.source) 11: try(sys.source(codeFile, env, keep.source = keep.source)) 12: loadNamespace(package, lib.loc, keep.source, TRUE, TRUE) 13: code2LazyLoadDB(package, lib.loc = lib.loc, keep.source = keep.source, compress = compress) 14: tools:::makeLazyLoading("grDevice...
2010 Oct 20
1
Problem exporting data using write.foreign
My question is about the write.foreign() command in the foreign package. I use a command like the following to try and output data and a code file to read my data into SAS. write.foreign(data.frame.object, datafile="filepath", codefile="filepath", package="SAS", dataname="myData") With my data set, it gives the following error: Error in make.SAS.names(names(df), validvarname = validvarname) : Cannot uniquely abbreviate the variable names to 32 or fewer characters I tried to write reproducible...
2002 May 16
0
(PR#1556)
...".Internal( lib.fixup..." are not things of beauty, and I wonder whether the current usage in "library" is actually necessary? The code currently reads loadenv <- new.env(hash = TRUE, parent = .GlobalEnv) <<...>> sys.source(codeFile, loadenv, keep.source = keep.source) <<...>> env <- attach(NULL, name = pkgname) on.exit(do.call("detach", list(name = pkgname))) attr(env, "path") <- file.path(which.lib.loc, package) .Internal(lib.fi...
2012 Aug 22
0
Exporting data to spss
I have a dataframe of 80+ columns and over 700 rows. I use write.foreigin(data,C:/filename.dat,codefile.sps) and it does write out the .dat file and the code file. Problem is that when I open the codefile in SPSS 20, I can an error message saying there are too many variables and something about the formatting (this is not an SPSS list so the details of the error are not germane). Question: is there a...
2020 Feb 18
0
Possible Regression in setClassUnion between 3.5.0 and 3.6.0
...ch. When I execute code in the global environment, everything acts as > expected, however when I put the same code in the context of a package, > selectMethod can no longer find the correct method. This first block below > puts the code in the context of a package: > > fn <- "codefile.R" > writeLines( > c( > "setClass('x', slots = list(slot ='character'))", > "setClass('y', slots = list(slot ='character'))", > "setClass('a', slots = list(slot ='character')...
2020 Feb 25
0
Possible Regression in setClassUnion between 3.5.0 and 3.6.0
...everything acts as > > > expected, however when I put the same code in the context of a package, > > > selectMethod can no longer find the correct method. This first block below > > > puts the code in the context of a package: > > > > > > fn <- "codefile.R" > > > writeLines( > > > c( > > > "setClass('x', slots = list(slot ='character'))", > > > "setClass('y', slots = list(slot ='character'))", > > > "setClass(...