Not sure what you wanted to do.Note that you have "test'txt" and "log.txt"
in your code. Using only "test.txt", the following worked fine for me:
letters[1:5]->x
logf<-"test.txt"
cat('%%\n',file=logf)
catf<-function(x,...,logfile='test.txt', append=TRUE){ cat(x,'\n',
Your call to catf in testit is after the return, so it is never called.
FWIW my antibugging strategy (and readability strategy) is to never use the
return function... I structure my logic to end up at the end with my desired
function result in a variable and I simply put that variable on the
testit<-function(x,...){
paste0('this is x: ',x)->y
return(y)
catf("++test=",...)
}
You return from the function before calling catf(). Remove the 'return(y)'
and make 'y' the last expression in the function.
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On
Hi List,
I am trying to write unsuccessfully to a logfile with cat. Here my example code:
letters[1:5]->x
logf<-"test.txt"
cat('%%\n',file=logf)
catf<-function(x,...,logfile='log.txt', append=TRUE){ cat(x,'\n', file=logfile,
append=append)}
testit<-function(x,...){
Ricardo Rodríguez wrote:
Please, could you give me an example about how to use cat() to read the
value of a variable in a function? Any other way?
I've found how to make it globally available, thus printing it, but I
don't know how to read out the value of any variable within the
Thanks, Bill
bill.venab...@csiro.au wrote:
fn - function(x) {
j - x+1
cat(the value of j is , j, \n)
j
}
fn(1:10)
It is clear for me now the use of cat(). As Steve pointed out in his
mail, I've failed at providing an example, one of the rules of thumb of
this list!
Thanks, Steve,
Steve Lianoglou wrote:
It seems like you're asking to use cat() for something it's not meant
to do. cat() is generally used to write output, either to the screen
or to a file.
Sorry for not adding an example to my first post! And yes, I was trying
to use it for something it
Sorry,
[Ricardo Rodriguez] Your XEN ICT Team wrote:
eval(parse(text=getauth('http://tinyurl.com/ne5bl3',user,pass)))
I get NULL.
Please, use DummyDummy as user and dummy as pass if you want to try
it. Thanks.
I think the proposed URL could present some more problems. Please, use
this
Please, could you give me an example about how to use cat() to read the
value of a variable in a function? Any other way?
I've found how to make it globally available, thus printing it, but I
don't know how to read out the value of any variable within the function.
Thanks for your help,
Hi,
On Aug 6, 2009, at 7:25 PM, [Ricardo Rodriguez] Your XEN ICT Team wrote:
Please, could you give me an example about how to use cat() to read
the value of a variable in a function? Any other way?
Can you please give an example of what you're trying to do?
It seems like you're asking to
On Dec 24, 2008, at 2:35 AM, Gundala Viswanath wrote:
Dear all,
I have the following data frame:
raw.count
Var1
Freq
1 AA 707
2 AC14
3
Dear all,
I have the following data frame:
raw.count
Var1
Freq
1 AA 707
2 AC14
3 AT 3
But why when printint it using 'cat',
-Message d'origine-
De : r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] De la
part
de Gundala Viswanath
Envoyé : mercredi 24 décembre 2008 08:35
À : r-h...@stat.math.ethz.ch
Objet : [R] Using 'cat' on data frame
Dear all,
I have the following data frame:
raw.count
13 matches
Mail list logo