Displaying 20 results from an estimated 900 matches similar to: "Modern Symbolic debugger for R programmes?"
2012 Feb 21
2
Debugging using RStudio or any other R editor
Hello,
I am using RStudio and have trouble finding out the problematic line in
the presence of a bug. Could I view the line NUMBER which contains a bug?
Is there any R editor able to do it?
Thanks,
Miao
[[alternative HTML version deleted]]
2023 Feb 18
1
Adding support for S7 to base R
On 18/02/2023 9:51 a.m., Duncan Murdoch wrote:
> One more comment:
>
> The utils::setBreakpoint() function should be updated to be able to set
> breakpoints in S7 methods, or a substitute function should be added to
> the S7 package.
>
> RStudio 2022.12.0+353 (not sure if that's the latest) also needs to be
> taught how to do that, since it doesn't seem to use
2023 Feb 18
1
Adding support for S7 to base R
One more comment:
The utils::setBreakpoint() function should be updated to be able to set
breakpoints in S7 methods, or a substitute function should be added to
the S7 package.
RStudio 2022.12.0+353 (not sure if that's the latest) also needs to be
taught how to do that, since it doesn't seem to use setBreakpoint.
Duncan Murdoch
2011 Apr 06
1
executing from .R source file in the src package
Can I run R code straight from R src (.R) file instead of .rdb/.rdx? I of
course tried simply unzipping tar.gz in the R_LIBS directory but R complains
with "not a valid installed package".
Real issue: I am very new to R and all, so this could be something basic.
I'm trying to use ess-tracebug (Emacs front-end to trace/browser et al).
It works great when I trace functions in .R
2010 Mar 16
2
Is there a way to edit a specific line in a function (e.g: doing function->text->edit->function) ?
Hello,
Let's say we have the following function:
foo <- function(x)
{
line1 <- x
line2 <- 0
line3 <- line1 + line2
return(line3)
}
And that we want to change the second line to be:
line2 <- 2
How would you do that?
The two ways I know of are either to use
fix(foo)
And change the function.
Or to just write the function again.
Is there
2011 Dec 06
2
help! what's wrong with setBreakpoint
Hi all,
I am in the middle of debugging which is stopped using "browser()"... in
myfile.R at around line #25.
I was then stuck in a big loop which I want to escape and stop the program
at the line after the big loop.
In the debugging mode, I used
Browse[2]> setBreakpoint("myfile.R#38")
I then typed "c" and "ENTER", thinking that it will continue
2010 Jun 16
5
t-test problem
I have two pairs of related vectors
x1,y1
and
x2,y2
I wish to do a test for differences in means of x1 and y1, ditto x2 and y2.
I am getting odd results. I am not sure I am using 'pt' properly...
I have not included the raw vectors as they are long. I am interested if I
am using R properly...
> c(length(x1), length(y1), length(x2), length(y2))
[1] 3436 1619 2677 2378
First
2012 Dec 09
1
Making fifo work (Linux)
Friends
I need to get R reading from a fifo. I want it to block till there is some
data in the fifo, consume what input it gets there, do some thing with it
then loop back and block again.
Very simple. Yes? No.
The example in the documentation works OK..
zz <- fifo("foo-fifo", "w+")
writeLines("abc", zz)
print(readLines(zz))
2011 Nov 11
3
Why does length("") == 1?
It seems obvious to me that the empty string "" is length 0.
cheers
Worik
[[alternative HTML version deleted]]
2009 Sep 24
2
Date formats in as.Date
I have trouble with this:
as.Date("Sep-1981", format="%b-%Y")
Returns "NA"
>From documentation for strftime
'%b' Abbreviated month name in the current locale. (Also matches
full name on input.)
'%Y' Year with century.
What am I doing wrong?
cheers
Worik
[[alternative HTML version deleted]]
2012 Nov 30
3
Line numbers with errors and warnings?
Is it possible to get a line number with an error report?
I have a long script and an error:
Error in `[.xts`(x, xsubset) : subscript out of bounds
It would be very helpful, and save a lot of time, if there was some
indication in the error message which line the error was.
I can find it using binary search but that is a painful process.
cheers
Worik
[[alternative HTML version deleted]]
2024 Apr 12
1
Debugging functions defined (locally) inside another functions
On 12/04/2024 8:15 a.m., Iago Gin? V?zquez wrote:
> Hi all, I am trying to debug an error of a function g defined and used inside another function f of a package.
> So I have
>
> f <- function(whatever){
> ...
> g <- function(whatever2){
> ...
> }
> ...
> }
>
> If I wanted to debug some thing directly inside f I would do debug(f).
2011 May 08
2
Pretty printing numbers
Friends
I am trying to format a number to a string so 2189.745 goes to "2,189.35"
and 309283.929 goes to "309,283.93"
I have tried to use formatC(X, big.mark=",",drop0trailing=FALSE, format="f")
but it does not get the number of decimals correct. Specifying digits does
not work as that is significant digits. I could use a switch statement
switching on
2012 Mar 25
2
Weird POSIXct behaviour
Friends
I have an xts that I wish to access.
Browse[2]> DATA.ba[[p]]["2012-03-20 00:59:57","bid"]
bid
2012-03-20 00:59:57 1.4993
So far so good.
Now putting the index into a variable:
Browse[2]> Time
[1] "2012-03-20 00:59:57 NZDT"
Browse[2]> DATA.ba[[p]][Time, "bid"]
bid
Where has it gone?
Looking closer....
2010 Jun 08
2
Logical vector question
If I create a vector thusly
> v1 <- runif(20, min=0, max=1)
> v1
[1] 0.9754443 0.6306228 0.3238158 0.3175769 0.6791534 0.6956507 0.3840803
[8] 0.1421328 0.8592398 0.4388306 0.9472040 0.4727435 0.5645302 0.7391616
[15] 0.6116199 0.2727754 0.2657867 0.5261744 0.8764804 0.2032126
And I want to create a logical vector the same length that is true if v1<.3
or v1 > .7 how do I do it
2011 Dec 18
1
Looking for package 'rgp'
I am interested in the package 'rgp'
But....
> install.packages("rgp")
Installing package(s) into ‘/home/worik/R/x86_64-pc-linux-gnu-library/2.12’
(as ‘lib’ is unspecified)
Warning message:
In getDependencies(pkgs, dependencies, available, lib) :
package ‘rgp’ is not available
It is in cran: http://cran.r-project.org/web/packages/rgp/index.html
How do I install it?
2012 Nov 12
1
System problem: Sys.time() returns GMT, says NZDT
When I say:
> Sys.time()
[1] "2012-11-12 21:30:14 NZDT"
>
But that is not what my clock on the wall and my system say. Cannot show
you my clock but...
worik@lemy:/tmp$ date
Tue Nov 13 10:32:20 NZDT 2012
Sys.time() is returning GMT
$version.string
[1] "R version 2.14.1 (2011-12-22)"
> Sys.timezone()
[1] "NZDT"
>
I'm a little lost!
Worik
2005 Jul 23
2
cor(X) with P-Value
Friends
I am new to R (and statistics) so am struggling a bit.
Briefly...
I am interested in getting the P-Value from cor(X) where X is a matrix.
I have found cor.test.
Verbosely...
I have 4 vectors and can generate the corellation matrix...
> cor(cbind(X1, X2, X3, X4))
X1 X2 X3 X4
X1 1.00000000 -0.06190365 -0.156972795 0.182547517
X2
2011 Sep 13
1
Getting Rcpp SEXP data in C++
Friends
I am looking at Rcpp and I am a bit stuck on a simple matter.
(I am calling R from c++, if there is a better way...)
Given this simple example using the TTR package and the SMA function which
returns a simple moving average....
Rcpp::NumericVector rv;
for(int i = 0; i < 100; i++){
rv.push_back(rand());
}
Rcpp::Environment TTR("package:TTR");
2010 Mar 18
1
Locating an error
I have a large programme that after running half an hour or so fails with an
error
Error in x[value] <- NA : only 0's may be mixed with negative subscripts
How can I find out where that error occurs?
If I have to do a binary search using error messages it will take a long
time! Is there some way I can generate a stack trace?
cheers
Worik
[[alternative HTML version deleted]]