[R] Where is R installed on my Linux?
I have successfully installed R on my AWS EC2 r3.8 box running Linux with >sudo yum install -y R However, I cannot find R anywhere (which I want for the sake of tar'ing it up and decompressing to make future installations easier.) For example, > rpm -ql R Says there is nothing to show. Does anyone have any ideas? -Mike [[alternative HTML version deleted]] __ 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] Errors in Raster to Point
Hi, all I am just beginner to use R. I am working with TIF image file, and the information about the raster is following: class : RasterLayer dimensions : 11150, 21808, 243159200 (nrow, ncol, ncell) resolution : 30, 30 (x, y) extent : 569685, 1223925, 1513995, 1848495 (xmin, xmax, ymin, ymax) coord. ref. : +proj=aea +lat_1=29.5 +lat_2=45.5 +lat_0=23 +lon_0=-96 +x_0=0 +y_0=0 +datum=NAD83 +units=m +no_defs +ellps=GRS80 +towgs84=0,0,0 data source : C:\Users\Gwan\AppData\Local\Temp\Rtmpg506Ee\raster\r_tmp_2016-09-14_122409_6260_09589.grd names : test_map values : 1, 225 (min, max) attributes : ID OBJECTID Value Red Green Blue Count Class_Name Opacity from: 02 1 1 00 5982503 Corn 1 to : 48 255 254 0 00 10336 Dbl Crop Barley/Soybeans 1 >From this Rasterlayer, I want to convert raster to point for each pixel based on "Value (one of column name)" and create a raster with georeferenced information. I used code as following: RP <- rasterToPoints(KY_raster) However, I could not get the points and have an error message "cannot allocate vector of size 5.4 Gb" and "Your computer is low on memory. Save your files and close these programs". Could someone please help me how I can convert to raster to points?? Best, [[alternative HTML version deleted]] __ 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] Return the indices of rows of a data frame
What do you think? This is covered in the Introduction to R document that comes with R. -- Sent from my phone. Please excuse my brevity. On September 19, 2016 8:37:30 PM PDT, Johnwrote: >Hi, > > I have the following dataframe: > >> temp<-data.frame(a=c(1,1,2), b=2:4, c=1:3) >> row.names(temp)<-c("D", "E", "F") >> temp > a b c >D 1 2 1 >E 1 3 2 >F 2 4 3 > > I would like R to tell me which rows has value "a" equal to 1. The >answer is the first row and the second row, or row D and row E. Which >function should i use? function subset? function which? > > Thanks! > > [[alternative HTML version deleted]] > >__ >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.
[R] Return the indices of rows of a data frame
Hi, I have the following dataframe: > temp<-data.frame(a=c(1,1,2), b=2:4, c=1:3) > row.names(temp)<-c("D", "E", "F") > temp a b c D 1 2 1 E 1 3 2 F 2 4 3 I would like R to tell me which rows has value "a" equal to 1. The answer is the first row and the second row, or row D and row E. Which function should i use? function subset? function which? Thanks! [[alternative HTML version deleted]] __ 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] add outlier in data set
On Mon, 19 Sep 2016 12:25:08 + "Muhammad Kashif"wrote: > Dear Ellison > > yes its working but if i want to replaced the any value in the the > output . e.g i want to replace 0.65 with 10. then what i do > Save the data as a CSV file. Edit the file with a basic ascii text editor (these days unicode perhaps). Read the new data back into R. There also ways to do this within R: https://therostrumblog.wordpress.com/2014/01/29/basic-data-frame-manipulations-in-r/ see "Altering a value". There is a great deal of "help" in R using either the "?" or apropos(). It is worth using these. Also some useful free books are available from the R Project site. -- John __ 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] Overlapping axis numbering and labels when using par(new=TRUE)?
> How can I get the axis numbering and labels to not overlap? I could also Try specifying las=2 in your plot command? See ?plot.default and ?par S Ellison *** This email and any attachments are confidential. Any use...{{dropped:8}} __ 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] Overlapping axis numbering and labels when using par(new=TRUE)?
Hi mviljamaa, Have a look a the twoord.plot function in the plotrix package. Jim On Tue, Sep 20, 2016 at 1:50 AM, mviljamaawrote: > I'm trying to plot two data sets on the same plot by using par(new=TRUE). > > However this results in the axis numbering and labels being plotted twice as > seen in the following picture: > > http://i.imgur.com/4b1sNIc.png > > How can I get the axis numbering and labels to not overlap? I could also > manage with plotting only the axis numbering and labels of the other plot, > but not of the other. > > __ > 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.
Re: [R] Overlapping axis numbering and labels when using par(new=TRUE)?
> On Sep 19, 2016, at 8:50 AM, mviljamaawrote: > > I'm trying to plot two data sets on the same plot by using par(new=TRUE). > > However this results in the axis numbering and labels being plotted twice as > seen in the following picture: > > http://i.imgur.com/4b1sNIc.png > > How can I get the axis numbering and labels to not overlap? I could also > manage with plotting only the axis numbering and labels of the other plot, > but not of the other. You need to set the ylim values of both plots to the same range, and suppress plotting of the ylab in one of hte plot calls. > > __ > 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. David Winsemius Alameda, CA, USA __ 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] help
This looks like homework. We don't do homework here (if we can avoid it). Ask your prof/TA for help. Cheers, Bert 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 Mon, Sep 19, 2016 at 3:39 AM, Kanika Sahniwrote: > Input1: A list of distinct numbers,L1 > Input2: A single number, T > > Output all combinations of L1 that can yield T using +,-,*,/. > > eq: > L1=[4,5,2,3] and T=6. Output: [2*3],[2+4],[5+3-2],[3*4/2] . all other > combinations. > > [[alternative HTML version deleted]] > > __ > 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.
[R] help
Input1: A list of distinct numbers,L1 Input2: A single number, T Output all combinations of L1 that can yield T using +,-,*,/. eq: L1=[4,5,2,3] and T=6. Output: [2*3],[2+4],[5+3-2],[3*4/2] . all other combinations. [[alternative HTML version deleted]] __ 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-es] Climograma o grafico de 2 ejes
Estimados: Alguien sabe de algún paquete que te facilite la construcción de gráficos de doble eje, como los climogramas por ejemplo?. Saludos. Enviado desde mi iPhone > El 13-09-2016, a las 5:48 p.m., Javier Valdes Cantallopts (DGA) >escribió: > > Estimados. > Quería saber si alguien ha encontrado la forma de ubicar datos saltados de > una serie de referencia tipo “timestamp”, es decir, una columna con los datos > concatenados de FECHA Y HORA, según muestro EN EL ARCHIVO ADJUNTO ; > Para “solo fechas”, ocupo el script; > at_ref <- seq(from = min(A$date), to = max(A$date), by = 86400) > > dif_df <- dat_ref[ !dat_ref %in% A$date] > > dif_df <- dat_ref[ !dat_ref %in% A$date] > > dif_df > > Sin embargo, para columnas fusionada “FECHA-HORA” sería ideal, ya que a parte > de saber el día que se salta, “sabré LA HORA que falta”, que sería ideal > > Dejo la inquietud. > Saludos. > > > > > > > De: Carlos Ortega [mailto:c...@qualityexcellence.es] > Enviado el: lunes, 05 de septiembre de 2016 17:41 > Para: Javier Valdes Cantallopts (DGA) > CC: r-help-es@r-project.org > Asunto: Re: [R-es] R SE QUEDA PEGADO e imposibilitado de trabajar. > > Hola, > > Das demasiada poca información para poder ayudarte de alguna manera.. > Algunas preguntas a las que si tienes respuesta podrías haberlas aportado: > > Cuando te ocurre esto, ¿tienes R ejecutándose con algún script?. > Si el problema es recurrente, has llegado a abrir algún gestor de recursos > para ver si es que tienes casi toda la RAM ocupada, si es que estás haciendo > mucho swap en disco, etc, etc... > ¿Qué capacidades tiene tu máquina? (RAM en particular y Sistema Operativo)?. > Esto te ocurre, ¿cuando usas R sobre RStudio, sobre R en modo consola?. > Vaya son detalles muchos de ellos muy básicos a comprobar que pueden explicar > el problema. > > Un detalle adicional, si es una duda nueva, es conveniente que no la adjuntes > con el histórico de otra reciente que era especialmente larga... > > Gracias, > Carlos Ortega > www.qualityexcellence.es > > > El 5 de septiembre de 2016, 22:10, Javier Valdes Cantallopts (DGA) > escribió: > Estimados: > Tengo problemas con mi programa R. Cada vez que dejo stand-by mi compu por > unos minutos, R se queda pegado, e imposibilitado de trabajar, lo que me > obliga a cerrarlo y volver a abrirlo cada vez que sucede. > > > > > CONFIDENCIALIDAD: La información contenida en este mensaje y/o en los > archivos adjuntos es de carácter confidencial o privilegiada y está destinada > al uso exclusivo del emisor y/o de la persona o entidad a quien va dirigida. > Si usted no es el destinatario, cualquier almacenamiento, divulgación, > distribución o copia de esta información está estrictamente prohibido y > sancionado por la ley. Si recibió este mensaje por error, por favor > infórmenos inmediatamente respondiendo este mismo mensaje y borre todos los > archivos adjuntos. Gracias. > > CONFIDENTIAL NOTE: The information transmitted in this message and/or > attachments is confidential and/or privileged and is intented only for use of > the person or entity to whom it is addressed. If you are not the intended > recipient, any retention, dissemination, distribution or copy of this > information is strictly prohibited and sanctioned by law. If you received > this message in error, please reply us this same message and delete this > message and all attachments. Thank you. > > ___ > R-help-es mailing list > R-help-es@r-project.org > https://stat.ethz.ch/mailman/listinfo/r-help-es [[alternative HTML version deleted]] ___ R-help-es mailing list R-help-es@r-project.org https://stat.ethz.ch/mailman/listinfo/r-help-es
Re: [R] Overlapping axis numbering and labels when using par(new=TRUE)?
Take a look at what plot(1:10, yaxt='n', xaxt='n') does. Then study the help page for the par function, i.e., ?par See also ?axis -Don -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 On 9/19/16, 8:50 AM, "R-help on behalf of mviljamaa"wrote: >I'm trying to plot two data sets on the same plot by using >par(new=TRUE). > >However this results in the axis numbering and labels being plotted >twice as seen in the following picture: > >http://i.imgur.com/4b1sNIc.png > >How can I get the axis numbering and labels to not overlap? I could also >manage with plotting only the axis numbering and labels of the other >plot, but not of the other. > >__ >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.
Re: [R] Density plot error
You desperately need to read the Posting Guide mentioned at the bottom of every posting on this list. Avoid attachments (your code did not come through), keep sample data size minimal, don't reply to other topic messages (start a fresh email thread so your message doesn't get buried in other people's mailboxes.). Ideally you will provide sample data as part of your sample code using dput, but you may be having difficulty reading the data into memory in the first place so you might not be ready for that. Also [1] would probably be helpful to you. [1] http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example -- Sent from my phone. Please excuse my brevity. On September 19, 2016 5:15:38 AM PDT, najad zamirah zaki via R-helpwrote: >Hi, >I'm Najad, a student at the University of Glasgow. I really need help >with a script of mine to plot density plot for my data. I kept on >having an error saying need at least 2 points to select a bandwidth >automaticallyI've tried to replace the NaN in my data to zero but still >the same. I'm not good with R and don't understand the coding language >so I need help on this. I've attached here the data and the script that >I use. I use R version 3.1.1 >Thank you Warm regards,Najad Zaki > > > > > >__ >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.
[R] Overlapping axis numbering and labels when using par(new=TRUE)?
I'm trying to plot two data sets on the same plot by using par(new=TRUE). However this results in the axis numbering and labels being plotted twice as seen in the following picture: http://i.imgur.com/4b1sNIc.png How can I get the axis numbering and labels to not overlap? I could also manage with plotting only the axis numbering and labels of the other plot, but not of the other. __ 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] add outlier in data set
> yes its working but if i want to replaced the any value in the the output . > e.g i > want to replace 0.65 with 10. then what i do Read "An introduction to R" in your R help system (help.start() if you cannot find the menu item). Section 2 and particularly 2.7 is essential reading for what you are trying to do. See also the Note and examples in ?"==" which are also essential reading for comparisons involving floating point numbers; also FAQ 7.31. S Ellison *** This email and any attachments are confidential. Any use...{{dropped:8}} __ 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] separate commands by semicolon
Oh yes, completely forgot about partial parsing. One possible (quick) solution: txt <- "print(2); bar <- \"don't ; use semicolons\"; foo <- '3;4'; ls(" sf <- srcfile("txt") tryit <- tryCatch(parse(text = txt, srcfile = sf), error = identity) gpd <- getParseData(sf) pos <- c(0, gpd$col1[gpd$token == "';'"], nchar(txt) + 1) final <- c() for (i in seq(length(pos) - 1)) { final <- c(final, substr(txt, pos[i] + 1, pos[i + 1] - 1)) } Which outputs: [1] "print(2)" " bar <- \"don't ; use semicolons\"" [3] " foo <- '3;4'" " ls(" Excellent, thanks very much, Adrian On Mon, Sep 19, 2016 at 3:19 PM, Duncan Murdochwrote: > On 19/09/2016 7:59 AM, Adrian Dușa wrote: > >> On Sun, Sep 18, 2016 at 12:34 AM, Peter Langfelder < >> peter.langfel...@gmail.com> wrote: >> >> > On Sat, Sep 17, 2016 at 2:12 PM, David Winsemius < >> dwinsem...@comcast.net> >> > wrote: >> > > Not entirely clear. If you were intending to just get character output >> > then you could just use: >> > > >> > > strsplit(txt, ";") >> > >> > You would want to avoid splitting within character strings >> > (print(";")) and in comments (print(2); ls() # This prints 2; then >> > lists...) The comment char could also appear in a character string, >> > where it does not mean the start of a comment... >> >> >> Yes, that would be the problem. >> Returning to my original post, modifying the example: >> >> x <- "print(2); bar <- \"don't ; use semicolons\"; foo <- '3;4'; ls(" >> >> This should result in a character vector of length 4: >> [1] "print(2)" "bar <- \"don't ; use >> semicolons\"" >> [3] "foo <- '3;4'" "ls(" >> >> even though the last command would cause an error using parse(text = x) >> >> Perhaps this is not that important (I am trying to simulate a normal R >> console), and parse only if it syntactically correct. >> I was merely curious if this could be done, likely using regular >> expressions (surely strsplit doesn't solve it). >> >> Best, >> Adrian >> >> See the section on "partial parsing" in the ?parse help page. > > Duncan Murdoch > > -- Adrian Dusa University of Bucharest Romanian Social Data Archive Soseaua Panduri nr.90 050663 Bucharest sector 5 Romania [[alternative HTML version deleted]] __ 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] What are the red line and cut line in lm's Residuals vs Fitted plot?
> Do you mean that the red line is a regression line? > Why is the regression (line) weighted? I suggest you look up 'locally weighted regression' to find out why that is useful and what it is for. *** This email and any attachments are confidential. Any use...{{dropped:8}} __ 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] Density plot error
Hi, I'm Najad, a student at the University of Glasgow. I really need help with a script of mine to plot density plot for my data. I kept on having an error saying need at least 2 points to select a bandwidth automaticallyI've tried to replace the NaN in my data to zero but still the same. I'm not good with R and don't understand the coding language so I need help on this. I've attached here the data and the script that I use. I use R version 3.1.1 Thank you Warm regards,Najad Zaki SequenceN-term cleavage window C-term cleavage window Amino acid before First amino acidSecond amino acid Second last amino acid Last amino acid Amino acid afterA Count R Count N Count D Count C Count Q Count E Count G Count H Count I Count L Count K Count M Count F Count P Count S Count T Count W Count Y Count V Count U Count O Count Length Missed cleavagesMassProteinsLeading razor protein Start position End positionGene names Protein names Unique (Groups) Unique (Proteins) Charges PEP Score Experiment Labeling 0h Ratio H/L Ratio H/L normalizedRatio H/L variability [%] Ratio H/L count Ratio H/L iso-count Ratio H/L type Ratio H/L Labeling 0h Ratio H/L normalized Labeling 0hRatio H/L variability [%] Labeling 0h Ratio H/L count Labeling 0h Ratio H/L iso-count Labeling 0h Ratio H/L type Labeling 0h Intensity Intensity L Intensity H Intensity Labeling 0h Intensity L Labeling 0h Intensity H Labeling 0h Reverse Potential contaminant id Protein group IDs Mod. peptide IDsEvidence IDsMS/MS IDs Best MS/MS Oxidation (M) site IDs MS/MS Count VVEFQR AAVVEFQRAQSLLSTDM A A Q R A 4 1 0 0 0 1 1 0 0 0 0 0 0 1 0 0 0 0 0 2 0 0 10 0 1060.5665 O00231 O00231 2 11 PSMD11 26S proteasome non-ATPase regulatory subunit 11 yes yes 2 0.0025126 47.657 2 NaN NaN NaN 0 Median NaN NaN NaN 0 0 Median 0 0 0 0 0 0 0 6 0 0;1 0;1 0 2 AAAEVNQDYGLDPK KAFGILKRAAAEVNQDQDYGLDPKIANAIMKAR A A P K I 3 0 1 2 0 1 1 1 0 0 1 1 0 0 1 0 0 0 1 1 0 0 14 0 1489.7049 P07954 P07954 102 115 FH Fumarate hydratase, mitochondrial yes yes 2 0.0038524 54.65 1 NaN NaN NaN 0 Median NaN NaN NaN 0 0 Median 22459 0 22459 22459 0 22459 1 20 1 2 2 2 1 AAGTLYTYPENWR YTYPENWRAFKALIAAM A A W R A 2 1 1 0 0 0 1 1 0 0 1 0 0 0 1 0 2 1 2 0 0 0 13 0 1540.731 P26641 P26641 2 14 EEF1G Elongation factor 1-gamma yes yes 2 0.0044671 48.981 1 NaN NaN NaN 0 Median NaN NaN NaN 0 0 Median 16571 0 16571 16571 0 16571 2 33 2 3 3 3 1 AASADSTTEGTPADGFTVLSTK KKQGEVSKAASADSTTGFTVLSTKSLFLGQKLK A A T K S 4 0 0 2 0 0 1 2 0 0 1 1 0 1 1 3 5 0 0 1 0 0 22 0 2126.0015 O75367 O75367 168 189 H2AFY Core histone macro-H2A.1yes yes 2 0.00037907 49.149 1 NaN NaN NaN 0 Median NaN NaN NaN 0 0 Median 34829 0 34829 34829 0 34829 3 9 3 4 4 4 1 ACANPAAGSVILLENLR CVGPEVEKACANPAAGVILLENLRFHVEEEGKK A C L R F 4 1 2 0 1 0 1 1 0 1 3 0 0 0 1 1 0 0 0 1 0 0 17 0 1767.9302 P00558 P00558 107 123 PGK1Phosphoglycerate kinase 1 yes yes 2 0.02182536.292 1 NaN NaN NaN 0 Median NaN NaN NaN 0
Re: [R] add outlier in data set
Hi > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of > Muhammad Kashif > Sent: Monday, September 19, 2016 2:25 PM > To: S Ellison; r-help@r-project.org > Subject: Re: [R] add outlier in data set > > Dear Ellison > > yes its working but if i want to replaced the any value in the the output . > e.g i > want to replace 0.65 with 10. then what i do If you hav vector x and want to replace value 0.65 by 10 you can do x[x == .65] <- 10 However it is not as easy as it seems. It is possible that value 0.65 cannot be matched exactly. see vec <- c(650, 65, 6.5, 0.65, .065) x <- vec/c(1000, 100, 10, 1, 0.1) x<-c(x, sqrt(.65)^2) x==.65 [1] TRUE TRUE TRUE TRUE TRUE FALSE x [1] 0.65 0.65 0.65 0.65 0.65 0.65 The last value is slightly different from 0.65. See FEQ 7.31 for explanation of floating point behaviour. It is prefarable to use rounding with floating point comparison. round(x,2)==.65 [1] TRUE TRUE TRUE TRUE TRUE TRUE Cheers Petr > > > From: S Ellison > Sent: Monday, September 19, 2016 5:15:20 PM > To: Muhammad Kashif; r-help@r-project.org > Subject: RE: add outlier in data set > > > I have one question that how we add one or more outliers in the data set. > See ?c to add values to a vector. > > S Ellison > > > ** > * > This email and any attachments are confidential. Any use...{{dropped:11}} > > __ > 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. Tento e-mail a jakékoliv k němu připojené dokumenty jsou důvěrné a jsou určeny pouze jeho adresátům. Jestliže jste obdržel(a) tento e-mail omylem, informujte laskavě neprodleně jeho odesílatele. Obsah tohoto emailu i s přílohami a jeho kopie vymažte ze svého systému. Nejste-li zamýšleným adresátem tohoto emailu, nejste oprávněni tento email jakkoliv užívat, rozšiřovat, kopírovat či zveřejňovat. Odesílatel e-mailu neodpovídá za eventuální škodu způsobenou modifikacemi či zpožděním přenosu e-mailu. V případě, že je tento e-mail součástí obchodního jednání: - vyhrazuje si odesílatel právo ukončit kdykoliv jednání o uzavření smlouvy, a to z jakéhokoliv důvodu i bez uvedení důvodu. - a obsahuje-li nabídku, je adresát oprávněn nabídku bezodkladně přijmout; Odesílatel tohoto e-mailu (nabídky) vylučuje přijetí nabídky ze strany příjemce s dodatkem či odchylkou. - trvá odesílatel na tom, že příslušná smlouva je uzavřena teprve výslovným dosažením shody na všech jejích náležitostech. - odesílatel tohoto emailu informuje, že není oprávněn uzavírat za společnost žádné smlouvy s výjimkou případů, kdy k tomu byl písemně zmocněn nebo písemně pověřen a takové pověření nebo plná moc byly adresátovi tohoto emailu případně osobě, kterou adresát zastupuje, předloženy nebo jejich existence je adresátovi či osobě jím zastoupené známá. This e-mail and any documents attached to it may be confidential and are intended only for its intended recipients. If you received this e-mail by mistake, please immediately inform its sender. Delete the contents of this e-mail with all attachments and its copies from your system. If you are not the intended recipient of this e-mail, you are not authorized to use, disseminate, copy or disclose this e-mail in any manner. The sender of this e-mail shall not be liable for any possible damage caused by modifications of the e-mail or by delay with transfer of the email. In case that this e-mail forms part of business dealings: - the sender reserves the right to end negotiations about entering into a contract in any time, for any reason, and without stating any reasoning. - if the e-mail contains an offer, the recipient is entitled to immediately accept such offer; The sender of this e-mail (offer) excludes any acceptance of the offer on the part of the recipient containing any amendment or variation. - the sender insists on that the respective contract is concluded only upon an express mutual agreement on all its aspects. - the sender of this e-mail informs that he/she is not authorized to enter into any contracts on behalf of the company except for cases in which he/she is expressly authorized to do so in writing, and such authorization or power of attorney is submitted to the recipient or the person represented by the recipient, or the existence of such authorization is known to the recipient of the person represented by the recipient. __ 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
Re: [R] What are the red line and cut line in lm's Residuals vs Fitted plot?
Do you mean that the red line is a regression line? Why is the regression (line) weighted? On 2016-09-19 14:41, S Ellison wrote: What are the red line and cut line in lm's Residuals vs Fitted plot? The dotted line is at 0 and the red line is a locally weighted regression calculated using lowess and plotted using panel.smooth. See ?panel.smooth and ?lowess for details The main clue to this is in the arguments to ?plot.lm, which uses panel.smooth as a panel function. S Ellison *** This email and any attachments are confidential. Any u...{{dropped:8}} __ 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] add outlier in data set
Dear Ellison yes its working but if i want to replaced the any value in the the output . e.g i want to replace 0.65 with 10. then what i do From: S EllisonSent: Monday, September 19, 2016 5:15:20 PM To: Muhammad Kashif; r-help@r-project.org Subject: RE: add outlier in data set > I have one question that how we add one or more outliers in the data set. See ?c to add values to a vector. S Ellison *** This email and any attachments are confidential. Any use...{{dropped:11}} __ 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] Request for R code
> Heyy I want to apply LASSO method in AFT model. So can you guys please help > me by sending R code for that. Try help.search("LASSO") or RSiteSearch("LASSO") or Google "LASSO method in AFT using R" There are leads in both. S Ellison *** This email and any attachments are confidential. Any use...{{dropped:8}} __ 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] separate commands by semicolon
On 19/09/2016 7:59 AM, Adrian Dușa wrote: On Sun, Sep 18, 2016 at 12:34 AM, Peter Langfelder < peter.langfel...@gmail.com> wrote: > On Sat, Sep 17, 2016 at 2:12 PM, David Winsemius> wrote: > > Not entirely clear. If you were intending to just get character output > then you could just use: > > > > strsplit(txt, ";") > > You would want to avoid splitting within character strings > (print(";")) and in comments (print(2); ls() # This prints 2; then > lists...) The comment char could also appear in a character string, > where it does not mean the start of a comment... Yes, that would be the problem. Returning to my original post, modifying the example: x <- "print(2); bar <- \"don't ; use semicolons\"; foo <- '3;4'; ls(" This should result in a character vector of length 4: [1] "print(2)" "bar <- \"don't ; use semicolons\"" [3] "foo <- '3;4'" "ls(" even though the last command would cause an error using parse(text = x) Perhaps this is not that important (I am trying to simulate a normal R console), and parse only if it syntactically correct. I was merely curious if this could be done, likely using regular expressions (surely strsplit doesn't solve it). Best, Adrian See the section on "partial parsing" in the ?parse help page. Duncan Murdoch __ 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] add outlier in data set
> I have one question that how we add one or more outliers in the data set. See ?c to add values to a vector. S Ellison *** This email and any attachments are confidential. Any use...{{dropped:8}} __ 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] add outlier in data set
dear r users I have one question that how we add one or more outliers in the data set. For example if we generate data set from Weibull distribution using function n=10 k<-rweibull(n, shape=2.5, scale = 1.3) k the output is > k [1] 0.6507619 0.6229385 1.6838931 1.1661324 0.4907947 1.341 0.9536739 0.9368029 1.1992996 [10] 0.8401084 now i want to add outlier in the output of the values. In simple words i want to generate a data set and then i add one or two outlier in that data set. [[alternative HTML version deleted]] __ 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] separate commands by semicolon
On Sun, Sep 18, 2016 at 12:34 AM, Peter Langfelder < peter.langfel...@gmail.com> wrote: > On Sat, Sep 17, 2016 at 2:12 PM, David Winsemius> wrote: > > Not entirely clear. If you were intending to just get character output > then you could just use: > > > > strsplit(txt, ";") > > You would want to avoid splitting within character strings > (print(";")) and in comments (print(2); ls() # This prints 2; then > lists...) The comment char could also appear in a character string, > where it does not mean the start of a comment... Yes, that would be the problem. Returning to my original post, modifying the example: x <- "print(2); bar <- \"don't ; use semicolons\"; foo <- '3;4'; ls(" This should result in a character vector of length 4: [1] "print(2)" "bar <- \"don't ; use semicolons\"" [3] "foo <- '3;4'" "ls(" even though the last command would cause an error using parse(text = x) Perhaps this is not that important (I am trying to simulate a normal R console), and parse only if it syntactically correct. I was merely curious if this could be done, likely using regular expressions (surely strsplit doesn't solve it). Best, Adrian -- Adrian Dusa University of Bucharest Romanian Social Data Archive Soseaua Panduri nr.90 050663 Bucharest sector 5 Romania [[alternative HTML version deleted]] __ 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] Problem Mixstock in R
Dear members of the R-project I am doing a mixed stock analysis with the Mixstock Package in R, at the end of the analysis I would summarize all my results (mean, standard deviation, median, percentile, etc...) using the mysum(x, name=NULL) function, but I don't understand which is the correct manner to set up it, what "x" and "name"are? ..Can you help me? Thank you very much, Tatiana [[alternative HTML version deleted]] __ 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] Problem pyears and left truncated data
Dear all, for a project I want to calculate cancer incidence rates by decades (0-20,20-30,30-40,..,70-80). I have left truncated data, my Surv object has the form Surv(time=age,time2=age2, event, type="counting"). I tried different ways to get results for n, events, and person-years, but the results are not as expected. The best results are for pyears(Surv(age,age2,event)~cut(age,c(0, 20,30,40,50,60,70,80)) +group, data,scale=1) However, the person-years is too high, since observation time of patients that start before 20 years of age are added completely to the observation decade of 0-20. Person 1: 18 -31 years of age observation time Person 2: 18 - 19 years of age observation time Result gained: n = 2, pyears = 14 for 0-20 years Result expected: n=2, pyears=3 for 0-20 years Furthermore, the documentation says, that the cut function is not advised to use, but tcut does not work with my data. What do I have to do to use the pyears-function for left truncated data? Are there any working examples for that case? Many thanks and best wishes, Silke Zachariae __ 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] Reg : :How to plot and present the multiple values whenever user placed mouse on point it using plotly and ggplot2
Hi, for my question please browse below url,thanks in advance . url : http://community.plot.ly/t/how-to-plot-and-present-the-multiple-values-whenever-user-placed-mouse-on-point-it-using-plotly-and-ggplot2/2139?u=manohar Manu. [[alternative HTML version deleted]] __ 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] What are the red line and cut line in lm's Residuals vs Fitted plot?
> What are the red line and cut line in lm's Residuals vs Fitted plot? The dotted line is at 0 and the red line is a locally weighted regression calculated using lowess and plotted using panel.smooth. See ?panel.smooth and ?lowess for details The main clue to this is in the arguments to ?plot.lm, which uses panel.smooth as a panel function. S Ellison *** This email and any attachments are confidential. Any use...{{dropped:8}} __ 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.