[R] Venn diagram with numbers within each class

2014-02-21 Thread Luigi Marongiu
Dear all, I would like to draw a Venn plot for data represented by 6 variables. I know how to do this using the package venneuler (which requires rJava). However this package does not report the numbers of elements within each class. Do you know how to display the number of elements using either

[R] Venn diagram with identification numbers

2014-02-21 Thread Luigi Marongiu
Dear all, I would like to draw a Venn plot for data represented by 6 variables. I know how to do this using the package venneuler (which requires rJava). However this package does not report the numbers of elements within each class. Do you know how to display the number of elements using either

[R] Proportional Venn diagram with 6 sest and labels

2014-02-23 Thread Luigi Marongiu
Dear all, I would like to draw a Venn plot for data represented by 6 variables (or sets). I know how to do this using the package venneuler (which requires rJava). However this package does not report the numbers of elements within each class. Do you know an alternative to this package to draw

[R] Proportional Venn diagram with 6 sets and labels

2014-02-23 Thread Luigi Marongiu
Dear all, I would like to draw a Venn plot for data represented by 6 variables (or sets). I know how to do this using the package venneuler (which requires rJava). However this package does not report the numbers of elements within each class. Do you know an alternative to this package to draw

[R] Proportional Venn diagram 6 sets with labels

2014-02-23 Thread Luigi Marongiu
Dear all, I would like to draw a Venn plot for data represented by 6 variables (or sets). I know how to do this using the package venneuler (which requires rJava). However this package does not report the numbers of elements within each class. Do you know an alternative to this package to draw

[R] create dataframe using structure ()

2014-03-13 Thread Luigi Marongiu
dear all, I have tried to create a dataframe using the structure() function, but it did not really work. In column 1 i have the row number, in column 2 and 3 factors (8 and 4 levels respectively) and in column 4 the actual data. any clue on what went wrong? best regards luigi

[R] plot average from aggregated data

2014-03-16 Thread Luigi Marongiu
Dear all, I was trying to plot the average of different variables at the same time; I used the aggregate function and I obtained correctly the averages I wanted. However when I have tried to plot the data the outlook of the data is a bar rather than by a symbol; even using the pch or the col

[R] Calculations with aggregate data: mean +/- standard deviation

2014-03-19 Thread Luigi Marongiu
Dear all, I have obtained the averages (means) and standard deviations (SD) of different variable using the aggregate function, which I have found very useful for these kind of computation. However I would like to calculate the lower and upper ends of the data (that is mean - SD and mean + SD)

[R] Calculations with aggregate data: confidence intervals

2014-03-25 Thread Luigi Marongiu
Dear all, I would like to calculate the confidence intervals on aggregate data. I know how to do this using the t test, but it did not work together with the aggregate function. Is there a function that can be applied to the aggregate function to obtain the (95%) confidence intervals, rather than

[R] find maximum values on the density function of a bimodal distribution

2014-04-21 Thread Luigi Marongiu
*dear all,I have a bimodal distribution and i would like to identify the two most frequent values. Using unimodal values i found from the R archive that is possible to identify the most frequent value, which corresponds to the peak of the density function:from Bert Gunter, Fri Mar 13 04rv -

[R] lattice plot formatting: pch, abbreviation and labels

2014-04-26 Thread Luigi Marongiu
Dear all, I am trying to use the lattice plot, but the syntax is quite difficult. Specifically I have eight variables (1 to 8) each of them further subdivided in two classes (negative=0 and positive=1). I am using the stripplot() to represent these values. I would like to represent the negative

[R] set axis limit in lattice

2014-04-29 Thread Luigi Marongiu
Dear all, I would like to set the axis of a figure using the max() so to have more control on the limits of the axis -- this because in the actual case more independent figures are generated from the same dataframe and these must have the same axis scale. Since the figure is generated using

Re: [R] create dataframe using structure ()

2014-05-10 Thread Luigi Marongiu
, 3352.874906, 93.76421187, 21.3709382, 4193.183281)), # close 2 )) here .Names = c(row, stimulation, type, copy), row.names = c(NA, -32L), class = data.frame) # and only one ) after df Hope this helps, Rui Barradas Em 13-03-2014 18:58, Luigi Marongiu escreveu: dear all, I have tried to create

Re: [R] create dataframe using structure ()

2014-05-11 Thread Luigi Marongiu
, 321.5985377, 0.274424607, 3352.874906, 93.76421187, 21.3709382, 4193.183281)), # close 2 )) here .Names = c(row, stimulation, type, copy), row.names = c(NA, -32L), class = data.frame) # and only one ) after df Hope this helps, Rui Barradas Em 13-03-2014 18:58, Luigi Marongiu escreveu

[R] package to plot mean and standard deviation directly on data

2014-05-12 Thread Luigi Marongiu
Dear all, is there a package, preferably not ggplot, to draw the lines for the standard deviation just by providing the vector with the data? more or less as it happens with the boxplot function. the procedure i implemented herein requires the calculation of the means, standard deviations, limits

Re: [R] package to plot mean and standard deviation directly on data

2014-05-13 Thread Luigi Marongiu
England Armidale NSW 2351 Email: home: mac...@northnet.com.au -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Luigi Marongiu Sent: Tuesday, 13 May 2014 03:50 To: r-help@r-project.org Subject: [R] package to plot mean

Re: [R] package to plot mean and standard deviation directly on data

2014-05-13 Thread Luigi Marongiu
j...@bitwrit.com.au wrote: On Mon, 12 May 2014 06:50:29 PM Luigi Marongiu wrote: Dear all, is there a package, preferably not ggplot, to draw the lines for the standard deviation just by providing the vector with the data? more or less as it happens with the boxplot function. the procedure i

[R] multiple colour to symbols using brkdn.plot()

2014-05-22 Thread Luigi Marongiu
Dear all, I have been plotting response variable (defined as y in the example below) from 4 groups (defined as z variable ) under 5 conditions (defined by the x variable). The formula used is: y ~ z+x. I can differentiate the different z value using a call pch=c(symbol 1, symbol 2, ...) but it

[R] post hoc test to a significant Kruskal-Wallis test package asbio function pairw.kw()

2013-10-21 Thread luigi marongiu
Dear all, I am trying to apply a post hoc test to a significant Kruskal-Wallis test. I eventually found the function ‘pairw.kw()’ of the package “asbio”. This function has the following syntax: pairw.kw(y, x, conf) Arguments y The response variable. A vector of quantitative responses.

[R] plot different groups as factors

2013-12-18 Thread Luigi Marongiu
dear all, i would like to plot the value of different response groups. when i simply use plot(y ~ x) i obtain a series of boxplots. i would rather use dots. i also tried with stripchart(y ~ x), which gives better results but does not place properly the labels since place them alphabetically. in

[R] t test for multiple classes

2013-12-20 Thread Luigi Marongiu
dear all, I have a dataset composed by different classes: I have two main classes, active (Act.) and latent (Lat.), furher subdivided in the gene subclasses IP10 and MIG and then into 7 stimulus sub-subclasses ESAT6 to PHA. Would it be possible to test in a direct way the statistical differences

[R] reduce space between factors groups in a graph

2014-01-22 Thread Luigi Marongiu
Dear all, I am preparing a graph in which values derived from 2 variable are displayed using the stripchart function. I have applied the factor function to separate the 2 variables in two groups, although I noticed that the graph works anyway even without the factorisation of the variables.

[R] add median/mean line to stri-plot in lattice

2014-01-23 Thread Luigi Marongiu
dear all, I set a series of variable subdivided in classes (there are 7 in here, defined by the clause 'levels'), and I am showing the results in strip chart using the package 'lattice'. Whitin each class the samples are further subdivided in active (A) and latent (L). The function I have written

[R] value on logarithmic axis

2014-02-11 Thread Luigi Marongiu
dear all, I have a xy plot in which x is logarithmic. The plot is fine, and I can also represent the logarithimic axis usign a tip given me by William Dunlap. However I would like to plot the actual x value rather than the log10 s in this case. If I remove the xaxt=n the plot reports the

[R] scatterplot using plot() function with factorial data

2014-08-27 Thread Luigi Marongiu
Dear all, I would like to ask whether is possible to draw a scatterplot using the simple plot() function when the data is factorial. Without the addition of the argument factor(), plot() represent the factorial data on a linear scale whereas using this argument transforms plot() from a scatterplot

[R] RAxML using R

2014-12-28 Thread Luigi Marongiu
Dear all, I would like to run RAxML for phylogenetic analysis as indicated on Paradis' Analysis of phylogenetic and evolution with R (p. 158) thus I tried to use the package phyloch and its function raxml(). I am using Linux Ubuntu 14 and I was able to successfully install RAxML on my machine.

Re: [R] RAxML using R

2014-12-29 Thread Luigi Marongiu
Linux Shell with some kind of interface. Best regards Luigi On 29/12/14 11:18, Rui Barradas wrote: Hello, You can put the code of that function in a separate file, say raxml.R and then use source(raxml.R). See the help page ?source. Hope this helps, Rui Barradas Em 28-12-2014 23:09, Luigi

Re: [R] RAxML using R

2014-12-30 Thread Luigi Marongiu
(phyloch) example(raxml) HTH, Ista On Mon, Dec 29, 2014 at 9:23 AM, Luigi Marongiu marongiu.lu...@gmail.com wrote: Dear Rui, thanks for the reply. I tried it but there were serious problems with the function itself: I can't use it as is because there were different error messages according

[R] Select subtree with vector of leaves using zoom function of the ape package

2015-01-01 Thread Luigi Marongiu
Dear all, I am drawing a phylogenetic tree using the zoom() function of the ape package. Since I have 476 sequences in my alignment, this allows me to have the outlook of the main tree and then highlight a portion of it, and this works fine. At the moment I am using the approach of indicating

[R] add scale bar using add.scale.bar() on the main plot drawn with zoom() of the ape package

2015-01-01 Thread Luigi Marongiu
Dear all, I am drawing a phylogenetic tree using the zoom() function of the ape package. Since I have 476 sequences in my allagnment, this allows me to have the outlook of the main tree and then highlight a portion of it, and this works fine. However I would like to draw a scale bar using

[R] add bootstrap to neighbour joining tree using nj function (ape package)

2015-01-06 Thread Luigi Marongiu
Dear all, I am trying to create a neighbour joining tree using the nj() function of ape. I would like to add also the bootstrap. I created a distance matrix with the Kimura 80 algorithm using the muscle function. If I use nj on the distance matrix without any other argument I do obtain the

[R] Select best maximum likelihood tree with raxml (package ips)

2015-01-07 Thread Luigi Marongiu
Dear all, I am trying to build a maximum likelihood (ML) tree using the raxml function of the package ips. I implemented the following script: tr-raxml(seq.align,exec = /usr/bin/raxmlHPC,b = 100, N = 10) where tr is the resulting tree, seq.align is the DNA alignment created with

[R] create pcrfit model with qpcR package

2015-03-15 Thread Luigi Marongiu
Dear all, I am trying to set a model using the pcrfit() function of the qpcR package. I have defined a dataframe with 45 cycles (rows) and 4 readings (columns) derived from a TaqMan qPCR with relative quantification. The data is based on the normalized fluorescent results (main fluorescence minus

[R] pcrfit model for qpcR package

2015-03-10 Thread Luigi Marongiu
Dear all, I have been trying to apply the Cy0 algorithm of the package qpcR by creating an object obj with the normalized fluorescent data from a 384 plate whose characteristics were TaqMan chemistry and 45 cycles. The import of the object was successful but when I implemented the pcrfit model

[R] extract file name from a path string

2015-02-26 Thread Luigi Marongiu
Dear all, what code should I write in order to extract the file name from a give path? Let's say that I want to get the file my file.xls which is in the directory/folder My documents; since I work both with Windows and Linux, the paths I am looking at are in the format:

[R] open xlsx file using read.xls function of gdata package

2015-04-03 Thread Luigi Marongiu
Dear all, I am trying to open excel files using the gdata package. I can do that using a .xls file, but the same file, containing the same data, formatted in .xlsx gives error (R does not recognize the pattern from where to start reading the data). Doen anybody knows whether it is possible to read

[R] calculate Cy0 with qpcR package when fitting is failed

2015-04-13 Thread Luigi Marongiu
Dear all, i am trying to calculate the Cy0 from a series of PCR runs in the 384-well. I can create the regression model using the modlist function: ml-modlist( obj, cyc = 1, model = l4, norm = FALSE, remove = none ) where obj is the dataframe with the

Re: [R] Handling NA values in a if statement

2015-04-20 Thread Luigi Marongiu
) } (X-clipper(x, ll, ul)) that works all right. Best regards Luigi On Fri, Apr 17, 2015 at 11:43 PM, Marc Schwartz marc_schwa...@me.com wrote: On Apr 17, 2015, at 5:23 PM, Luigi Marongiu marongiu.lu...@gmail.com wrote: Dear all, I have a vector with a certain range of values including infinity

[R] high density plots using lattice dotplot()

2015-04-20 Thread Luigi Marongiu
Dear all, I am trying to plot the results of a PCR experiments that involves 384 individual plots. Admittedly the space for the plots will be tiny, but I just nedd some icon to have a feeling of the layout of the experiment and a quick comparison of the plots. I believe that lattice would be the

[R] select portion of text file using R

2015-04-20 Thread Luigi Marongiu
Dear all, I have a flat file (tab delimited) derived from an excel file which is subdivided in different parts: a first part is reporting metadata, then there is a first spreadsheet indicated by [ ], then the actual data and the second spreadsheet with the same format [ ] and then the data. How

[R] create function to plot high density data using lattice

2015-04-23 Thread Luigi Marongiu
Dear all, with the most useful help of Duncan I updated a script to plot high density data in the form of 384 squares containing tiny plots. The function works and it is possible to create a pdf version of the output. but when i try to make a function out of this script, the resulting pdf file is

Re: [R] select portion of text file using R

2015-04-27 Thread Luigi Marongiu
\tAdeno 1 \t0.82 \t1 \t2 \tAdeno 1\ \t0.93 ... \t2 \t1 \tAdeno 2 \t0.78 ... On Mon, Apr 20, 2015 at 12:17 PM, Duncan Murdoch murdoch.dun...@gmail.com wrote: On 20/04/2015 3:28 AM, Luigi Marongiu wrote: Dear all, I have a flat file (tab delimited) derived from an excel file which is subdivided

[R] Handling NA values in a if statement

2015-04-17 Thread Luigi Marongiu
Dear all, I have a vector with a certain range of values including infinity and NA. I would like to remove the values that are outside a given range (lower level = ll and upper level = ul) but I am getting the error due to the NA values (missing value where TRUE/FALSE needed). I then included the

[R] add outer strip for levels in lattice plot (useOuterStrips alternative for Lattice)

2015-07-05 Thread Luigi Marongiu
Dear all, I would like to add an outer strip or something like that on a lattice plot I am making. Such plot contains 384 cells and, since I am not interested in the axis values, I set: scales = list( x = list(draw = FALSE), y = list(draw = FALSE),

[R] assign optimal cut-off to variable using Epi/pROC packages

2015-07-27 Thread Luigi Marongiu
Dear all, I am calculating the optimal cut-off for a test against a gold standard measure. I can determine the cut-off (in the following example 5.905) but I would like to assign it to an atomic variable so that the cut-off is updated every time the data is changed. I am using the ROC and roc

[R] force values for elements of a dataframe below cut-off

2015-07-27 Thread Luigi Marongiu
Dear all, I would like to clip the data of a dataframe by forcing the value of the elements below a cut-off to 0. I believe that the function to be used is sapply but I could not have the call working properly. Would you have any tip? Best regards Luigi value - c(5.43, 6.63, 0, 6.2, 5.61, 0,

[R] convert character vector to decimal for numeric testing

2015-07-15 Thread Luigi Marongiu
Dear all, I have a vector that comes from some calculations I am making and this vectors turns out to be in character format rather than numerical. I can convert it in numerical format but then the calculations are not correct, as you can see in the following example. I was also expecting that

[R] plot auto key and text into panels using lattice

2015-07-20 Thread Luigi Marongiu
Dear all, I am writing some text into several panels which I can do with this script (in capital the variables): xyplot(Y ~ X | Z, data = DATAFRAME, groups = Z, ylab= Y, xlab=X, main=TITLE, scales = list(

[R] How to calculate variance on multiple numbers at once?

2015-11-11 Thread Luigi Marongiu
Dear all, if I have a sample set of the following numbers x1=0.09, x2=0.94, x3=0.48, x4=0.74, x5=0.04 I can calculate the variance easily. But if each x is actually a subset of multiple values, what would be the formula to calculate the variance? and it is possible to implement such mathematical

Re: [R] How to calculate variance on multiple numbers at once?

2015-11-12 Thread Luigi Marongiu
xample > and/or http://adv-r.had.co.nz/Reproducibility.html for suggestions on how to > pose a question here. In particular data should be supplied in dput() format > as it gives us a copy of exactly how the data is formatted on your machine. > > > John Kane > Kingston ON Can

[R] variance of repeated measurements

2015-11-16 Thread Luigi Marongiu
Dear all, how can I calculate the global variance of repeated measurements? can I simply use the var() function or shall i use more sophisticated tools such as aov()? and in the latter case, how can i extract the variance value? I am providing an example. Thank you. best regards luigi >>> samp <-

[R] change font size within the panel.text function (package lattice)

2015-07-11 Thread Luigi Marongiu
Dear all, I am adding some text to the panels of a graph generated through the lattice function using the argument: xyplot( ..., panel = function(x, y,...) { panel.xyplot(x,y,...)

Re: [R] add outer strip for levels in lattice plot (useOuterStrips alternative for Lattice)

2015-07-11 Thread Luigi Marongiu
from the grid package I use it regularly for annotating See also https://stat.ethz.ch/pipermail/r-help/2005-February/066264.html https://stat.ethz.ch/pipermail/r-help/2005-April/069456.html Duncan -Original Message- From: Luigi Marongiu [mailto:marongiu.lu...@gmail.com] Sent

Re: [R] add outer strip for levels in lattice plot (useOuterStrips alternative for Lattice)

2015-07-08 Thread Luigi Marongiu
-help-boun...@r-project.org] On Behalf Of Luigi Marongiu Sent: Monday, 6 July 2015 09:56 To: r-help Subject: [R] add outer strip for levels in lattice plot (useOuterStrips alternative for Lattice) Dear all, I would like to add an outer strip or something like that on a lattice plot I am making

[R] modify strip labels with given text using lattice package

2015-08-31 Thread Luigi Marongiu
Dear all, I am drawing a barchart plot with lattice and the resulting strips are taking the value of the variable being compared (in this example "assay"). However I would like to write myself the value to place into the strips, let's say I want to call the variables as "molecular test" and

[R] Conditional replacement and removal of data frame values

2015-08-31 Thread Luigi Marongiu
Dear all, I have a data frame and I would like to do the following: a) replace value of one variable "a" according to the value of another one "b" b) remove all the instances of the variable "b" For the sake of argument, let's say I have the following data frame: test <- rep(c("Adenovirus",

[R] convert list int data frame

2015-09-14 Thread Luigi Marongiu
Dear all, i would like to convert a list onto a data frame object. Is there an easy way of doing it? I know I should use unlist() but I am not sure about the implementation for the addition of the row numbers; or I could extract one member at the time with something like x <- my.list[[i]] but then

[R] Truncation of character fields in a data frame

2015-09-27 Thread Luigi Marongiu
Dear all, I am reading a txt file into the R environment to create a data frame, however I have notice that some entries have a truncated version of a field, so for instance I get "Astro" instead of "Astro 1-Astro 1" and "Sapo" for "Sapo #1-Sapo_1" and "Sapo #2-Sapo_2", but I also get "Adeno 40/41

[R] define number of clusters in kmeans/apcluster analysis

2015-12-13 Thread Luigi Marongiu
Dear all, I am trying to do some cluster analysis, both with the base R and the apcluster. Both methods give 2 clusters, which is what I am looking for since I am interested in identifying positive and negative results. However I could not find a way to fine-tuning the analysis in order to

[R] lattice strip.custom in plot for multiple groups

2015-12-18 Thread Luigi Marongiu
Dear all, I am plotting the count of some data subdivided in different groups. the variables i am using are: A = tests performed B = positive/negative results (but in this case the results are all positive, so all 1) C = multiple (1) or single (0) test applied D = count of instances E = cases (1)

[R] introduce axis break lattice plot multipanel

2015-12-18 Thread Luigi Marongiu
Dear all, I am plotting some data using lattice's barchart. One of the counts I am plotting has a very large value with respect to the other variables and I would like to introduce a break in the axis to compensate for this 'anomaly' and give more breath to the other bars. In this example the high

[R] neuralnet to discriminate a given outcome by giving cutoff outputs

2015-12-20 Thread Luigi Marongiu
Dear all, I am trying to use neural networks to discriminate positive and negative outcomes from a test; this outcome is given in the z variable of the example I am providing. Each outcome is associated with a pair of variables x and y and I was planning to identify the cut-offs that could

[R] interpolation using R for PCR quantification

2015-12-24 Thread Luigi Marongiu
Dear all, I am a newbie in interpolation using R and I would like to learn better the procedure. I am applying interpolation to quantify nucleic acid targets using an assay known as PCR. To do this, I have two sets of variables: standard of known concentrations and query for which I need to

[R] Improve training of predictive neural networks

2016-01-13 Thread Luigi Marongiu
Dear all, I am trying to train a predictive neural network to guess the positivity/negativity of some tests I have done. I am using the library pnn and I have empirically identified the best sigma to use in the algorithm but the results I got are affected by false positive results. The actual

[R] cut-off point to separate overlapping distributions

2016-02-14 Thread Luigi Marongiu
dear all, I have a set of data that can be defined as bimodal; would be possible to define a cut-off to split it? my mathematical/statistical knowledge is limited, my apologies, thus i am not sure what kind of area this problem belongs to; at the moment I can fit -- thanks to previous help from

[R] non parametric algorithm npEM (library mixtools) usage

2016-02-15 Thread Luigi Marongiu
Dear all, I am using mixtols to find cut-off values from datasets. At the moment I can run the parametric function normalmixEM from the library mixtools, but I owuld like to generalize the procedure with the non parametric version npEM. However I am confused regarding the arguments to use in this

[R] fine tune changepoint

2017-02-08 Thread Luigi Marongiu
Dear all, I am using the package changepoint to identify a cut-off between positive and negative values for an assay. I followed the vignette of the package and the results are replicated, so I tried with a dataset of my choice. In the assay, the positive have a value above 0.8 and the negative

[R] single strip for the same group in dotplot lattice

2017-02-22 Thread Luigi Marongiu
dear all, I have a set of data that is subdivided in cluster (run 1/run 2) and in target (A/B). When plotting, I obtain a panel strip with "run 1" and "run 2" for each "A" and "B" panel, so "run 1" appears twice and so does "run 2". It is possible to merge the strip together so that I will have

Re: [R] single strip for the same group in dotplot lattice

2017-02-22 Thread Luigi Marongiu
> > my.data$clus2 <- with(my.data, interaction(cluster, target)) > > and call: dotplot(value ~ type| clus2, ... ) > > > Philip > > > On 22/02/2017 8:03 PM, Luigi Marongiu wrote: > >> dear all, >> I have a set of data that is subdivided in cluster (

Re: [R] single strip for the same group in dotplot lattice

2017-02-24 Thread Luigi Marongiu
quot;Negative", "Positive"), col="black"), rectangles = list(col=c("grey", "green", "red")) ) ) ) <<< also, the answer provided by Paul does the job all right, but uses the package grid instead of lattice. The stripless package (Be

Re: [R] single strip for the same group in dotplot lattice

2017-02-23 Thread Luigi Marongiu
= paste("Run",1:2), > par.strip.text = list(cex = 1) ), >xlab = "Target", >ylab = "Reading", >auto.key = T, >panel = panel.superpose > ) > > dotplot( > value ~ type|cluster, > mdata2, >

[R] cluster data in lattice dotplot and show stdev

2017-02-16 Thread Luigi Marongiu
dear all, i have a set of data that is separated in the variables: cluster (two runs), type (blank, negative and positive) and target (A and B), each duplicated. I am plotting it with lattice and the result is a 2x2 matrix plot in which the top two cells (or panels) are relative to run 2, the

[R] Upgrade R 3.2 to 3.3 using tar.gz file on Ubuntu 16.04

2016-09-13 Thread Luigi Marongiu
Dear all, I am working on Linux Ubuntu 16.04 and I have installed R 3.2. I need to upgrade to R 3.3 and I tried several options available online with no success. I downloaded the tar.gz file for R 3.3 and I would like to ask how can I use this file in order to accomplish the upgrade. Many thanks,

[R] plot empty when drawing from custom function

2017-03-28 Thread Luigi Marongiu
Dear all, I have set a function to draw some data using lattice; the drawing works when I use lattice on its own, but if I put it into my custom function, the final plot is empty, yet the terminal reports RStudioGD 1 as normal. What am I missing? regards, Luigi >>> cluster <- c(rep("A",

[R] customize labels useOuterStrips lattice

2017-03-30 Thread Luigi Marongiu
Dear all, I am plotting some data using lattice and the function useOuterStrips to make use of more labels. It is possible to customize the labels of useOuterStrips so I can decide what to write in it? instead of having, let's say, A and B I could put something more descriptive. best regards luigi

[R] add median value and standard deviation bar to lattice plot

2017-03-15 Thread Luigi Marongiu
Dear all, I am analyzing some multivariate data that is organized like this: 1st variable = cluster (A or B) 2nd variable = target (a, b, c, d, e) 3rd variable = type (blank, negative, positive) 4th variable = sample (the actual name of the sample) 5th variable = average (the actual reading --

Re: [R] add median value and standard deviation bar to lattice plot

2017-03-16 Thread Luigi Marongiu
ot;, "Negative", "Positive"), col="black"), > rectangles = list(col=c("grey", "green", "red")) > ) >) > ) > > FWIW, I think adding 1 sd bars is a bad idea statistically. > > And though it made no

Re: [R] add median value and standard deviation bar to lattice plot

2017-03-17 Thread Luigi Marongiu
t; > Bert Gunter > > "The trouble with having an open mind is that people keep coming along > and sticking things into it." > -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) > > > On Thu, Mar 16, 2017 at 1:38 AM, Luigi Marongiu > <ma

[R] Lattice stacked barplot vertical bars

2017-09-22 Thread Luigi Marongiu
Dear all, I have made a barplot using lattice in which the bars are stacked horizontally. I would like to stack them vertically, but if I use the parameter 'horizontal = FALSE' I get the error: 'Error in FUN(X[[i]], ...) : invalid 'type' (character) of argument'. The problem I face is that, in

Re: [R] Lattice stacked barplot vertical bars

2017-09-22 Thread Luigi Marongiu
es=list(col=c("yellow", "orange")) > ), > strip = strip.custom(factor.levels = c("Cases","Controls"), > strip.levels=TRUE, > strip.names=FALSE, > par.strip

Re: [R] Histogram of character elements

2018-06-07 Thread Luigi Marongiu
a your hands on a > copy of https://www.r-project.org/doc/bib/R-books_bib.html#R:Sarkar:2008 It's > really worth it if you plan to spend time with lattice. > > Cheers, > Ben > > > On Jun 7, 2018, at 7:02 AM, Luigi Marongiu wrote: > > also, with this approach, I n

[R] Histogram of character elements

2018-06-07 Thread Luigi Marongiu
Dear all, I have a dataframe with a column representing the names of the elements (a, b, etc) and one with their frequencies. How can I plot the frequencies so that each element has an associated frequency value? I have been thinking of a histogram, but I have found it difficult to implement. I

Re: [R] Histogram of character elements

2018-06-07 Thread Luigi Marongiu
ou are after? > > group <- c("a", "b", "c", "d", "e") > freq <-c(1, 2, 2, 5, 3) > x = rep(group, freq) > barplot(table(x)) > > Cheers, > Ben > > > > On Jun 7, 2018, at 6:00 AM, Luigi Marongiu wrote: >

Re: [R] Histogram of character elements

2018-06-07 Thread Luigi Marongiu
uot;e") > freq <-c(1, 2, 2, 5, 3) > x = rep(group, freq) > barplot(table(x)) > > Cheers, > Ben > > > > On Jun 7, 2018, at 6:00 AM, Luigi Marongiu wrote: > > Dear all, > I have a dataframe with a column representing the names of the > elements

[R] substr gives empty output

2018-01-21 Thread Luigi Marongiu
Dear all, I have a string, let's say "testing", and I would like to extract in sequence each letter (character) from it. But when I use substr() I only properly get the first character, the rest is empty (""). What am I getting wrong? For example, I have this code: >>> x <- "testing" k <-

Re: [R] substr gives empty output

2018-01-23 Thread Luigi Marongiu
bstr(x, i, i) > > and you should get what you want. > Cheers, > Tim > > > Date: Sun, 21 Jan 2018 10:50:31 -0500 > > From: Ek Esawi <esaw...@gmail.com> > > To: Luigi Marongiu <marongiu.lu...@gmail.com>, r-help@r-project.org > > Subject: Re: [R] su

Re: [R] Boxplot with linear (not categorical) x-axis

2018-10-01 Thread Luigi Marongiu
> > > Bill Dunlap > TIBCO Software > wdunlap tibco.com > > On Fri, Sep 28, 2018 at 3:05 AM, Luigi Marongiu > wrote: >> >> Dear all, >> I am using boxplot to draw some data. Would be possible to have the >> X-axis linear (as in a scatter plot) in

[R] Boxplot: draw outliers in colours

2018-09-28 Thread Luigi Marongiu
Dear all, I am trying to overlap two series of boxplots on the same graph. In order to distinguish the outliers from one series to the other, would be possible to colour the outliers?: instead of the standard black, is it possible to give a chosen colour? Thank you >>> This is the example. I

[R] Boxplot with linear (not categorical) x-axis

2018-09-28 Thread Luigi Marongiu
Dear all, I am using boxplot to draw some data. Would be possible to have the X-axis linear (as in a scatter plot) instead of the standard categorical axis? The data I have is subdivided into three groups at the numerical values 1, 3, 5; boxplot treats these as categorical values; in fact, I can

[R] Erase content of dataframe in a single stroke

2018-09-27 Thread Luigi Marongiu
Dear all, I would like to erase the content of a dataframe -- but not the dataframe itself -- in a simple and fast way. At the moment I do that by re-defining the dataframe itself in this way: > df <- data.frame(A = numeric(), + B = numeric(), + C =

[R] R plot split screen in uneven panels

2018-12-12 Thread Luigi Marongiu
Dear all, I would like to draw two plots in the same device so that there is a single row and two columns, with the first column being 1/3 of the device's width. I am creating a PNG object with width = 30 and height = 20 cm. I know that I should use split.screen or layout but I am lost with the

Re: [R] R plot split screen in uneven panels

2018-12-13 Thread Luigi Marongiu
ng much more flexibly(and therefore requiring more effort to learn). >> >> Cheers, >> Bert >> >> >> Bert Gunter >> >> "The trouble with having an open mind is that people keep coming along and >> sticking things into it." >> -- Op

[R] extract hyperplan from e1071 model

2018-12-20 Thread Luigi Marongiu
Dear all, I am using the package e1071 for modeling SVM. I obtain a model from the data and I can plot the results; the plot shows the support vectors (as 'X's) and the shaded areas as it should be. However, I don't like the plot generated from the model and I would like instead to have more

[R] error in plotting model from kernlab

2019-01-07 Thread Luigi Marongiu
Dear all, I have a set of data in this form: > str 'data.frame': 1574 obs. of 14 variables: $ serial: int 12751 14157 7226 15663 11088 10464 1003 10427 11934 3999 ... $ plate : int 43 46 22 50 38 37 3 37 41 11 ... $ well : int 79 333 314 303 336 96 235 59 30 159 ... $ sample: int 266

Re: [R] error in plotting model from kernlab

2019-01-07 Thread Luigi Marongiu
. > > [1] https://stat.ethz.ch/pipermail/r-help/2018-December/461010.html > > On January 7, 2019 4:26:20 AM PST, Luigi Marongiu > wrote: > >Dear all, > >I have a set of data in this form: > >> str > >'data.frame': 1574 obs. of 14 variables: > >$ se

[R] Kernlab Error in .local(x, ...) when plot model

2018-12-28 Thread Luigi Marongiu
Dear all, I have generated a model with KERNLAB using the following steps: the data is a dataframe df of two numerical variables x and y, and each point is assigned a z value that is a factor of two levels: positive and negative. The data has the strucutre: > str(df) 'data.frame': 1574 obs. of 3

Re: [R] error in plotting model from kernlab

2019-01-08 Thread Luigi Marongiu
; > plot(mod, data = df) > > > kernlab::plot(mod, data = df) > > but I get this error: > > > > Error in .local(x, ...) : > > Only plots of classification ksvm objects supported > > > > seems to me selfexplanatory. What did maintainer said about it? &

[R] convert columns of dataframe to same factor levels

2018-12-19 Thread Luigi Marongiu
Dear all, I have a data frame with character values where each character is a level; however, not all columns of the data frame have the same characters thus, when generating the data frame with stringsAsFactors = TRUE, the levels are different for each column. Is there a way to provide a single

Re: [R] convert columns of dataframe to same factor levels

2018-12-19 Thread Luigi Marongiu
Thank you, that worked fine for me. Best wishes of merry Christmas and happy new year, Luigi On Wed, Dec 19, 2018 at 12:19 PM Duncan Murdoch wrote: > > On 19/12/2018 5:58 AM, Luigi Marongiu wrote: > > Dear all, > > I have a data frame with character values where each charac

Re: [R] add points to lattice cloud plot (3D scatter)

2019-02-28 Thread Luigi Marongiu
is indeed a double ll at the start > > Michael > > On 28/02/2019 10:39, Luigi Marongiu wrote: > > Dear all, > > is it possible to add points to a lattice cloud plot (3D scatter)? I > > can plot the main data, but what if I wanted to add another point. In > > R there

  1   2   3   4   >