[R] [beginner] how to run *.r script from graphic interface (R Console window) ?

2010-11-21 Thread madr
Is there a fuction like open("path/to/file"), readfile or sth like that that would run code from R file just like I was it typing myself into R Console window ? -- View this message in context: http://r.789695.n4.nabble.com/beginner-how-to-run-r-script-from-graphic-interface-R-Console-window-tp3

[R] display data as 1px dots in scatterplot ?

2010-11-21 Thread madr
By default scatter-plot presents data by using circles, is there a way to make it 1px dots ? -- View this message in context: http://r.789695.n4.nabble.com/display-data-as-1px-dots-in-scatterplot-tp3052343p3052343.html Sent from the R help mailing list archive at Nabble.com. ___

[R] "negative alpha" or custom gradient colors of data dots in scatterplot ?

2010-11-21 Thread madr
I know that by setting alpha to for example col = rgb(0, 0, 0, 0.1) it is possible to see how many overlapping is in the plot. But disadvantage of it is that single points are barely visible on the background. So I wonder if there is possible to make setting that single points would be almost blac

[R] [beginner] simple keyword to exit script ?

2010-11-21 Thread madr
I have tried quit(), and return() but first exits from whole graphical interface and second is only for functions. What I need only to exit from current script and return to the console. -- View this message in context: http://r.789695.n4.nabble.com/beginner-simple-keyword-to-exit-script-tp30524

Re: [R] [beginner] simple keyword to exit script ?

2010-11-21 Thread madr
I try to use stop(), but i get: Error in eval.with.vis(expr, envir, enclos) : -- View this message in context: http://r.789695.n4.nabble.com/beginner-simple-keyword-to-exit-script-tp3052417p3052430.html Sent from the R help mailing list archive at Nabble.com. __

[R] plot(x,y xlab=NULL,ylab=NULL) but labels still visible.

2010-11-21 Thread madr
Labels are still present on graph render, their names are x and y that is the same as I used on the variables to supply data for chart. How to get rid of them. -- View this message in context: http://r.789695.n4.nabble.com/plot-x-y-xlab-NULL-ylab-NULL-but-labels-still-visible-tp3052439p3052439.h

Re: [R] plot(x,y xlab=NULL,ylab=NULL) but labels still visible.

2010-11-21 Thread madr
here's the code x= c(1,5,7,3,4) y= c(2,4,5,2,5) plot(x,y,ylim=c(-20,20),xlim=c(min(x),max(x)),pch='X',col = rgb(0, 0, 0, 0.5), xaxt=NULL,yaxt=NULL, xlab=NULL,ylab=NULL) and x and y are still visible -- View this message in context: http://r.789695.n4.nabble.com/plot-x-y-xlab-NULL-ylab-NULL-but

[R] how to get rid of unused space on all 4 borders in plot() render

2010-11-21 Thread madr
x= c(1,5,7,-3,4) y= c(2,4,-5,2,5) plot(x,y,ylim=c(-20,20),xlim=c(min(x),max(x)),pch='X',col = rgb(0, 0, 0, 0.5),yaxt="n", ann=FALSE) and this code produces: http://i53.tinypic.com/ffd7d3.png Where I marked in red areas that I want to get rid of and use as much real screen estate as I can. -- Vi

Re: [R] [beginner] simple keyword to exit script ?

2010-11-21 Thread madr
Is there any way of suppressing that error, like in other programming languages you can specifically invoke an error or simply exit, like after user input, exiting then is not always identical with error , there are cases when it is intended behavior. I thought R makes that distinction. -- View t

Re: [R] how to get rid of unused space on all 4 borders in plot() render

2010-11-21 Thread madr
I have looked into par documentation, and only setting for size of the plot area was pin. But this setting sets the area as inflexible, that is no matter how I make the window small or big it stays the same. Default value has advantage that however it uses plot area that is always smaller than dev

Re: [R] how to get rid of unused space on all 4 borders in plot() render

2010-11-21 Thread madr
# 89 px / 105 px - wasted space png("d:/test.png",width=1369,height=1129,units="px") par(bg='black',fg='gray',col='gray',col.axis='gray',col.lab='gray',col.main='gray',col.sub='gray') plot(x,y,ylim=c(-20,20),xlim=c(min(x),max(x)),pch='.',col = rgb(1,1,1, 0.5),yaxt="n", ann=FALSE) dev.off() so onl

[R] is it possible to put tick labels inside plotting area ?

2010-11-21 Thread madr
here is what i mean: before: http://i51.tinypic.com/117xv6v.png after : http://i51.tinypic.com/sv2xed.png -- View this message in context: http://r.789695.n4.nabble.com/is-it-possible-to-put-tick-labels-inside-plotting-area-tp3052777p3052777.html Sent from the R help mailing list archive at Nabb

Re: [R] is it possible to put tick labels inside plotting area ?

2010-11-21 Thread madr
I found it. It was hard to find because no one asked about it , the proper question was about distance from the axis which can be negative. So the proper answer is : par( mgp = c(0, -1.4, 0) ) - only the center value is controlling feature in question. -- View this message in context: http://r

Re: [R] how to get rid of unused space on all 4 borders in plot() render

2010-11-21 Thread madr
finally I found what I wanted, John Kane send it, and I don't know why it hasn't been posted automatically to the list so I post it by myself: solution is this: par(mai=c(.5,.5,.5,.5)) These four numbers are the margins, so setting it to 0,0,0,0 will render only plot area with 1px for box on eve

[R] "unexpected numeric constant" while reading tab delimited csv file

2010-11-22 Thread madr
my csv file is very simple - just one line for purpose of this test: 0{TAB}0 and read function is this: csvdata = read.csv(file="d:/s/test.csv",head=FALSE,sep="\t") then error comes: Error in source("d:/test.csv") : d:/test.csv:1:9: unexpected numeric constant 1: 0 0 but when I chang

Re: [R] "unexpected numeric constant" while reading tab delimited csv file

2010-11-22 Thread madr
the problem shows up only in console when script is loaded thru source() and separator character is eighter tab or space, strangely, when I'm running script directly form file in text environment everything is ok. [I'm reposing this because my previous post didn't get on the list because double

[R] xlim=c(min(x), max(x)) still produces extra margin on both sides of x axis in plot()

2010-11-22 Thread madr
code: op <- par(bg='black',fg='gray',col='gray',col.axis='gray',col.lab='gray',col.main='gray',col.sub='gray',mai=c(0,0,0,0), tck = 0.01, mgp = c(0, -1.4, 0), mar=c(0,0,0,0)) plot(x,y,ylim=c(-20,20),xlim=c(min(x),max(x)),pch='X',col = rgb(1,1,1, 0.5),yaxt="n", ann=FALSE) abline(v=c(min(x),max(x)),

Re: [R] xlim=c(min(x), max(x)) still produces extra margin on both sides of x axis in plot()

2010-11-22 Thread madr
i found solution myself: par(xaxs = "i", yaxs = "i") - it sets axis ranges to actual data ranges sorry for question but maybe this will be easier to find if someone would be searching for this -- View this message in context: http://r.789695.n4.nabble.com/xlim-c-min-x-max-x-still-produces-extr

Re: [R] "unexpected numeric constant" while reading tab delimited csv file

2010-11-22 Thread madr
The folder are the same, I just deleted the long path because it is irrelevant and by mistake left /s i one of the paths, they should be identical. I'm running this package: http://cran.r-project.org/bin/windows/base/R-2.12.0-win.exe on win xp 32 bit -- View this message in context: http://r.78

[R] how to sample lowess/loess into matrix ?

2010-11-22 Thread madr
code: x <- rnorm(32) y <- rnorm(32) plot(x,y) lines(lowess(x,y),col='red') Now I need to sample the lowess function into matrix where one series will be X and other will be values of lowess at particular X. -- View this message in context: http://r.789695.n4.nabble.com/how-to-sample-lowess-loe

Re: [R] how to sample lowess/loess into matrix ?

2010-11-22 Thread madr
I found it, it was SO simple: lowessline <- lowess(x,y) write.csv(lowessline, "loess.csv") -- View this message in context: http://r.789695.n4.nabble.com/how-to-sample-lowess-loess-into-matrix-tp3053458p3053601.html Sent from the R help mailing list archive at Nabble.com. _

[R] how to round only one column of a matrix ?

2010-11-22 Thread madr
round() function affects all values of a matrix, I want only to round column that is called 'y'. -- View this message in context: http://r.789695.n4.nabble.com/how-to-round-only-one-column-of-a-matrix-tp3054363p3054363.html Sent from the R help mailing list archive at Nabble.com. __

[R] I need a very specific unique like function and I don't know even how to properly call this

2010-11-22 Thread madr
consider this matrix: [,1] [,2] [1,]3 7 [2,]6 5 [3,]7 5 [4,]3 5 [5,]7 5 [6,]5 5 [7,]8 4 [8,]2 4 [9,]7 4 [10,]0 6 I need to delete all rows where column 2 above and below has the same value, so the effect would be:

Re: [R] "negative alpha" or custom gradient colors of data dots in...

2010-11-22 Thread madr
Well I "hacked" it i maybe not so elegant way: x <- rnorm(10) y <- rnorm(10) png('out.png',width=600,height=500,units="px") op <- par(bg='black',fg='gray',col='gray',col.axis='gray',col.lab='gray',col.main='gray',col.sub='gray',mai=c(0,0,0,0), tck = 0.01, mgp = c(0, -1.4, 0), xaxs = "i",

[R] what is this averaging function called ?, has R a built in function for it ?

2010-12-04 Thread madr
I know little of statistics and have created this function out of intuition. But since this algorithm is so basic I wonder what is the proper name of this function and is it build in R. here is some code in PHP to illustrate what the function is doing, it uses some function I created but the mean

Re: [R] what is this averaging function called ?, has R a built in function for it ?

2010-12-07 Thread madr
my input is from csv file: fname= 'test' csvdata = read.table(file=paste(fname,'.csv',sep=''),head=FALSE) x = csvdata$V1 y = csvdata$V2 I know that this group is not about php , but I managed to make function from above a lot faster, and I'm still cannot operate R at a sufficient level to recrea

[R] increase or decrease variable by 1

2010-12-07 Thread madr
many languages have shorthands for that operation like: variable += 1 or ++variable is there something like that in R ? -- View this message in context: http://r.789695.n4.nabble.com/increase-or-decrease-variable-by-1-tp3076390p3076390.html Sent from the R help mailing list archive at Nabble.c

Re: [R] please show me simple example how to plot

2010-12-07 Thread madr
Well, maybe I didn't write it clear. I know how to create scatterplot, and how to import data from csv file. But I do not know how to add this fitting that mentioned in sumbject to a plot. I do not know for what function name to look for in R. I played some time with ls, and it didn't create a lin

[R] please show me simple example how to plot "Distance-Weighted Least Squares" fitting

2010-12-07 Thread madr
I got simple x,y pairs of data and simple scatterplot and just cannot figure how to do it , there are many examples but always there is error popping out please show me an example stripped with additional data just core of what I need to do to get this damn line -- View this message in context:

[R] how to get vector of data from line ?

2010-12-07 Thread madr
I have created a density line d<- density(X) now I need to read values from that line for example what is the value of this line at x = 1, 2, 3 etc... -- View this message in context: http://r.789695.n4.nabble.com/how-to-get-vector-of-data-from-line-tp3076943p3076943.html Sent from the R help m

Re: [R] how to get vector of data from line ?

2010-12-07 Thread madr
well, I found id the simplest answer is: d<- approx(density(x),xout=...) where xout is a vector of the points where the data should be sampled -- View this message in context: http://r.789695.n4.nabble.com/how-to-get-vector-of-data-from-line-tp3076943p3077058.html Sent from the R help mailing l

[R] longer object length is not a multiple of shorter object length

2010-12-07 Thread madr
In datamatrix[, "y"] == datamatrix[, "y"][-1] : longer object length is not a multiple of shorter object length out = c(FALSE,datamatrix[,'y'] == datamatrix[,'y'][-1]) and I do not know why I get that error, the resulting out matrix is somehow one row larger than datamatrix... all I try to do

[R] how to find smallest non-negative and biggest non-positive number in a matrix column ?

2010-12-08 Thread madr
so it could be zero in both cases when given column has 0 set in it -- View this message in context: http://r.789695.n4.nabble.com/how-to-find-smallest-non-negative-and-biggest-non-positive-number-in-a-matrix-column-tp3077870p3077870.html Sent from the R help mailing list archive at Nabble.com.

[R] how to strip list from NA values looking only at one column ?

2010-12-08 Thread madr
I have got a list with 3 colums x,y,z, now I want do delete whole rows where column z has NA values I am not intereted in x and y columns if there are also NA values or not, moreover I do not want to touch them because if there would be NA that would mean a more serious error for me, and I have c

[R] how to make partial mean() of a matrix only when second value matching some logic

2010-12-08 Thread madr
for example I have matrix with two columns x,y 1,0.56 2,9.55 2,7.56 5,2.55 5,0.56 3,0.55 2,0.56 2,1.56 so I need to take average from y values placed where x==2 -- View this message in context: http://r.789695.n4.nabble.com/how-to-make-partial-mean-of-a-matrix-only-when-second-value-matching-s

[R] what function use to draw probability of finding data between certain constaints

2010-12-08 Thread madr
I have simple scatterplot of temperature data taken daily from many years so at particular date there are usually more than one measurement, but not all data is complete. Now I want to draw line that will show me probability of finding data between defined bands of temperatures, for example +5 de