similar to: Can I use a variable to pass a file name to scan() ?

Displaying 20 results from an estimated 50000 matches similar to: "Can I use a variable to pass a file name to scan() ?"

2006 Dec 18
2
write() gotcha
Hi I used write() the other day to save some results. It seems that write() does not record the full precision of the objects being written: > write(pi,file="~/f",ncolumns=1) > pi.saved <- scan("~/f") Read 1 item > dput(pi) 3.14159265358979 > dput(pi.saved) 3.141593 > pi-pi.saved [1] -3.464102e-07 > This difficulty was particularly difficult to
2013 Dec 17
3
In-string variable/symbol substitution: What formats/syntax is out there?
Hi, I'm try to collect a list of methods/packages available in R for doing in-string variable/symbol substitution, e.g. someFcn("pi=${pi}"), anotherFcn("pi=@pi@") and so on becomes "pi=3.141593". I am aware of the following: ** gsubfn() in the 'gsubfn' package, e.g. > gsubfn( , , "pi = $pi, 2pi = `2*pi`") [1] "pi = 3.14159265358979,
2007 Sep 03
4
sin(pi)?
Dear all, I found something strange when calculating sin of pi value sin(pi) [1] 1.224606e-16 pi [1] 3.141593 sin(3.141593) [1] -3.464102e-07 Any help and comment should be appreciated. Regards Nguyen ____________________________ Nguyen Dinh Nguyen Garvan Institute of Medical Research Sydney, Australia
2005 Mar 12
4
Shorewall 2.2.1 and open ports
Hello all, I’m running Shorewall 2.2.1 on linux kernel 2.6.10 with iptables 1.2.11. I recently ran a nessus scan of my firewall from a machine outside of the firewall and the nessus report told me that there are some ports open that I did not specify to be open. The ports are 32772/udp, 123/udp, 111/tcp, 32772/udp, and 53/udp. Why are these ports open when I did NOT specify them to be open
2003 Jun 24
3
R-1.7.1 regression test failure on alphaev68-dec-osf5.1
I'm attempting to compile and install R version 1.7.1 for my statistical geneticists. It seems to compile correctly -- that is, it compiles without errors -- but the regression test is failing in the following manner: =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= > ## log > stopifnot(all.equal(log(1:10), log(1:10, exp(1)))) > stopifnot(all.equal(log10(30), log(30, 10))) >
2003 Oct 31
3
print(), cat() and simple I/O in R
I am trying to produce rather mundane output of the form e.g. pi, e = 3.14 2.718 The closest result I achieved so far with print() is: > print (c(pi, exp(1)), digits = 3) [1] 3.14 2.72 > print(c("pi, e =", pi, exp(1)), digits = 3) [1] "pi, e =" "3.14159265358979" "2.71828182845905" I understand that c() promotes floats to strings and
2011 May 30
2
Value of 'pi'
Dear R helpers, I have one basic doubt about the value of pi. In school, we have learned that pi = 22/7 (which is = 3.142857). However, if I type pi in R, I get pi = 3.141593. So which value of pi should be considered? Regards Vincy [[alternative HTML version deleted]]
2002 Aug 16
2
[nlme] BLUPs for a new subject in a fitted lme model?
I am seeking for a method to calculate, given a fitted lme model and some data for a subject, the random effects predictors for this subject. I can only find predictors for the subjects used in creating the fit. Of course I could just add the subject and redo the fit. But I want to avoid just this refitting. Thanks for help wbk
2019 Mar 31
3
stopifnot
Ah, with R 3.5.0 or R 3.4.2, but not with R 3.3.1, 'eval' inside 'for' makes compiled version behave like non-compiled version. options(error = expression(NULL)) library(compiler) enableJIT(0) f <- function(x) for (i in 1) {x; eval(expression(i))} f(is.numeric(y)) # Error: object 'y' not found fc <- cmpfun(f) fc(is.numeric(y)) # Error: object 'y' not found
2001 Dec 13
2
sample (PR#1212)
Full_Name: Antonio Possolo Version: 1.3.1 OS: Linux (RH 7.1), Windows 2000 Submission from: (NULL) (192.35.44.3) A FEATURE THAT EASILY GENERATES BUGS sample(pi, size=1) produces 1, 2, or 3. sample(c(pi, pi), size=1) produces 3.141593 always. Although this conforms with the behavior explained in the help page for "sample", the behavior for the case where x (in sample(x, ...)) has
2012 Sep 27
4
[LLVMdev] Clang bug?
Is this a relevant location to provide information about what I believe is a compiler bug in clang? If not, please forgive me for posting it here. (Perhaps you can redirect me to some place more appropriate.) If so, here are the details: I have a short 15-line C++ program using only one standard header that clang fails to compile properly under C++11 with the new standard library (although the
2005 Oct 01
3
dec2bin?
Hello, I just want to ask if there is any function that can convert decimal number to binary vector. Thanks a lot. Haiyong
2016 Sep 10
3
c(<Matrix>, <Matrix>) / help(dotsMethods) etc
I have been asked (by Roger; thank you for the good question, and I hope it's fine to answer to the public) : > with Pi a sparse matrix and x,y, and ones > compatible n-vectors ? when I do: >> c(t(x) %*% Pi %*% ones, t(ones) %*% Pi %*% y ) > [[1]] 1 x 1 Matrix of class "dgeMatrix" > [,1] [1,] > 0.1338527 >
2012 Sep 28
4
[LLVMdev] Clang bug?
Reduced testcase: template<typename T> struct A { typedef decltype(T() + 0) type; }; template<typename T> struct B { struct C { typedef typename A<C*>::type type; }; typedef typename A<C*>::type type; }; B<int> b; ... produces ... <stdin>:3:38: error: no type named 'type' in 'A<B<int>::C *>' struct C { typedef typename
2004 Jan 05
2
Set values in namespaces
Hello, I want to use global variables in a package which is using a namespace. But I don`t know how to change the values of the global variables. I know how to get the value of the variables, e.g. > base::pi [1] 3.141593 but following code doesn`t work > base::pi <- 3.14 Error: Object "base" not found Thanks for your help, Thomas Stabla -- > version _ platform
2007 Dec 06
12
DO NOT REPLY [Bug 5124] New: Lessons to learn from other tools, better use of resources, speed gains
https://bugzilla.samba.org/show_bug.cgi?id=5124 Summary: Lessons to learn from other tools, better use of resources, speed gains Product: rsync Version: 3.0.0 Platform: All OS/Version: All Status: NEW Severity: enhancement Priority: P3 Component: core AssignedTo:
2002 Feb 26
2
matrix lists
Perhaps the following example will help demonstrate that matrix lists do exist and do work up to a point, despite strident assertions on R-help to the contrary: > m <- list(a1=1:3, a2=4:6, a3=pi, a4=c("a","b","c")) > dim(m) <- c(2,2) > m [,1] [,2] [1,] "Numeric,3" "Numeric,1" [2,] "Numeric,3"
2012 Sep 29
0
[LLVMdev] Clang bug?
This doesn't appear to me to be the same issue (but of course I don't know clang as well as you all do). This code appears invalid (and G++ rejects it with a similar "no type named ..." error message), whereas the original code is valid C++ (both C++98 and C++11). On Fri, Sep 28, 2012 at 3:54 PM, Richard Smith <richard at metafoo.co.uk> wrote: > Reduced testcase: >
2008 Nov 04
1
Problems with scan
I have been having problems with using scan(). I searched the archives and found someone with the same problem several years ago, but did not find a solution. I want to prompt the user for input, scan in that input, and then go on to use it as a variable. The simplest version of my program is cat("enter m","\n") m <- scan(n = 1, quiet = T) m If I enter these lines one
2004 Dec 30
1
number format
This mailing list truly is amazing. Thank you so much for all the help! I feel a little strange asking something that "simple" again, but I wasn't able to find it in the help... Is there a way to tell R how to display numbers (double)? How many numbers after the decimal point, etc... Thanks again, folks and have a nice New Years Eve! Dax