Displaying 20 results from an estimated 3000 matches similar to: "Building and loading a DLL on Windows NT"
2004 Sep 09
4
scoping rules
Can someone help me with this simple example?
sq <- function() {
y <- x^2
y
}
myfunc <- function() {
x <- 10
sq()
}
myfunc()
executing the above in R yields:
> myfunc()
Error in sq() : Object "x" not found
I understand that R's scoping rules cause it to look for "x" in the
environment in which "sq" was defined (the global environment in
2003 Aug 13
1
Problems with addition in big POSIX dates
Have you noticed any problems with big dates (>=1/1/2040) in R?
Here is the bit of code that I'm having trouble with:
> test.date <- strptime("1/1/2040",format="%m/%d/%Y")
>
> unlist(test.date)
sec min hour mday mon year wday yday isdst
0 0 0 1 0 140 0 0 0
>
> date.plus.one <- as.POSIXct(test.date) +
2003 Oct 31
4
Array Dimension Names
I would like to reference array dimensions by name in an apply and a summary
function. For example:
apply(x, "workers", sum)
Is there a better way to do this than creating a new attribute for the array
and then creating new methods for apply and summary? I don't want to name
the individual elements of each dimension (such as with dimnames) but rather
name the dimensions. Thanks
2003 Jun 09
2
ESRI shapefiles and EMME/2 packages
I just uploaded two packages to CRAN.
shapefiles_0.1.tar.gz - functions to read and write ESRI shapefiles
(including dbfs)
emme2_0.1.tar.gz - functions to read binary data from an EMME/2 databank
data (EMME/2 is a transportation modeling program)
Please let me know if you find any bugs or have some suggestions. Thanks.
Regards,
Benjamin Stabler
Transportation Planning Analysis Unit
Oregon
2003 Jun 02
6
Building an R package under Windows NT
I am trying to build a R 1.7 package under Windows NT. I created the
DESCRIPTION file, the RD file and added the code to the R folder. I also
downloaded and installed the Rtools package and have Perl 5.0. I know that
Perl, Miktex, and gcc are working. I also have my PATH variable set
correctly. I can fake install my package by removing the *.R from the code
file, using Rcmd Rdconv to create
2004 Mar 10
2
Rcmd BATCH command line arguments
I want to run Rcmd BATCH with R_DEFAULT_PACKAGE=base so it doesn't load any
packages, but it seems to reject this argument because it does not start
with a '-' or '--'. Is there a different argument that will work? Thanks.
Benjamin Stabler
Transportation Planning Analysis Unit
Oregon Department of Transportation
555 13th Street NE, Suite 2
Salem, OR 97301 Ph: 503-986-4104
2003 Jul 23
2
paste and NAs
I understand how R treats NAs but in the situation below it would be nice to
have a na.skip argument to paste so it does not convert the NAs to "NA"s and
simply skips those elements of the vector for pasting.
> x
[1] "2.13" "2.3" NA NA "2.83" NA
> paste(x, "0", sep="")
[1] "2.130" "2.30"
2004 Jan 14
2
R internal data types
I am trying to figure out R data types and/or storage mode. For example:
> #From a clean workspace
> gc()
used (Mb) gc trigger (Mb)
Ncells 415227 11.1 597831 16
Vcells 103533 0.8 786432 6
> x <- seq(0,100000,1)
> is.integer(x)
[1] FALSE
> is.double(x)
[1] TRUE
> object.size(x)
[1] 800036
> gc()
used (Mb) gc trigger (Mb)
Ncells 415247
2002 Dec 19
2
list to data.frame
R Help-
I have a list of 102 vectors all of the same type and length called
time.by.orig. I can't data.frame(time.by.orig) but I can
data.frame(time.by.orig[1:length(time.by.orig)]). Why is this? Thanks for
your help.
str(time.by.orig)
List of 102
$ 1 : num [1:102] 1.34 17.39 14.36 14.22 7.56 ...
$ 2 : num [1:102] 17.5 0.7 17.7 12.4 10.4 ...
$ 3 : num [1:102] 14.063 17.568
2003 Apr 25
2
Open an r+b file connection on Windows
I am trying to open an existing binary file, seek to a position in the
middle, and then write one byte, while keeping the already existing data
after that byte. It seems to me that I am unable to open a connection to a
binary file in both read and write mode. I can open the "r+b" binary file
connection and seek around, but I can't write to the file. And looking at
the function
2002 Oct 04
3
R 1.6 Gui for Windows
I upgraded to R Gui 1.6 this morning and I can't seem to get it to accept my
new startup directory. R 1.51 will accept
"F:\_ben\bls\gen1\results\bls\analysis" as the start in directory for the R
Gui shortcut, but R 1.6 will not. R 1.6 will accept
"F:\_ben\bls\gen1\results\bls". It seems to have trouble when I add
"\analysis." R still loads fine but I get the
2009 Mar 31
4
what is the preferred method to create a package local variable?
for the moment, I'm using:
.onAttach <- function(libname, pkgname) {
.bbg.db.conn <<- dbConnect(dbDriver("PostgreSQL"), user="blah","blah")
}
.onUnload <- function(libpath) {
dbDisconnect(.bbg.db.conn)
}
which results in a hidden global variable in the global environment.
I would prefer to make the assignment only in the package namespace.
2004 Aug 05
1
R interface to Python (in Windows)
I put a copy of R 1.8.1 for Windows on our FTP site at:
ftp://ftp.odot.state.or.us/outgoing/Test/. It should be there for a few
days before it gets deleted.
Benjamin Stabler
Transportation Planning Analysis Unit
Oregon Department of Transportation
555 13th Street NE, Suite 2
Salem, OR 97301 Ph: 503-986-4104
-----Original Message-----
From: Peter Wilkinson [mailto:pwilkinson at videotron.ca]
2017 Jan 03
2
[R] Problems when trying to install and load package "rzmq"
On Tue, Jan 3, 2017 at 3:53 PM, Whit Armstrong <armstrong.whit at gmail.com> wrote:
>
> I maintian the rzmq project.
>
> love to get it running on windows, but zmq doesn't play nicely with R's
> mingw.
It's fairly easy to link against the libraries from rwinlib:
https://github.com/rwinlib/zeromq. I'll send you a pull request later
this week to fix the binary
2006 Jul 27
3
deparse(substitute(foo))
I see that plot.default uses deparse(substitute(x)) to extract the
character name of an argument and put it on the vertical axis.
Hence:
foo <- 1:10
plot( foo )
will put the label "foo" on the vertical axis.
However, for a function that takes a "..." list as an input, I can only
extract the first argument name:
x <- 1:10
y <- 10:20
foo <- function(...) {
2005 Oct 26
1
Borland C++ and [R] dyn.load() for windows
Hi,
I compiled a C program file on Borland C++ 5.5 compiler to get one dll output
(as instructed in the file readme.package).
The C program file is just the example on page 31 of "writing R extensions":
void convolve(double *a, int *na, double *b, int *nb, double *ab)
{
int i, j, nab = *na + *nb - 1;
for(i = 0; i < nab; i++)
ab[i] = 0.0;
for(i = 0; i < *na; i++)
for(j = 0; j
2008 Nov 18
2
anyone familiar with this error?
[whit at linuxsvr R.packages]$ sudo R CMD INSTALL portfolio.construction
* Installing to library '/usr/local/lib64/R/library'
* Installing *source* package 'portfolio.construction' ...
** R
** preparing package for lazy loading
Loading required package: fts
Loading required package: quadprog
Loading required package: Rexcelpoi
terminate called after throwing an instance of
2012 May 17
2
test suites for packages
Can anyone share some opinions on test suites for R packages?
I'm looking at testthat and RUnit. Does anyone have strong opinions on
either of those.
Any additional packages I should consider?
Thanks,
Whit
2008 Dec 11
2
is there a way to recursilvely lapply
for a simple example:
x <- list()
x[["a"]] <- list(a=c(1,2,3),b=c(3,4,5))
x[["b"]] <- list(a=c(6,7,8),b=c(9,10,11))
lapply(x,sum)
this fails w/
Error in FUN(X[[1L]], ...) : invalid 'type' (list) of argument
Just wondering if I have overlooked something obvious.
one can also do:
lapply(x,lapply,sum)
but that assumes that you already know how many levels
2006 Jul 26
2
RODBC on linux
Anyone out there using Linux RODBC and unixODBC to connect to a
Microsoft SQL server?
If possible can someone post a sample .odbc.ini file?
I saw a few discussions on the archives a few years ago, but no config
file details were available.
Thanks,
Whit
This e-mail message is intended only for the named recipient(s) above. It may contain confidential information. If you are not the intended