similar to: testing for integer

Displaying 20 results from an estimated 20000 matches similar to: "testing for integer"

2005 Jan 31
3
type of list elements in .Call
[Forwarding to r-devel.] Dear People, Here is something I do not understand. Consider ************************************************* foo.cc ************************************************* #include <iostream> #include <R.h> #include <Rinternals.h> using std::cout; using std::endl; extern "C" { SEXP printlst(SEXP lst); } SEXP printlst(SEXP lst) { for(int
2008 Apr 30
3
checking whether a file is empty
Hi, Is there a way to check whether a file is empty in R. I did the customary searches, but did not find anything. Please cc me on any reply. Thanks, Faheem.
2003 Apr 29
4
thick plot lines
Dear People, In a qqplot I am doing, I get lines/points that are very thick. I've tried setting the lwd variable to 0.1, but it doesn't seem to have any effect. Also, I have set the value of lty to dashed, but I still get dots. The command looks like qqplot(cdf.inv(seq(0,1,length=size),theta,pos,len),empmargdistvec(len,theta,pos,size), xlim=c(-theta,theta), ylim=c(-theta,theta),
2008 Aug 06
3
subsetting with column name as string
Hi, Consider the following > x = c(1,2) > y = c(3,4) > d = data.frame(cbind(x,y)) > d$x [1] 1 2 > d$"x" [1] 1 2 > > foo = function(val) + { + return(d$val) + } > > bar = function() + { + return(d$"x") + } > > foo("x") NULL > bar() [1] 1 2 I'm a little surprised that R accepts both the form d$x and d$"x", but
2001 Feb 08
4
eps file not positioned properly in latex document
Dear People, I am trying to include a barplot (see code below), in a latex document. However, the plot appears in totally the wrong position. I know this is not an R question as such, but the eps file is produced by R and I thought that perhaps other people had had similar problems and could give me pointers. Am I doing anything obviously wrong? Sincerely, Faheem Mitha. PS.
2000 May 01
6
including r code in a latex file
Dear R people, The header practically says it all. I was wanting to include r code in a Latex file. Since R code using{ and }, which are interpreted by Latex as control characters, I would expect it to get upset. I believe that \{ would probably print as {, but I hoping I don't have to go through the code and add lots of \. I would rather use some global commannd, along the lines of
2005 Jan 31
2
type of list elements in .Call
Dear People, Here is something I do not understand. Consider ************************************************* foo.cc ************************************************* #include <iostream> #include <R.h> #include <Rinternals.h> using std::cout; using std::endl; extern "C" { SEXP printlst(SEXP lst); } SEXP printlst(SEXP lst) { for(int i=0; i<length(lst);
2001 Mar 14
2
concatenating lists
Dear People, I have been trying to perform concatenation operations on lists without success. Consider the following example. > x <- runif(2) > y <- runif(2) > z <- runif(2) > xy <- list(x,y) > xyz <- list(x,y,z) I want to have a function foo such that foo(xy,z) is the same as xyz. This appears not to be as easy as I thought, though there must be a way. For example
2001 Nov 17
2
choosing g/g++ compiler executable in R CMD SHLIB
Dear People, After considerable effort, I managed to install gcc-3.0 on my Debian system. However, Debian keeps gcc-2.95 around as the default compiler, and gcc, g++ point to the 2.95 version. The 3.0 versions need to be explicitly invoked as gcc-3.0, g++-3.0 etc. How can I get R CMD SHLIB to invoke gcc-3.0 instead of gcc and g++-3.0 instead of g++? I would like this to be done by default but
1999 Dec 16
2
R question
I have the following question, which is elementary but I am unable to answer. In a for(i=10) loop, I am trying to represent the 10 1-dimensional vectors l1, l2,... l10 by some expression that will run through these values. ie. soppose I want to add l1 + ... + l10 I could go x <- 0 for(i in 1:10){ x <- x+ l(i)} This should return x to be the sum of the 10 li's for i from 1 to 10
2001 Sep 23
1
plot with no tick marks
Dear R people, I have the following simple bit of code to make a plot. I want to suppress tick marks on the axes of the plot. I've been trying everything I can think of to do so, but have been unsuccessful. Can you help me? If you reply, please cc me, I'm not currently subscribed to the list. Thanks in advance. Sincerely, Faheem Mitha. num <- 1:i inc
2003 Jun 20
3
combining mathematical notation and value substitution
Dear People, I need to make a label which both contains math notation as well as substitutes a value for an object. In the following label, len and theta are one dim variables, and I am substituting their values appropriately. This label looks fine except that I want the greek symbol for theta to appear instead of the word `theta'. How can I do so most easily? I don't understand the
2001 Oct 18
1
rsync logging and permission problems
Dear rsync people, I have just started using rsync for backups. I have had a couple of issues. Note I'm trying to use rsync as user using ssh between two machines both running Debian GNU/Linux potato (2.2r3). The local machine is currently running 2.4.6-1 and the remote 2.3.2-1.2. 1) When I run rsync with the vv option, stuff scrolls of my screen faster than I can read it. I was wondering if
2008 Nov 24
2
web error message
Hi, I'm getting an error from http://stat.ethz.ch/R-manual/ linked from http://www.r-project.org/ as follows ************************************************************************** Forbidden You don't have permission to access /R-manual/ on this server. Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
2002 Jun 15
2
using integrate on a function defined with if
Dear R People, I getting some curious behaviour with the integrate function. Consider the function foo <- function(x) { if(x==0) 4 else 0 } I get the error > integrate(foo,0,1) Error in integrate(foo, 0, 1) : evaluation of function gave a result of wrong length But now consider foo <- function(x) { ifelse(x==0,4,0) } > integrate(foo,0,1) 0 with absolute error
2001 Feb 06
2
barplots with pictex
Dear R People, I want to include a barplot corresponding to a simple discrete probability distribution in a LaTeX document. I decided to use the pictex driver. After a certain amount of messing about, I came up the stuff below. It does not look too bad, however, there is one very obvious piece of weirdness, ie. the y axis terminates at 0.1 and does not extend down further. I tried to adjust this
2002 Jul 24
1
loading compiled C++ code as shared library
Dear People, Over the last few days I've been writing C++ to compile as a shared library (previously I have always used C). Not entirely to my surprise, I am getting errors. Specifically, when I try to load the shared library, I get Error in dyn.load(x, as.logical(local), as.logical(now)) : unable to load shared library "/home/faheem/research/thesis/sim/ms/ms.so":
2001 Feb 07
1
Re: failed rpm installation of R 1.2-1 (fwd)
On Wed, 7 Feb 2001, Faheem Mitha wrote: > Dear Albrecht, > > Just sent the following message out to r-help. Have you any idea what this > problem could be? > > Sincerely, Faheem Mitha. > > ---------- Forwarded message ---------- > Date: Wed, 7 Feb 2001 00:04:35 -0500 (EST) > From: Faheem Mitha <faheem at email.unc.edu> > To:
2000 May 04
2
alas, no vecnorm
I wanted a function that would give the euclidean distance of a vector. Then I was happy, because I found vecnorm listed on pg 55 of V&R (3rd edn) which I had just bought today. Then I was sad, because R did not have vecnorm. Then I was happy again, because I bethought myself that I could copy the function vecnorm from splus to my code. Then I was sad again because R complained >
2008 Mar 26
2
unix.time
Hi, As far as I can tell, The R function unix.time calculates elapsed CPU time. Is there a command within R to measure actual elapsed time (I think this is sometimes referred to as wall time)? For example, the time command from GNU time calculates the actual elapsed time, as far as I can tell. (Please CC me, I'm not subscribed.)