Re: [R] shift by one column given rows in a dataframe

2015-07-24 Thread maxbre
hi thank you all for the great replies, very useful indeed even if some of them a bit too aggressive (which is never, ever a good approach in my very humble opinion... but that's a matter of taste and style I do not want to discuss here); sorry again for bothering someone with such a trivial and

Re: [R] shift by one column given rows in a dataframe

2015-07-23 Thread maxbre
Hi thank you for your reply: it's a neat solution but unfortunately not applicable to my specific case; in fact as I specified in my first post (I may have been not enough clear, sorry for that!) I can not rely on any search method grep-like because the value xxx in the rows of df_start can be

Re: [R] shift by one column given rows in a dataframe

2015-07-23 Thread maxbre
sorry but honestly I do not get your point I need to shift to left by one position (i.e. one column) the entire rows 2,4,5 of df_start so that to obtain as final result the structure indicated in df_end I know in advance the rows that I need to shift hope it clears a bit, now -- View this

[R] recursively rename dir and files

2015-04-09 Thread maxbre
this is my reproducible example setwd(.) dir.create(./my dir with space) dir.create(./my dir with space/my sub dir with space) file.create(./my dir with space/my dir file with space.txt) file.create(./my dir with space/my sub dir with space/my sub dir file with space.txt) now I need to rename

[R] issue on installation of RCurl on Debian Wheezy

2014-12-23 Thread maxbre
I must say I'm pretty new to Linux Debian and R so I might miss here reporting some relevant information (just in case, sorry for that!); I've been looking around the web and also onto this mailing list - and indeed this topic has been already covered-, but still I can't find any useful solution

[R] decimal separator from comma to dot

2013-08-09 Thread maxbre
This is my reproducible example df-structure(list(IDANT = c(37837L, 37838L, 37839L, 37840L, 37841L, 37842L, 37843L, 40720L, 40721L, 40722L), N_TX = c(6L, 6L, 6L, 4L, 1L, 1L, 1L, 2L, 2L, 1L), TILT = c(0L, 0L, 0L, 0L, 6L, 6L, 6L, 0L, 0L, 0L), DIREZIONE = c(50L, 220L, 110L, 50L, 220L, 110L, 50L,

Re: [R] decimal separator from comma to dot

2013-08-09 Thread maxbre
Thanks it's the same thread I've been looking at But it's not answering to my questions… -- View this message in context: http://r.789695.n4.nabble.com/decimal-separator-from-comma-to-dot-tp4673414p4673433.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] decimal separator from comma to dot

2013-08-09 Thread maxbre
thanks david very humbly I'm asking you and all r-help users to forgive me about violating the rules of this great mailing list, I didn't meant to do that: I simply slipped into that, sorry again! ...and what about the case of many variables to be changed at the same time? seriously, I do not

Re: [R] lattice xyplot point labelling

2013-02-28 Thread maxbre
hi duncan, thanks a lot for your help! yes, your solution is working fine with a little tweaking of the vector poscec : but on the other hand it's just affecting the relative position of labels around respective points; to get more flexibility would be probably better to supply (even if I do

[R] lattice xyplot point labelling

2013-02-27 Thread maxbre
This is my reproducible example tv.ms-structure(list(inq = structure(4:17, .Label = c(D4, D5, D6a, D6b, D6c, D7, D8, F4, F5a, F5b, F6a, F6b, F6c, F6d, F7a, F7b, F8), class = factor), tv.km.median.iteq = c(0.324, 0.238, 0.242, 0.0801,

[R] lattice dotplot labelling median and mean values for each panel

2013-02-18 Thread maxbre
By considering this reproducible example #start code library(lattice) dotplot(variety ~ yield | site, data = barley, layout = c(1,6), index.cond= function(x,y){median(x)}, panel = function(x,y,...) { panel.dotplot(x,y,...) median.values - median(x)

Re: [R] lattice dotplot labelling median and mean values for each panel

2013-02-18 Thread maxbre
sorry, I've managed to find a (partial) solution to my problem (even not much elegant); now what is left out is the proper tweaking of labels... any better solutions? dotplot(variety ~ yield | site, data = barley, layout = c(1,6), index.cond= function(x,y){median(x)},

Re: [R] lattice dotplot labelling median and mean values for each panel

2013-02-18 Thread maxbre
sorry again, there is something more to consider... in case I need to plot x axis in logarithmic scale the above solution is not working: so now my further question is how to do that when I set scales=list(x=list(log=TRUE)) I've been trying to simplify my original example to the bare bone (for

[R] triax.plot: control legend position and size of point labels

2012-12-19 Thread maxbre
Given this example library(plotrix) a-c(34,10,70) b-c(33,10,20) c-c(33,80,10) test-data.frame(A=a,B=b,C=c) triax.plot(test, main =title, at=seq(0.25,0.75,by=0.25), tick.labels=list(l=seq(0.25,0.75,by=0.25), r=seq(0.25,0.75,by=0.25),

Re: [R] function customization

2012-11-19 Thread maxbre
thank you all for the great help, in particular to dennis murphy in order to close the thread I'm posting here the final solution to my question new.ex-structure(list(TEC = c(0.21, 0.077, 0.06, 0.033, 0.014, 0.007, 0.21, 0.077, 0.01, 0.033, 0.05, 0.014),

[R] function customization

2012-11-16 Thread maxbre
Given my reproducible example: new.ex-structure(list(TEC = c(0.21, 0.077, 0.06, 0.033, 0.014, 0.007, 0.21, 0.077, 0.01, 0.033, 0.05, 0.014), LR = c(FALSE, FALSE, TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE, TRUE, TRUE ), group = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L,

[R] How to modify a S4 function (in the package NADA)

2012-11-15 Thread maxbre
I want to get access to the code of an S4 method in order to possibly modify a function to accomplish my particular needs: in my case the function in is cenfit() from the package NADA Now, given my reproducible example: my.ex-structure(list(TEC = c(0.21, 0.077, 0.06, 0.033, 0.014, 0.0072), LR =

Re: [R] How to modify a S4 function (in the package NADA)

2012-11-15 Thread maxbre
sorry sarah you are right, my fault, this is the correct reproducible example (a misinterpretation of LR type occurred in previous reproducible example) my.ex-structure(list(TEC = c(0.21, 0.077, 0.06, 0.033, 0.014, 0.0072 ), LR = c(FALSE, FALSE, TRUE, FALSE, TRUE, FALSE)), .Names = c(TEC, LR),

Re: [R] How to modify a S4 function (in the package NADA)

2012-11-15 Thread maxbre
Ok, this is my finally (hopefully) clean session my.ex-structure(list(TEC = c(0.21, 0.077, 0.06, 0.033, 0.014, 0.0072), LR = c(FALSE, FALSE, TRUE, FALSE, TRUE, FALSE)), .Names = c(TEC,LR), row.names = c(NA, -6L), class = data.frame) library(NADA) xx-with(my.ex, cenfit(TEC,LR) )

Re: [R] lattice dotplot reorder contiguous levels

2012-09-26 Thread maxbre
sorry for my slow reply, this is what I worked out so far… my reproducible example and the code test-structure(list(site = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L,

[R] lattice dotplot reorder contiguous levels

2012-09-20 Thread maxbre
my reproducible example test-structure(list(site = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 5L), .Label = c(A, B, C,

Re: [R] Boxplot lattice vs standard graphics

2012-09-17 Thread maxbre
here it is, I think (I hope) I'm getting a little closer with this, but still there is something to sort out... error using packet 1 unused argument(s) (coef =1.5, do.out=TRUE) by reading the help for panel.bwplot at the argument stats it says: the function must accept arguments coef and

[R] Boxplot lattice vs standard graphics

2012-09-14 Thread maxbre
Given my reproducible example test-structure(list(site = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 5L), .Label = c(A,

[R] how to change variable names in corrgram diagonal

2012-08-13 Thread maxbre
given this example library(corrgram) corrgram(mtcars[2:6], order=TRUE, upper.panel=panel.conf, lower.panel=panel.pie, diag.panel=panel.minmax, text.panel=panel.txt) how can I change the variable names in main diagonal? (so that I can put more informative

Re: [R] Reordering levels of a factor within a lattice dotplot

2012-06-23 Thread maxbre
thanks a lot deepayan, I will study carefully your code! thanks max -- View this message in context: http://r.789695.n4.nabble.com/Reordering-levels-of-a-factor-within-a-lattice-dotplot-tp4634201p4634277.html Sent from the R help mailing list archive at Nabble.com.

[R] Reordering levels of a factor within a lattice dotplot

2012-06-22 Thread maxbre
Given my reproducible example myexample-structure(list(site = structure(c(4L, 2L, 2L, 4L, 2L, 4L, 4L, 3L, 1L, 3L, 1L, 1L, 3L, 4L, 5L, 2L), .Label = c(A, B, C, D, E), class = factor), obs = c(0.302, 0.956, 0.72, 1.21, 0.887, 0.728, 1.294, 20.493, 0.902, 0.031, 0.468, 2.318, 4.795, 89.581,

Re: [R] Reordering levels of a factor within a lattice dotplot

2012-06-22 Thread maxbre
thanks for your reply but I don't think your solution can accomplish to what I need... (I can't see any ordering of the variable sample with reference to the variable obs) please keep in mind that for a numer of reasons that I do not mention here for the sake of conciseness in my case the

Re: [R] how to add a vertical line for each panel in a lattice dotplot with log scale?

2012-06-15 Thread maxbre
Thanks a lot, Deepayan! What a great honour hearing from you inside this thread! Now, at last, I understand where MY problem was (but please, don’t laugh – too loudly at least – and, first of all, sorry for that!) this was my “poor” wrong attempt (but I did not post this) means-mean(exp(x))

Re: [R] how to add a vertical line for each panel in a lattice dotplot with log scale?

2012-06-11 Thread maxbre
sorry but I can't close this thread with a viable solution other than the following one (i.e. by defining an user function to add line); I understand that the problem is related to the fact that: mean(log(.)) != log(mean(.)) is but for some reason I can't put all that in practice inside the

Re: [R] how to add a vertical line for each panel in a lattice dotplot with log scale?

2012-06-08 Thread maxbre
thanks david, yes, you are right PART of the confusion is because of what you mentioned (sorry for that) but going back to my own data this is JUST PART of the problem… ...see my reproducible example teq-structure(list(site = structure(c(4L, 2L, 2L, 4L, 2L, 4L, 4L, 3L, 1L, 3L, 1L, 1L, 3L, 4L,

Re: [R] how to add a vertical line for each panel in a lattice dotplot with log scale?

2012-06-07 Thread maxbre
thanks ilai sorry, I mixed up a little: I was thinking to medians of each panel but instead I was trying to plot medians for each variety (what an awful chart, indeed!) thanks for your solution (medians for each panel), it works perfectly, as usual... cheers max -- View this message in

Re: [R] how to add a vertical line for each panel in a lattice dotplot with log scale?

2012-06-07 Thread maxbre
...and what if I need to plot another vertical line for showing also the means for each panel? by simply adding another call to panel.abline () seems not producing a correct result for each panel # medians and means for each panel: dotplot(variety ~ yield | site, data = barley,

Re: [R] how to add a vertical line for each panel in a lattice dotplot with log scale?

2012-06-07 Thread maxbre
thanks kimmo I managed to get the desired result by first plotting the medians and then adding the means through the user defind function posted in thread you mentioned (here it is http://r.789695.n4.nabble.com/Adding-mean-line-to-a-lattice-density-plot-td4455770.html#a4456502) # start

Re: [R] how to add a vertical line for each panel in a lattice dotplot with log scale?

2012-06-07 Thread maxbre
a new session of R with the following sessionInfo() R version 2.15.0 (2012-03-30) Platform: i386-pc-mingw32/i386 (32-bit) locale: [1] LC_COLLATE=Italian_Italy.1252 LC_CTYPE=Italian_Italy.1252 [3] LC_MONETARY=Italian_Italy.1252 LC_NUMERIC=C [5] LC_TIME=Italian_Italy.1252

[R] how to add a vertical line for each panel in a lattice dotplot with log scale?

2012-06-06 Thread maxbre
by considering this example from barley dataset #code start dotplot(variety ~ yield | site, data = barley, scales=list(x=list(log=TRUE)), layout = c(1,6), panel = function(...) { panel.dotplot(...) #median.values - tapply(x, y, median)# medians

[R] Wilcoxon-Mann-Whitney U value: outcomes from different stat packages

2012-05-29 Thread maxbre
/2685616?uid=3738296uid=2129uid=2uid=70uid=4sid=47699045750617 Any of you have faced the same type of issues? Or am I completely wrong? maxbre -- View this message in context: http://r.789695.n4.nabble.com/Wilcoxon-Mann-Whitney-U-value-outcomes-from-different-stat-packages-tp4631703.html Sent from

Re: [R] Kolmogorov-Smirnov test and the plot of max distance between two ecdf curves

2012-05-28 Thread maxbre
that depends on the range of x values not necessarly coincident in the two different approaches ...any thought about this? maxbre -- View this message in context: http://r.789695.n4.nabble.com/Kolmogorov-Smirnov-test-and-the-plot-of-max-distance-between-two-ecdf-curves-tp4631437p4631564.html

Re: [R] Kolmogorov-Smirnov test and the plot of max distance between two ecdf curves

2012-05-28 Thread maxbre
functions are a port of Marsaglia et al. to the .C interface. Rui Barradas maxbre wrote thanks rui that's what I was looking for I have another related question: - why of the difference between the max distance D calculated with ks.test() and the max distance D â

[R] Kolmogorov-Smirnov test and the plot of max distance between two ecdf curves

2012-05-26 Thread maxbre
Hi all, given this example #start a-c(0,70,50,100,70,650,1300,6900,1780,4930,1120,700,190,940, 760,100,300,36270,5610,249680,1760,4040,164890,17230,75140,1870,22380,5890,2430) length(a) b-c(0,0,10,30,50,440,1000,140,70,90,60,60,20,90,180,30,90,

[R] KS test and plot max distance between two ecdf curves

2012-05-25 Thread maxbre
Given this example a-c(0,70,50,100,70,650,1300,6900,1780,4930,1120,700,190,940, 760,100,300,36270,5610,249680,1760,4040,164890,17230,75140,1870,22380,5890,2430) b-c(0,0,10,30,50,440,1000,140,70,90,60,60,20,90,180,30,90, 3220,490,20790,290,740,5350,940,3910,0,640,850,260)

Re: [R] Dotchart showing mean and median by group

2012-05-10 Thread maxbre
hi all I have another question reated to the dotchart: is it possible by means of par() to set a logaritmic scale? If yes, how ? and if not, any alternative solution? thanks -- View this message in context:

Re: [R] Dotchart showing mean and median by group

2012-05-10 Thread maxbre
thank you all for the high level contributions and the very helpful feedback; I think I have now enogh material to study for months: what a good lesson learned! cheers max -- View this message in context:

Re: [R] Lattice side by side boxplots with average

2012-05-09 Thread maxbre
thanks ilai that's exactly what I was looking for! in fact, I've been in trouble with: - the assignment of mean values to each factor (which is correctly sorted out by mean.values[x] as your example clearly show up) - and also with the position of mean values along x axis (because that x +

[R] Dotchart showing mean and median by group

2012-05-09 Thread maxbre
Given this example mean.values-colMeans(VADeaths) mean.values-apply(VADeaths, 2, mean) median.values-apply(VADeaths, 2, median) dotchart(VADeaths, gdata=mean.values) dotchart(VADeaths, gdata=median.values) is it possible to “combine” a single dotchart showing both the mean and the median for

[R] Lattice side by side boxplots with average

2012-05-08 Thread maxbre
Given the following example library(lattice) attach(barley) After a long meandering around the web I managed to get a side by side boxplots through: bwplot(yield ~ site, data = barley, groups=year, pch = |, box.width = 1/3, auto.key = list(points = FALSE, rectangles = TRUE, space

Re: [R] xyplot lattice fine control of axes limits and thick marks (with log scale)

2012-04-12 Thread maxbre
ok this is these are the final results: by relation free vs sliced vs scale component function relation free http://r.789695.n4.nabble.com/file/n4551068/relation_free.png relation sliced http://r.789695.n4.nabble.com/file/n4551068/relation_sliced.png scale component function

Re: [R] xyplot lattice fine control of axes limits and thick marks (with log scale)

2012-04-11 Thread maxbre
hi, I just realised I want to go a little further in the control of the chart appearance and I would like to have the same number of ticks displayed in both axes of all panels given this code xyplot(tv ~ ms | sub_family, data=tm, #as.table=TRUE, aspect=xy, xlab =

Re: [R] xyplot lattice fine control of axes limits and thick marks (with log scale)

2012-04-11 Thread maxbre
Oh yes, I see now the problem... thank you max -- View this message in context: http://r.789695.n4.nabble.com/xyplot-lattice-fine-control-of-axes-limits-and-thick-marks-with-log-scale-tp4511897p4549180.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] xyplot lattice fine control of axes limits and thick marks (with log scale)

2012-03-30 Thread maxbre
yes elai, that's what I want! thank you for support maxbre -- View this message in context: http://r.789695.n4.nabble.com/xyplot-lattice-fine-control-of-axes-limits-and-thick-marks-with-log-scale-tp4511897p4518205.html Sent from the R help mailing list archive at Nabble.com

Re: [R] xyplot lattice fine control of axes limits and thick marks (with log scale)

2012-03-29 Thread maxbre
Elai Ok, this is my reproducible example tm-structure(list(name_short = structure(1:29, .Label = c(D4, D5, D6a, D6b, D6c, D7, D8, F4, F5a, F5b, F6a, F6b, F6c, F6d, F7a, F7b, F8, P105, P114, P118, P123, P126, P156, P157, P167, P169, P189, P77, P81), class = factor), sub_family =

[R] xyplot lattice fine control of axes limits and thick marks (with log scale)

2012-03-28 Thread maxbre
After a long and winding road (sorry but I'm a novice) I get to a final result which is quite close to what I need; nevertheless I would like to tweak a little further the xyplot so that I can get ***for each single panel defined by variable z*** a finer control over: -the x and y the limits: I

[R] how to avoid grid overlapping in a boxplot

2012-03-22 Thread maxbre
Given the following chart: i.e. a boxplot with a grid boxplot(x~y) grid(nx=NA,ny=NULL) my question: how to avoid the overlapping of boxes (and whiskers) by grid lines? thank you for any help pointing me in the right direction max -- View this message in context:

[R] merge multiple data frames

2012-01-26 Thread maxbre
This is my reproducible example (three data frames: a, b, c) a-structure(list(date = structure(1:6, .Label = c(2012-01-03, 2012-01-04, 2012-01-05, 2012-01-06, 2012-01-07, 2012-01-08, 2012-01-09, 2012-01-10, 2012-01-11, 2012-01-12, 2012-01-13, 2012-01-14, 2012-01-15, 2012-01-16, 2012-01-17,

Re: [R] merge multiple data frames

2012-01-26 Thread maxbre
thank you for your reply I'll study and test your code (which is a bit obscure to me up to now); by the way do you think that merge_all is a wrong way to hit? thanks again m -- View this message in context: http://r.789695.n4.nabble.com/merge-multiple-data-frames-tp4331089p4331830.html Sent

Re: [R] julian day form POSIXt object

2011-09-30 Thread maxbre
sorry, I managed to find the solution at last (by reading the help but sometime is really difficult!) Class POSIXlt is a named list of vectors representing yday 0–365: day of the year. another lesson learned bye -- View this message in context:

Re: [R] julian day form POSIXt object

2011-09-30 Thread maxbre
here is an alternative long and winded solution to the problem sticking on the julian function of chron package test$year - as.integer(as.character(test$date, %Y)) test$month - as.integer(as.character(test$date, %m)) test$day - as.integer(as.character(test$date, %d)) test$hour -

[R] julian day form POSIXt object

2011-09-29 Thread maxbre
hello all, this is my reproducible example data frame test-structure(list(date = structure(c(1262300400, 1262304000, 1262304000, 1262307600, 1262307600, 1262311200, 1262311200, 1262314800, 1262314800, 1262318400, 1262318400, 1262322000, 1262322000, 1262325600, 1262325600, 1262329200,

Re: [R] julian day form POSIXt object

2011-09-29 Thread maxbre
yes, you are perfectly right, sorry for that but for me was not so clear the error message! and the third code example I posted (not working either) should be of length one (if I'm not wrong again) but most of all what is not included in my reproducible example and get a bit confused my

Re: [R] reshape data from long to wide format

2011-09-10 Thread maxbre
thank you to both you, this is exactly the solution I was looking for max -- View this message in context: http://r.789695.n4.nabble.com/reshape-data-from-long-to-wide-format-tp3801381p3803759.html Sent from the R help mailing list archive at Nabble.com.

[R] reshape data from long to wide format

2011-09-09 Thread maxbre
This is my reproducible example: example-structure(list(SENSOR = structure(1:6, .Label = c(A, B, C, D, E, F), class = factor), VALUE = c(270, 292.5, 0, 45, 247.5, 315), DATE = structure(1:6, .Label = c( 01/01/2010 1, 01/01/2010 2, 01/01/2010 3, 01/01/2010 4, 01/01/2010 5, 01/01/2010 6),

Re: [R] lattice panel fine control

2011-06-03 Thread maxbre
there is another big problem I did not realised earlier; the labelling of point is not correct: the labels appears to be recycled the same for all panels, why? and this time I'm quite sure I've been reading the hlp file (as much as I understand) thanks -- View this message in context:

Re: [R] lattice panel fine control

2011-06-02 Thread maxbre
be accomplished by arrows but the following line is giving me an error panel.arrows(x=tv.avg-tv.erst, y=ped.avg-ped.erst, x1=tv.avg+tv.erst, y1=ped.avg+ped.erst, angle=90, code=3) thanks again for your great help in bootstrapping me to the lattice features maxbre -- View this message in context: http://r

Re: [R] lattice panel fine control

2011-06-02 Thread maxbre
ok thanks again for your reply: this is what I worked out so far #start code xyplot(ped.avg ~ tv.avg | family, data=mydata, strip=strip.custom(bg='white'), col.line=1, main=title, xlab = expression(paste('tv [ fg/', m^3, ' ]', sep = '')),

[R] lattice panel fine control

2011-06-01 Thread maxbre
as possible thank you maxbre -- View this message in context: http://r.789695.n4.nabble.com/lattice-panel-fine-control-tp3566347p3566347.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list https://stat.ethz.ch