Re: [R] saveRDS() and readRDS() Why? [solved, kind of]
On Thu, 08-Nov-2018 at 11:06AM +0100, Martin Maechler wrote: |> > Patrick Connolly |> > on Thu, 8 Nov 2018 20:27:24 +1300 writes: [...] |> > |> > I still don't know Why, but I know How. |> |> Hmm.. and nobody has been able to reproduce your problem, right? |> |> IIUC, currently you are suggesting that [on Windows], if you do |> |> saveRDS(rawdata, file="rawdata.rds") |> |> the resulting file is does not work withreadRDS() on Linux. |> What again are your R versions on the two platforms? It's an old version on Windows. I haven't used Windows R since then. major 3 minor 2.4 year 2016 month 03 day16 I've tried R-3.5.0 and R-3.5.1 Linux versions. The problem might be entirely because of the ancient Windows version. |> |> Could you dput() -- provide a (short if possible) version of rawdata where |> that problem occurs ? I can't make a smaller version of rawdata which comes from scraping a non-public web address, but next week when I'm back where those machines are, I'll try it with a small data frame which is reproducible. |> |> Best, |> Martin |> |> |> > ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~. |> >___Patrick Connolly |> > {~._.~} Great minds discuss ideas |> > _( Y )_Average minds discuss events |> > (:_~*~_:) Small minds discuss people |> > (_)-(_) . Eleanor Roosevelt |> > |> > ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~. |> > |> > __ |> > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see |> > https://stat.ethz.ch/mailman/listinfo/r-help |> > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html |> > and provide commented, minimal, self-contained, reproducible code. -- ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~. ___Patrick Connolly {~._.~} Great minds discuss ideas _( Y )_ Average minds discuss events (:_~*~_:) Small minds discuss people (_)-(_) . Eleanor Roosevelt ~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] summary function did not work with multcomp with 27 comparisons
Dear List. I submitted this inquiry on Thursday but it bounced because I wasn;s a memeber under my current e-mail address; I since joined, but did not receive Friday's issue. So please excuse me if you have seen this query before. I ran multcomp with 27 comparisons. The glht command returned an mcp object, but the summary command with the Westfall correction ddi not give a summary. When I ran the same dataset with 4 comparisons I got p-values. When I sued a summary with univariate or Bonferroni�s method with all 27 comarisons I got p-values. But all 27 did not work for Wesrfall. Please advise. Here is a record of my session with 27 comparisons and Westfall: R version 3.5.1 (2018-07-02) -- "Feather Spray" Copyright (C) 2018 The R Foundation for Statistical Computing Platform: x86_64-apple-darwin15.6.0 (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. [R.app GUI 1.70 (7543) x86_64-apple-darwin15.6.0] [History restored from /Users/friedman/.Rapp.history] objc[31790]: Class FIFinderSyncExtensionHost is implemented in both /System/Library/PrivateFrameworks/FinderKit.framework/Versions/A/FinderKit (0x7fff9c2b7c90) and /System/Library/PrivateFrameworks/FileProvider.framework/OverrideBundles/FinderSyncCollaborationFileProviderOverride.bundle/Contents/MacOS/FinderSyncCollaborationFileProviderOverride (0x119bf8cd8). One of the two will be used. Which one is undefined. > library(multcomp) Loading required package: mvtnorm Loading required package: survival Loading required package: TH.data Loading required package: MASS Attaching package: �TH.data� The following object is masked from �package:MASS�: geyser > tumor<-read.table("a8_1wayall_input.txt",sep="\t",header=T) > class(tumor) [1] "data.frame" > dim(tumor) [1] 309 2 > tumor[1,] condition log2vol 1 aa.vector.4w 7.297375 > > model<-lm(log2vol~condition,data=tumor) > summary(model) Call: lm(formula = log2vol ~ condition, data = tumor) Residuals: Min 1Q Median 3QMax -7.997 -2.414 0.291 2.164 8.059 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 4.587760.60457 7.588 4.3e-13 *** conditionab.vector.6w 1.398180.85499 1.635 0.103054 conditionac.vector.8w 2.890850.85499 3.381 0.000820 *** conditionba.dnmt1kd.4w -2.674910.84733 -3.157 0.001760 ** conditionbb.dnmt1kd.6w -1.433900.84733 -1.692 0.091654 . conditionbc.dnmt1kd.8w -0.471880.84733 -0.557 0.578020 conditionca.dnmt3bkd.4w -3.153250.89139 -3.537 0.000469 *** conditioncb.dnmt3bkd.6w -2.173340.89139 -2.438 0.015355 * conditioncc.dnmt3bkd.8w -1.501870.89139 -1.685 0.093078 . conditionda.dnmt1kdhrad9.4w 1.081531.08991 0.992 0.321863 conditiondb.dnmt1kdhrad9.6w 2.383831.08991 2.187 0.029517 * conditiondc.dnmt1kdhrad9.8w 3.539901.08991 3.248 0.001297 ** conditionea.dnmt3bkdhrad9.4w 0.027951.06049 0.026 0.978991 conditioneb.dnmt3bkdhrad9.6w 1.340371.06049 1.264 0.207263 conditionec.dnmt3bkdhrad9.8w 3.409551.06049 3.215 0.001449 ** --- Signif. codes: 0 �***� 0.001 �**� 0.01 �*� 0.05 �.� 0.1 � � 1 Residual standard error: 3.141 on 294 degrees of freedom Multiple R-squared: 0.3155, Adjusted R-squared: 0.2829 F-statistic: 9.678 on 14 and 294 DF, p-value: < 2.2e-16 > model.mc<-glht(model,linfct=mcp(condition=c("ab.vector.6w-aa.vector.4w=0", +"ac.vector.8w-aa.vector.4w=0", +"ac.vector.8w-ab.vector.6w=0", + "bb.dnmt1kd.6w-ba.dnmt1kd.4w=0", +"bc.dnmt1kd.8w-ba.dnmt1kd.4w=0", +"bc.dnmt1kd.8w-bb.dnmt1kd.6w=0", + "cb.dnmt3bkd.6w-ca.dnmt3bkd.4w=0", +"cc.dnmt3bkd.8w-ca.dnmt3bkd.4w=0", +"cc.dnmt3bkd.8w-cb.dnmt3bkd.6w=0", + "db.dnmt1kdhrad9.6w-da.dnmt1kdhrad9.4w=0", +"dc.dnmt1kdhrad9.8w-da.dnmt1kdhrad9.4w=0", +"dc.dnmt1kdhrad9.8w-db.dnmt1kdhrad9.6w=0", + "eb.dnmt3bkdhrad9.6w-ea.dnmt3bkdhrad9.4w=0", +"ec.dnmt3bkdhrad9.8w-ea.dnmt3bkdhrad9.4w=0", +"ec.dnmt3bkdhrad9.8w-eb.dnmt3bkdhrad9.6w=0", + "ba.dnmt1kd.4w-aa.vector.4w=0", +"ca.dnmt3bkd.4w-aa.vector.4w=0", +"da.dnmt1kdhrad9.4w-ba.dnmt1kd.4w=0", +"ea.dnmt3bkdhrad9.4w-ca.dnmt3bkd.4w=0", +
[R-es] ggplot2 con 2 columnas
Dear all, I try to graph the two variables prec1 and prec2, using ggplot2 for several points, using facet for the different points, in similar times, total 8 times, the one variable is plotted, but I wish the two in bars. If someone can help thank you gr4 <- ggplot(malla, aes(x=tiempo, y=prec1),color="blue",aes(x=tiempo,y=prec2),color="red")+ geom_bar(stat="identity") gr4 + facet_grid(lugar ~.) tiempo lugar prec1 prec2 1 t1a1 1 1 2 t2a1 2 2 etc etc etc Thanks Dear all, I try to graph the two variables prec1 and prec2, using ggplot2 for several points, using facet for the different points, in similar times, total 8 times, the one variable is plotted, but I wish the two in bars. If someone can help thank you Dear all, I try to graph the two variables prec1 and prec2, using ggplot2 for several points, using facet for the different points, in similar times, total 8 times, the one variable is plotted, but I wish the two in bars. If someone can help thank you tiempo lugar prec1 prec2 1 t1a1 1 1 2 t2a1 2 2 3 t3a1 4 3 4 t4a1 3 2 5 t5a1 6 3 6 t6a1 3 2 7 t7a1 5 4 8 t8a1 4 5 9 t1a2 6 6 10 t2a2 3 3 11 t3a2 3 6 12 t4a2 2 3 13 t5a2 6 7 14 t6a2 5 4 15 t7a2 7 4 16 t8a2 3 2 View(malla) library(ggplot2) gr4 <- ggplot(malla, aes(x=tiempo, y=prec1),color="blue",aes(x=tiempo,y=prec2),color="red")+ geom_bar(stat="identity") gr4 + facet_grid(lugar ~.) Dear all, I try to graph the two variables prec1 and prec2, using ggplot2 for several points, using facet for the different points, in similar times, total 8 times, the one variable is plotted, but I wish the two in bars. If someone can help thank you Dear all, I try to graph the two variables prec1 and prec2, using ggplot2 for several points, using facet for the different points, in similar times, total 8 times, the one variable is plotted, but I wish the two in bars. If someone can help thank you Dear all, I try to graph the two variables prec1 and prec2, using ggplot2 for several points, using facet for the different points, in similar times, total 8 times, the one variable is plotted, but I wish the two in bars. If someone can help thank you Dear all, I try to graph the two variables prec1 and prec2, using ggplot2 for several points, using facet for the different points, in similar times, total 8 times, the one variable is plotted, but I wish the two in bars. If someone can help thank you Dear all, I try to graph the two variables prec1 and prec2, using ggplot2 for several points, using facet for the different points, in similar times, total 8 times, the one variable is plotted, but I wish the two in bars. If someone can help thank you Dear all, I try to graph the two variables prec1 and prec2, using ggplot2 for several points, using facet for the different points, in similar times, total 8 times, the one variable is plotted, but I wish the two in bars. If someone can help thank you tiempo lugar prec1 prec2 1 t1a1 1 1 2 t2a1 2 2 3 t3a1 4 3 4 t4a1 3 2 5 t5a1 6 3 6 t6a1 3 2 7 t7a1 5 4 8 t8a1 4 5 9 t1a2 6 6 10 t2a2 3 3 11 t3a2 3 6 12 t4a2 2 3 13 t5a2 6 7 14 t6a2 5 4 15 t7a2 7 4 16 t8a2 3 2 View(malla) library(ggplot2) gr4 <- ggplot(malla, aes(x=tiempo, y=prec1),color="blue",aes(x=tiempo,y=prec2),color="red")+ geom_bar(stat="identity") gr4 + facet_grid(lugar ~.) Dear all, I try to graph the two variables prec1 and prec2, using ggplot2 for several points, using facet for the different points, in similar times, total 8 times, the one variable is plotted, but I wish the two in bars. If someone can help thank you tiempo lugar prec1 prec2 1 t1a1 1 1 2 t2a1 2 2 3 t3a1 4 3 4 t4a1 3 2 5 t5a1 6 3 6 t6a1 3 2 7 t7a1 5 4 8 t8a1 4 5 9 t1a2 6 6 10 t2a2 3 3 11 t3a2 3 6 12 t4a2 2 3 13 t5a2 6 7 14 t6a2 5 4 15 t7a2 7 4 16 t8a2 3 2 View(malla) library(ggplot2) gr4 <- ggplot(malla, aes(x=tiempo, y=prec1),color="blue",aes(x=tiempo,y=prec2),color="red")+ geom_bar(stat="identity") gr4 + facet_grid(lugar ~.) Dear all, I try to graph the two variables prec1 and prec2, using ggplot2 for several points, using facet for the different points, in similar times,
Re: [R-es] Asignar distancias
On Sun, Nov 11, 2018 at 12:43:40AM +0100, Manuel Mendoza wrote: > Utilizo la función merge desde hace poco, pero no se me ocurre cómo > utilizarla para esto. Yo pienso que se puede hacer con una combinación de > ifelse-s pero no sé cómo. Seguro que hay más de una forma ce hacerlo. ¿Sería esta la solución? > df1 <- data.frame(Var1 = c('a', 'a', 'a'), Var2 = c('a', 'b', 'c'), Dist = > c(0, 3, 4)) > df2 <- data.frame(Var1 = c('a', 'a'), Var2 = c('c', 'b')) > df3 <- merge(df1, df2) > df3 Var1 Var2 Dist 1ab3 2ac4 Saludos, -- José María (Chema) Mateos || https://rinzewind.org/ ___ R-help-es mailing list R-help-es@r-project.org https://stat.ethz.ch/mailman/listinfo/r-help-es
Re: [R-es] Asignar distancias
Utilizo la función merge desde hace poco, pero no se me ocurre cómo utilizarla para esto. Yo pienso que se puede hacer con una combinación de ifelse-s pero no sé cómo. Seguro que hay más de una forma ce hacerlo. Quoting José María Mateos : On Sat, Nov 10, 2018 at 07:54:19PM +0100, Manuel Mendoza wrote: Muy buenas. A ver si alguien puede echarme una mano. A partir de una matriz de distancias de 29 x 29 he obtenido una df1. Ahora tengo 841 filas con la distancia de cada combinación de esas 29 categorías. Algo así como: Var1 Var2 Dist a a 0 a b 3 a c 5 b a 3 b b 0 b c 5 c ... En otra df2, de 14563 filas, tengo las variables 1 y 2, y necesito crear otra variable con la distancia que aparece en la df1. Si entiendo bien el problema, con la función merge tienes justo lo que necesitas. Saludos, -- José María (Chema) Mateos || https://rinzewind.org/ ___ R-help-es mailing list R-help-es@r-project.org https://stat.ethz.ch/mailman/listinfo/r-help-es -- Dr Manuel Mendoza Department of Biogeography and Global Change National Museum of Natural History (MNCN) Spanish Scientific Council (CSIC) C/ Serrano 115bis, 28006 MADRID Spain ___ R-help-es mailing list R-help-es@r-project.org https://stat.ethz.ch/mailman/listinfo/r-help-es
Re: [R-es] Asignar distancias
On Sat, Nov 10, 2018 at 07:54:19PM +0100, Manuel Mendoza wrote: > Muy buenas. A ver si alguien puede echarme una mano. > A partir de una matriz de distancias de 29 x 29 he obtenido una df1. > Ahora tengo 841 filas con la distancia de cada combinación de esas 29 > categorías. > Algo así como: > > Var1 Var2 Dist > a a 0 > a b 3 > a c 5 > b a 3 > b b 0 > b c 5 > c ... > > En otra df2, de 14563 filas, tengo las variables 1 y 2, y necesito crear > otra variable con la distancia que aparece en la df1. Si entiendo bien el problema, con la función merge tienes justo lo que necesitas. Saludos, -- José María (Chema) Mateos || https://rinzewind.org/ ___ R-help-es mailing list R-help-es@r-project.org https://stat.ethz.ch/mailman/listinfo/r-help-es
[R-es] Asignar distancias
Muy buenas. A ver si alguien puede echarme una mano. A partir de una matriz de distancias de 29 x 29 he obtenido una df1. Ahora tengo 841 filas con la distancia de cada combinación de esas 29 categorías. Algo así como: Var1 Var2 Dist a a 0 a b 3 a c 5 b a 3 b b 0 b c 5 c ... En otra df2, de 14563 filas, tengo las variables 1 y 2, y necesito crear otra variable con la distancia que aparece en la df1. Lo he intentado colapsando var1 y var 2 en ambas dfs, obteniendo 841 categorías en vez de 841 combinaciones de 29 categorías, pero no sé cómo seguir. Muchas gracias, como siempre, Manuel . -- Dr Manuel Mendoza Department of Biogeography and Global Change National Museum of Natural History (MNCN) Spanish Scientific Council (CSIC) C/ Serrano 115bis, 28006 MADRID Spain ___ R-help-es mailing list R-help-es@r-project.org https://stat.ethz.ch/mailman/listinfo/r-help-es
Re: [R] Read
Thank you Jeff and all. My data is very messy and it is nice trick suggested by Jeff to handle it On Fri, Nov 9, 2018 at 8:42 PM Jeff Newmiller wrote: > > Your file has 5 commas in the first data row, but only 4 in the header. R > interprets this to mean your first column is intended to be row names (has > no corresponding column label) rather than data. (Row names are "outside" > the data frame... use str(dsh) to get a better picture.) > > Basically, your file does not conform to consistent practices for csv > files of having the same number of commas in every row. If at all possible > I would eliminate the extra comma. If you have many of these broken files, > you might need to read the data in pieces... e.g. > > dsh <- read.csv( "dat.csv", header=FALSE, skip=1 ) > dsh <- dsh[ , -length( dsh ) ] > dshh <- read.csv( "dat.csv", header=TRUE, nrow=1) > names( dsh ) <- names( dshh ) > > On Fri, 9 Nov 2018, Val wrote: > > > HI all, > > I am trying to read a csv file, but have a problem in the row names. > > After reading, the name of the first column is now "row.names" and > > all other column names are shifted to the right. The value of the last > > column become all NAs( as an extra column). > > > > My sample data looks like as follow, > > filename = dat.csv > > The first row has a missing value at column 3 and 5. The last row has > > a missing value at column 1 and 5 > > x1,x2,x3,x4,x5 > > 12,13,,14,, > > 22,23,24,25,26 > > ,33,34,34, > > To read the file I used this > > > > dsh<-read.csv(file="dat.csv",sep=",",row.names=NULL,fill=TRUE,header=TRUE,comment.char > > = "", quote = "", stringsAsFactors = FALSE) > > > > The output from the above is > > dsh > > > > row.names x1 x2 x3 x4 x5 > > 112 13 NA 14 NA NA > > 222 23 24 25 26 NA > > 3 33 34 34 NA NA > > > > The name of teh frist column is row,banes and all values of last columns is > > NAs > > > > > > However, the desired output should be > > x1 x2 x3 x4 x5 > > 12 13 NA 14 NA > > 22 23 24 25 26 > > NA 33 34 34 NA > > > > > > How can I fix this? > > Thank you in advance > > > > __ > > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > > https://stat.ethz.ch/mailman/listinfo/r-help > > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > > and provide commented, minimal, self-contained, reproducible code. > > > > --- > Jeff NewmillerThe . . Go Live... > DCN:Basics: ##.#. ##.#. Live Go... >Live: OO#.. Dead: OO#.. Playing > Research Engineer (Solar/BatteriesO.O#. #.O#. with > /Software/Embedded Controllers) .OO#. .OO#. rocks...1k > --- __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] HISTOGRAM
Rui Barradas, thank you for your prompt response, your code will be useful to me in the future! Rick Bilonick ("your data appear to be categorical"), thank you very much for your comment (I would have to more correctly express my task). JIM Lemon, THANKS!!! THIS IS EXACTLY what I needed! __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] Read
readr::read_csv produces the desired result by default: readr::read_csv("x1,x2,x3,x4,x5 12,13,,14,, 22,23,24,25,26 ,33,34,34,") Best, Ista On Fri, Nov 9, 2018 at 8:40 PM Val wrote: > > HI all, > I am trying to read a csv file, but have a problem in the row names. > After reading, the name of the first column is now "row.names" and > all other column names are shifted to the right. The value of the last > column become all NAs( as an extra column). > > My sample data looks like as follow, > filename = dat.csv > The first row has a missing value at column 3 and 5. The last row has > a missing value at column 1 and 5 > x1,x2,x3,x4,x5 > 12,13,,14,, > 22,23,24,25,26 > ,33,34,34, > To read the file I used this > > dsh<-read.csv(file="dat.csv",sep=",",row.names=NULL,fill=TRUE,header=TRUE,comment.char > = "", quote = "", stringsAsFactors = FALSE) > > The output from the above is > dsh > > row.names x1 x2 x3 x4 x5 > 112 13 NA 14 NA NA > 222 23 24 25 26 NA > 3 33 34 34 NA NA > > The name of teh frist column is row,banes and all values of last columns is > NAs > > > However, the desired output should be > x1 x2 x3 x4 x5 > 12 13 NA 14 NA > 22 23 24 25 26 > NA 33 34 34 NA > > > How can I fix this? > Thank you in advance > > __ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[ESS] eldoc in Rmd files
Hi all, I recently upgraded both emacs and ess. One of those broke eldoc functionality in Rmd files, which worked fine previously. I can reproduce with `emacs -Q`. To reproduce this, use this test.Rmd file: --8<---cut here---start->8--- --- title: Test --- ```{r testblock, include = FALSE} rnorm ``` --8<---cut here---end--->8--- - move the point to the source block - type C-c C-v to update the references - type the opening '(' after 'rnorm' Now, I would expect the eldoc message in the echo buffer, as it appears in ordinary R files. This is a major limitation for my workflow. Can I fix that somehow? Thanks in advance! Regards, Andreas PS: Here is my setup: - linux (debian buster) - Emacs 26.1.50 - ess-version: 18.10.2 - polymode (0340f5e7e55235832e59673f027cc79a23cbdcd6) - markdown-mode, version 2.4-dev PPS: And here is my minimal init.el: --8<---cut here---start->8--- ;; ess (add-to-list 'load-path "~/local/emacs/ess/lisp") ;;(load "~/local/emacs/ess/lisp/ess-site.el") (require 'ess-site) ;; markdown mode (setq load-path (append '("~/local/emacs/markdown-mode/") load-path)) (autoload 'markdown-mode "markdown-mode" "Major mode for editing Markdown files" t) ;;(add-to-list 'auto-mode-alist '("\\.text\\'" . markdown-mode)) (add-to-list 'auto-mode-alist '("\\.markdown\\'" . markdown-mode)) (add-to-list 'auto-mode-alist '("\\.md\\'" . markdown-mode)) ;; polymode (setq load-path (append '("~/local/emacs/polymode/" "~/local/emacs/polymode/modes") load-path)) (require 'poly-R) (require 'poly-markdown) ;;; R modes (add-to-list 'auto-mode-alist '("\\.Snw" . poly-noweb+r-mode)) (add-to-list 'auto-mode-alist '("\\.Rnw" . poly-noweb+r-mode)) (add-to-list 'auto-mode-alist '("\\.Rmd" . poly-markdown+r-mode)) --8<---cut here---end--->8--- __ ESS-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/ess-help
Re: [R] HISTOGRAM
Hi Medic, Perhaps this: medic_df<-read.table(text="name number ds6277 lk 24375 ax46049 dd70656 az216544 df 220620 gh641827", header=TRUE) library(plotrix) options(scipen=10) barp(medic_df$number,names.arg=medic_df$name,width=0.5) As others have noted, this is really a barplot with no spaces between the bars. Jim On Sat, Nov 10, 2018 at 5:46 AM Medic wrote: > > What would be the correct code (simplest version) (without gplot()) > for histogram (with 7 bars), which would include 7 names of bars under > the X-axis. The data are: > > name number > ds6277 > lk 24375 > ax46049 > dd70656 > az216544 > df 220620 > gh641827 > > (I'm attaching mydata.r, making with dput.) > > My attempt is: > > options(scipen=999) > with (mydata, hist(number)) > > P.S. I can't understand how the column "name" to include in a code > __ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.