[R] Errors or warnings for non-existent data

2013-03-16 Thread brwin338

Good Evening

Is there a setting that I can change in R so that I get either a warning or an 
error message if I reference  non-existent data in a data frame?  For example I 
get no warning or error message with the following:

> set.seed(2013)
> df0=data.frame(cbind(x=rnorm(1000),y=rnorm(1000)))
> df0$z=df0$w
> head(df0)
x   y
1 -0.09202453  1.51179695
2  0.78901912 -0.60084547
3 -0.66744232 -0.02180077
4  1.36061149 -0.74909011
5  1.50768816 -2.25128946
6 -2.60754997  0.43708800

Thanks
Joe

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] A question with respect to capturing output from a shell command

2013-05-28 Thread brwin338

Good Evening

I have a set of fortran code that prints results to the screen when executed 
from the dos shell under windows.
I want to capture the screen output directly into R when the code is executed 
via a shell command.   I find that we can do this when the code is compiled 
with Lahey's 32 bit compiler but can not do this when the code is compiled with 
gfortran.  Both .exe objects display the results properly when executed from 
the dos shell. Can anyone  explain why this is happening.  The following 
demonstrates:

Fortran code
!*
  program writetest
!*  
  write(*,*) 'Hello World'
  stop
  end
!  


Compile commands (LF95 calls Lahey's compiler and creates writetest.exe)


lf95 writetest.for
gfortran writetest.for -o Gwritetest.exe

R script


tmp1=shell('writetest.exe',intern=TRUE)
tmp2=shell('Gwritetest.exe',intern=TRUE)
> tmp1
[1] "Hello World"
> tmp2
character(0)



I would sincerely appreciate if someone could explain why this is happening and 
send me a note at:

brwin...@aol.com

Joe.




[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] R and LINGO?

2010-06-16 Thread brwin338

Good Evening
Does anyone in the R-help list have experience writing an R wrapper that 
interfaces with the commercial packages LINGO and/or LINDO.api from R?

I have a set of nonlinear/mixed integer problems that solve nicely with LINGO 
but I would like to use R to set the problems up and analyze/plot the solutions 
dynamaically. I have searched the archives and have not found any R packages 
that enable me to obtain solutions to mixed integer problems with linear and 
quadratic constraints.

If I have missed one, we would be happy to hear which package we could consider 
as an alternative to LINGO.
Any help or suggestions would be appreciated.

Brwin338

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Difference between 10 and 10L

2012-05-03 Thread brwin338

Good Evening
We have been searching through the R documentation manuals without success on 
this one.
What is the purpose or result of the "L" in the following?

n=10
and 
n=10L

or
c(5,10)
versus
c(5L,10L)

Thanks
Joe



Thanks
Joe


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.