Re: [R] Unicode chars

2022-08-25 Thread dulcalma dulcalma
Thank you for the reply I tried xeLatex at least once and possibly twice and it failed to compile I now tried it again and found that I had missed the inputenc error when I tried before. After removing the line it now compiles. Thank you Regards Duncan -- Original Message --

Re: [R] Getting minimum value of a column according a factor column of a dataframe

2022-08-25 Thread avi.e.gross
The requirements keep being clarified and it would have been very useful to know more in advance. To be clear. My earlier suggestion was based on JUST wanting the minimum for each unique version of Code. Then you wanted it in the original order so that was handled by carefully making that a

Re: [R] Getting minimum value of a column according a factor column of a dataframe

2022-08-25 Thread Jim Lemon
Hi Javad, In that case, just modify the function to extract the rows with both the minimum and maximum Q from each station df1<-read.table(text="Code Y M D Q N O 41003 81 1 19 0.16 7.17 2.5 41003 77 9 22 0.197 6.8 2.2 41003 79 7 28 0.21 4.7 6.2 41005 79 8 17 0.21 5.5 7.2 41005 80 10 30

Re: [R] Fixing the size of R's Graphic Device

2022-08-25 Thread Christofer Bogaso
I really dont know what could be the right value. So I am trying to get the right value based on trial and error. All I want is that the graphic windows' height should occupy the height of my screen and width should be ~70% of width of my scream I am using Mac desktop (21.5 inch 2017 model) but

Re: [R] Fixing the size of R's Graphic Device

2022-08-25 Thread Christofer Bogaso
Thanks. But this is woking upto some number For example options(device=function()windows(width=303,height=354,xpos=-5,ypos=9)) graphics.off() plot(1:10) and options(device=function()windows(width=303,height=394,xpos=-5,ypos=9)) graphics.off() plot(1:10) do not change the height of device On

Re: [R] Fixing the size of R's Graphic Device

2022-08-25 Thread Christofer Bogaso
Hi, I am using a large screen monitor, the default size comes with fairly small maybe smaller than a quarter. Is there any to get exact measure of the default size? I am using R in WIndows 11 OS On Thu, Aug 25, 2022 at 11:54 PM Jeff Newmiller wrote: > > What is your default graphics device?

Re: [R] Fixing the size of R's Graphic Device

2022-08-25 Thread Bert Gunter
See ?Startup for various ways of automatically executing custom code at R start up. See ?setHook and ?.onLoad for how to run custom code when packages (like grDevices) are loaded. (But Jeff may be able to help you avoid even this if you respond to his queries). Cheers, Bert On Thu, Aug 25,

[R] Fixing the size of R's Graphic Device

2022-08-25 Thread Christofer Bogaso
Hi, I am wondering if there is any way to fix the size (i.e. height and width) of R's graphic device permanently. Every time I open R, and create my first plot, the default size of the graphic device is fairly small, and I need to adjust it manually to make it of comfortable size. Any help is

Re: [R] Getting minimum value of a column according a factor column of a dataframe

2022-08-25 Thread avi.e.gross
Yes, Timothy, the request was not seen by all of us as the same. Indeed if the request was to show a subset of the original data consisting of only the rows that were the minimum for each Code and also showed ties, then the solution is a tad more complex. I would then do something along the lines

Re: [R] Getting minimum value of a column according a factor column of a dataframe

2022-08-25 Thread Bill Dunlap
The order of the rows returned by summarize is controlled by the levels of the factors given to group_by. If group_by is given character columns instead of factors, it converts them to factors with the levels being the sorted unique values of the character columns. Convert you character columns

Re: [R] Getting minimum value of a column according a factor column of a dataframe

2022-08-25 Thread Rui Barradas
Hello, Inline. Às 16:37 de 25/08/2022, avi.e.gr...@gmail.com escreveu: I read all the replies and am not sure why nobody used what I see as simpler and more direct. Assuming the ORDER of the output matters, it tends to be controlled by the order of the factor called Code so I have simple code

Re: [R] Getting minimum value of a column according a factor column of a dataframe

2022-08-25 Thread avi.e.gross
I read all the replies and am not sure why nobody used what I see as simpler and more direct. Assuming the ORDER of the output matters, it tends to be controlled by the order of the factor called Code so I have simple code like this: --- # Load required libraries library(dplyr) # Simulate

Re: [R] Getting minimum value of a column according a factor column of a dataframe

2022-08-25 Thread Ebert,Timothy Aaron
My mistake, I did not change the sort order back to the original order. If you do not like the additional variables they can be dropped using select() or dat2[,-c(RN, MinByCodeQ)] syntax. library(dplyr) library(magrittr) dat2<-read.table(text="Code Y M D Q N O 41003 81 1 19 0.16 7.17 2.5 41003

Re: [R] Unicode chars

2022-08-25 Thread Richard O'Keefe
PDFLaTeX does support Latin-1, and this is a Latin-1 character. On Thu, 25 Aug 2022 at 15:35, Jeff Newmiller wrote: > Are you aware that pdfLatex does not support Unicode? You need to use > xeLatex. But I don't use Sweave, so I don't know how you go about making > that choice. > > On August 24,

Re: [R] Getting minimum value of a column according a factor column of a dataframe

2022-08-25 Thread Ebert,Timothy Aaron
I missed where you explained how to choose a minimum value if there are several values within a group that are equal to the minimum value. Here is a dplyr code that returns eight values because there are ties for minimum values in Q. library(dplyr) library(magrittr) dat2<-read.table(text="Code

Re: [R] Getting minimum value of a column according a factor column of a dataframe

2022-08-25 Thread Rui Barradas
Hello, OK, what about res <- lapply(split(df1, df1$Code), \(x) x[which.min(x$Q),]) do.call(rbind, res) # Code Y M D QNO # 41003 41003 81 1 19 0.160 7.17 2.50 # 41005 41005 79 8 17 0.210 5.50 7.20 # 41009 41009 79 2 21 0.218 5.56 4.04 # 41017 41017 79 10 20 0.240

Re: [R] Unicode chars

2022-08-25 Thread Enrico Schumann
On Thu, 25 Aug 2022, dulcalma dulcalma writes: > Dear All > > > I was trying the supplementary file GS_main.R from > https://esajournals.onlinelibrary.wiley.com/doi/abs/10.1002/ecy.3475 > > I have tried to prevent latex compilation from failing using Sweave > after trying all the online fixes I