[R] fancier plotting

2006-07-29 Thread Fred J.
Hi thank you for talking the time to help me with this. I have a sequence of numbers in a file and an equal sequence of various character, say(a b c d) each occurs more than once. I need to plot the numbers so that numbers corresponding to a in the other sequence would have green dots, those c

[R] autoscall the y-axis

2006-04-16 Thread Fred J.
Dear R users I need to auto scale the left y axis in the code below, so that when I scroll left or right the left y-axis scale changes to accumulate the range of the displayed data with in the max hight of the y-axis. also how can I make the crosshair horizontal since it is only vertical

Re: [R] unable to open connection

2006-04-12 Thread Fred J.
aha, thank you, I added ../ or ~/ before the path and it fixed it. Duncan Murdoch <[EMAIL PROTECTED]> wrote: Fred J. wrote: > Duncan > what does the permission needs to look like in your opinion? > the way it is now, on both the data file and the R batch file "r.R"

Re: [R] unable to open connection

2006-04-12 Thread Fred J.
ch are the only lacking from what I see from -rwxr-xr-x Duncan Murdoch <[EMAIL PROTECTED]> wrote: On 4/12/2006 12:40 PM, Fred J. wrote: > Dear R users > > I am having a problem "unable to open connection" and don't know why. > using debian testing, R Version

[R] unable to open connection

2006-04-12 Thread Fred J.
Dear R users I am having a problem "unable to open connection" and don't know why. using debian testing, R Version 2.2.1 [EMAIL PROTECTED]:~/R$ ls -l -rwxr-xr-x 1 fred fred 11599 2006-04-13 02:12 r.R > getwd() [1] "/h

[R] installing problem

2006-04-10 Thread Fred J.
Dear R users a problem I encountered while installing fMultivar, I would appriciate any help with this. > install.packages ("fMultivar", dependencies=TRUE) Warning in install.packages("fMultivar", dependencies = TRUE) : argument 'lib' is missing: using /usr/local/lib/R/site-library

[R] plot bg color problem

2006-04-02 Thread Fred J.
Dear R users, this line below is not painting the background black but it is still white. plot(x,y[x], type='s', bg='black', col='yellow', ylim=range(y)) I am running R 2.2.1 thanks - [[alternative HTML version deleted]]

[R] matching a given sd range

2006-03-31 Thread Fred J.
Dear R users given a numeric array (a sequence of reals), I am interested in finding the subsets of sequences (each with start and end index) which match a given sd range. I read the docs on match and which and the "see also" but could not come up with a way. I could loop with a stepping w

[R] conflicts Var names

2006-03-29 Thread Fred J.
Dear R users I have read somewhere which I don't remember that some variable names are not to be used for conflict avoidance. and those were (c, q, T, F, T) I ran this > conflicts(detail=TRUE) $.GlobalEnv [1] "ts" $"package:methods" [1] "body<-" $"package:stats" [1] "ts" $"pac

Re: [R] graphing and scrolling

2006-03-28 Thread Fred J.
I've been trying to find out from the package docs how to place a cross hair mouse with values of the intercept of it and the graphs. I would appriciate any hint. Gregory Snow <[EMAIL PROTECTED]> wrote: > thanks > that was very helpful. > i have been reading and trying to modify the code

[R] Jump to error location in source()

2006-03-28 Thread Fred J.
Dear R users. is there an easy way to make R in ESS put out the line number of an error, or even to jump to, some old posts about this question here, but one day in IT worth a thousand years. I am using ESS and C-c C-l but that is asking to open a file, when given the source it will then ask

Re: [R] graphing and scrolling

2006-03-28 Thread Fred J.
in regards to the dynamic resizing, one would think that commands like plot.default {package:graphics} does it, as I am exploring other commands from graphics it seams like tkrplot may not be needed, I am not sure as I just started with graphics in R, maybe a better way to go is call TclTk from

Re: [R] graphing and scrolling

2006-03-28 Thread Fred J.
variable=right, orient="horiz",label='right') b1 <- tkbutton(tt, text='->', command=f4) tkpack(img,s1,s2,b1) -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 > -Original Message

[R] graphing and scrolling

2006-03-27 Thread Fred J.
Dear R users graphing with plot(x) seams to work for a small length(x), when length(x) is too large it seams to clutter the display, a solution would be to display subsets of x at a time, yet a better way which I hope R supports is to place a sliding bar on the display window to control

[R] apply(ing) to sum subset of a vector

2006-03-27 Thread Fred J.
Dear R users I am trying to sum selective elements of a vector but my solution is not cutting it. Example: > g <- 1:5; > from <- 1:3; > to <- 3:5; from to 1 3 2 4 3 5 so I expect 3 sums from g 1+2+3 that is 1 to 3 of g 2+3+4 that is 2 to 4 of g 3+4+5 that

[R] addition using binary

2006-03-26 Thread Fred J.
Dear R users I looked around for a package which can help me with the task of binary arithmetic, the closest I found is sfsmisc with digitsBase function, which may help a little in this task, but still wondering how to get this problem solved. example: given the addition operation of 2 rea

[R] vector conditional modification

2006-03-25 Thread Fred J.
dear R users I need to modify values in a vector, the modification needs to be based on a matrix which define the from_index, to_index and a value. example: > x <- c(1, 0, 6, 3, 8, 9, 4, 3, 0) > m from to value 1 2 3 5 2 5 7 8 3 9 9 11 > expected

[R] problem with diff

2006-03-25 Thread Fred J.
dear R users I am having a problem with the output of diff for a numeric vector which has the values (2,4,6,7), one expects to get 2 2 1 but I am getting 4 6 7, here is the setup. info <- with(rle(x), data.frame(value = values, start = cumsum(lengths)-lengths+1,

[R] subsets of vector

2006-03-24 Thread Fred J.
dear R users I have been trying a lot to get this task accomplished but need your help. input: x <- c(3,3,4,4,4,4,5,7,7,0,1,1,2,2,2) desired output 3 1 2 4 3 6 7 8 9 ... which means, 3 is repeated at index 1:2 4 is repeated at index 3:6 ... my effort has not been that good. a <-

Re: [R] which.minimums not which.min

2006-03-16 Thread Fred J.
Philippe Grosjean <[EMAIL PROTECTED]> wrote: What Fred is looking for is local minima/maxima, also known as turning points, or pits/peaks in a series. You can look at ?turnpoints in pastecs library. > x <- c(1:4,0:5, 4, 11) > x [1] 1 2 3 4 0 1 2 3 4 5 4 11 > tp <- turnpoints(

[R] which.minimums not which.min

2006-03-15 Thread Fred J.
Hi Is there a function which determines the location, i.e., index of the all minimums or maximums of a numeric vector. Which.min(x) only finds the (first) of such. > x <- c(1:4,0:5, 4, 11) > x [1] 1 2 3 4 0 1 2 3 4 5 4 11 > which.min(x) [1] 5 > which.max(x) [

[R] rational and the roundoff error

2006-03-15 Thread Fred J.
Hi I have a list of 12000 rational numbers as inputs, running some of R functions will surly accumulate some round-off errors, Is there a way to have R do its calculations using rational numbers as input to minimize the round-off error? thanks

[R] difftime arguments

2006-03-15 Thread Fred J.
Hi I just started using RGui.exe under widnows. I have a text file containing date arranged in columns and rows, each column has the same format, each row with different formats. 3 of the columns are something like this 1/12/2006 3:59:45 PM I need to calculate the different in seconds b

[R] integration

2005-08-22 Thread Fred J.
Hello after reading few nodes from the info docs. I am not sure if this task can be done using R: the density function f(x,y) = 12xy(1-y) for 0 (1/2) what if the limits of integration are functions of the variable I am integrating over. is this somthing which can be done in a simple way, with R

[R] generating data

2004-05-07 Thread Fred J.
Hello I am trying to generate data in say 2D "x,y" for a circle. grid.circle {grid} does not do. any ides is appreciated. Thanks F.J. __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guid

[R] Least Squares Fit

2004-05-02 Thread Fred J.
Hello I need to plot the least squares fit and get the slope of the line that best fit the data. after reading lm and lsfit, since not being able to understand the use of the second argument "y" for the lsfit, I am giving the lm a go, but know not why the code below does not draw the line on the p

[R] grid location on plot

2004-04-30 Thread Fred J.
Hello I have x <- c(0.5, 0.7, 3.5, 1.5, 2.5, 2.8) y <- c(0.5, 0.8, 1.5, 3.5, 1.5, 1.5) plot.default(x,y,type="p",panel.first=grid(5,5)) I need to plot that on a grid of 0,1,2,3,4,5 showing the grid lines on the these numbers. how can I do this? e.g how can I contorl the x and y min,max values on th

[R] absolute value

2004-04-29 Thread Fred J.
Hello could you please tell me what is the function to get the absolute value of the real or complex number. most of other languages it is abs(x) , what is it in r? I did few searhces in the help docs for no avail. thanks F.J __ [EMAIL PROTECTED] mail

[R] Hankel Matrix

2004-04-29 Thread Fred J.
Hello is there a function in R to generate Hankel Matrix? thanks __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Re: [R] un-expected return by fdim

2004-04-15 Thread Fred J.
> what is fdim()? a package from CRAN which calculate the fractal dimension of datasets. once you have it installed do >library(fdim) >help(fdim) thanks > > > fdim > Error: Object "fdim" not found > > > Please, consider to follow the posting guide and > help the readers of > this list to eas

[R] un-expected return by fdim

2004-04-13 Thread Fred J.
Browse[1]> Lframe v v v v v v v v 1 8 7 6 5 4 3 2 1 2 9 8 7 6 5 4 3 2 3 10 9 8 7 6 5 4 3 4 11 10 9 8 7 6 5 4 5 12 11 10 9 8 7 6 5 6 13 12 11 10 9 8 7 6 7 14 13 12 11 10 9 8 7 8 15 14 13 12 11 10 9 8 Browse[1]> fdim(Lframe,q=2) Error in slopeopt(AllPoints, Alpha) :

Re: [R] fractal calculation using fdim

2004-04-13 Thread Fred J.
Is that how you got your data or are > you using real data? I am using some synthatic data I happend to have. > argument X is to be a dataframe > not a matrix (mat??). Could that be giving you > problems? Do you get > better results with as.data.frame(mat)? no, even with data.frame, it gives

[R] fractal calculation using fdim

2004-04-12 Thread Fred J.
Hello I am getting this Error in slopeopt(AllPoints, Alpha) : Object "LineP" not found when the dim() of the data matrix for which the fdim is being calculated hits a certain values depending on the data set. e.g print(dim(mat)) fd <- fdim(mat,q=2) [1] 27432 [1] 27423 [1] 27414 [1] 2740

Re: [R] building a list in loop

2004-03-27 Thread Fred J.
--- Uwe Ligges <[EMAIL PROTECTED]> wrote: > Fred J. wrote: > > > Hello > > > > getdata <- function(p){ > > fname <- NULL; dl <- list()#build the sturcture > > builddl <- function(q,s){ > >fname <<- c(fname,s) #where "s

Re: [R] variable scope

2004-03-27 Thread Fred J.
--- Duncan Murdoch <[EMAIL PROTECTED]> wrote: > On Fri, 26 Mar 2004 21:34:21 -0800 (PST), you wrote: > > >Hello > > > >getdata <- function(p){ > > fname <- NULL; dl <- list(NULL)#build the > sturcture > > dt <- read.csv(file.path(d,i),header=F) #data > frame > > ret <- builddl(dt,s) #where "s

[R] building a list in loop

2004-03-27 Thread Fred J.
Hello getdata <- function(p){ fname <- NULL; dl <- list()#build the sturcture builddl <- function(q,s){ fname <<- c(fname,s) #where "s" is a string dl <<- list( dl, dt2) } list(names = fname, data = dl) } data <- getdata("c:\somepath") > data $names [1] "fname" $data $data[[1]] <--- s

[R] variable scope

2004-03-26 Thread Fred J.
Hello getdata <- function(p){ fname <- NULL; dl <- list(NULL)#build the sturcture dt <- read.csv(file.path(d,i),header=F) #data frame ret <- builddl(dt,s) #where "s" is a string } how can I get this following function to use fname and dl from the above function without passing them down th

[R] book recommendation

2004-03-25 Thread Fred J.
Hello right, I need a good book to help me with R. background, programming in matlab, perl, visualBasics. os windows and Linux. some good books to match the need would be appreciated. Thanks __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.c

[R] mlocal/mtrace inside a loop

2004-03-25 Thread Fred J.
Hello I need some help in figuring Bravington’s debugger out. Ok I have 2 functions, fun1 and fun2 saved in a ASCII file say filename is funs. Fun1 has a loop which calls fun2, fun2 has a loop which fails and I need to find out the value of the variables of the fun2 and fun1 loops at the specific i

[R] if exists with regex return

2004-03-24 Thread Fred J.
Hello I am trying for an hour now, > p <- "c:/data/" or > p <- "c:/data/abc.hig" d <- sub("(.+/.+?/)(.+)","\\1",p,perl=TRUE) f <- sub("(.+/.+?/)(.+)?","\\2",p,perl=TRUE) if (exists("f")){ #why this gives TRUE no mater what? do this with d and f } else { do that with d } thanks

[R] if block and brackets

2004-03-24 Thread Fred J.
Hello the maunal states "When the if statement is not in a block the else, if present, must appear on the same line as statement1. Otherwise the new line at the end of statement1 yields a syntactically complete statement that is evaluated." well, what is wrong with this if structure? I am getting a

[R] debugging a code

2004-03-24 Thread Fred J.
Hello just learned HowTo but R, reminded me with the way Perl does it but with much less on-line commands, R "AFAIK" has n, c, Q and where and cann't debug outside the {}. 1) is there a more versatile/flexable debugging method for R? I have saved 2 functions in an ASCII file "digfun". "getdata"

[R] building data object on iteration

2004-03-23 Thread Fred J.
Hello I need help, few days tying to work this out but unable to find examples. "alos would appricate direction on how to find exmples" getting the file name "without the extension" into a character vector. for (i in dir("c:/data/")){ filename <- c(filename,sub("([^.]+)(\\..+)","\\1", i)) } Err

[R] regex in R

2004-03-21 Thread Fred J.
Hello I could use some help here with trying to use perl stype regex to extract the first group of letters before a ( . ) so if I have a sting AACEE.adiid and wanting AACEE i <- "AACEE.adiid" grep(".+\..?+",i,perl=T) I must be doing somthing wrong but don't know what it is? thanks __

RE: [R] timing a function

2004-03-21 Thread Fred J.
thanks alot for all the help on this issue. __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

[R] learning to debug

2004-03-21 Thread Fred J.
Hello I am trying to follow the instruction in README.debug on how to debug a code I wrote, so since it only shows the steps on how to debug a built in function and not a code in an *.R file, so ok, let me do this and maybe later I can find out how to code my code in filename.R. now > library(debug

[R] setwd() permenent

2004-03-20 Thread Fred J.
Hello when I close and reopen R it gives back a different wd than what I used in setwd. how can I get it to permenently use dirname in setwd("dirname") and not the other name it keeps defaulting to? I am using W2K and ESS thanks __ [EMAIL PROTECTED] mail

[R] timing a function

2004-03-20 Thread Fred J.
Hello is there a way to time how long it takes to run a code in R. somthing like tic toc in matlab as such? help.search("timing") put out nothing. and while I got you, debugging the code, is there a step through and the rest of the debugging tools working with ESS. thanks

[R] squashing some numbers

2004-03-19 Thread Fred J.
Hello I have a data frame with many col.s and rows V4 V5 V6 V7 3 4 5 6 1 4 4 1 2 4 4 1 4 0 5 1 since the data has the middle 2 rows with V5 and V6 are equal, I need to produce V4 V5 V6 V7 3 4 5 6 this line removed and the value V7 = 1 is added to

Re: [R] loop through files in a dir

2004-03-19 Thread Fred J.
file.path and paste. thanks as a R starter, how could I have found out without posting a question. is there a way I could have searched the help files for a keyword or somthing? thanks __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mai

Re: [R] loop through files in a dir

2004-03-19 Thread Fred J.
d <- dir("c:/data") for (i in d){ dt <- read.csv(c("c:/data/",i),header=FALSE) } wouldn't work because c("c:/data",i) puts out "string" "string" where both strings need to be one string. how can I combinde both in one string, c:/data/i like the good old perl "I wish". thanks ___

[R] loop through files in a dir

2004-03-19 Thread Fred J.
Hello I have data in many files in a directory, how can I loop through the files in a given dir in-order-to build a data.frame? thanks __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting gu

[R] rate of change

2004-03-15 Thread Fred J.
Hello I am wondering, how do I find if R has a certain funciton to do a given task. do I just type help.search("rate"). I am just trying to find a function to calculate the rate of change for a variable. I could come up with one if there isn't any allready builtin. thanks

[R] applying data generating function

2004-03-07 Thread Fred J.
Hello Coming from matlab background, I could use some help on this one. I need to generate a data set based on this equation X(t) = 3.8x(t-1) (1-x(t-1)) + e(t), where e(t) is a N(0,0,001) random variable I need say 100 values. How do I do this? Thanks _

Re: [R] Installing packages

2004-03-06 Thread Fred J.
yes, I loged in as admin. and that fixed the problem, but when I type ?fdim I don't get the help docs, why? even though I have all the htmls under C:\Program Files\R\rw1081\library\fdim\html thanks --- Duncan Murdoch <[EMAIL PROTECTED]> wrote: > On Sat, 6 Mar 2004 13:30:25 -0800 (PST), you wrote:

RE: [R] Installing packages

2004-03-06 Thread Fred J.
n't have to type anything if you install CRAN > packages through the menu system (Packages->Install > package(s) from CRAN..). Failing that, please tell > us more about what the error was. > > Regards, > > Andrew C. Ward > > 56 Azalea Crescent > Fitzgibb

[R] (no subject)

2004-03-05 Thread Fred J.
Hello group. I am trying to install fdim on my win2000 os. this command is giving error and I feel I am not using it correctly, could some one show me why. install.packages(fdim, “C:\Program Files\R\rw1081\library” , CRAN = "http://cran.r-project.org";, "internal", available = NULL, destdir

[R] fractal function

2004-03-05 Thread Fred J.
Hello Does any one know what is the complexity scale of fdim “fractal calculation function”, I need to find O(N) function to do fractal calculation. Thanks a lot __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLE