Re: [R] Help request: Parsing docx files for key words and appending to a spreadsheet

2023-12-29 Thread Dr Eberhard W Lisse
Andy,

you can always open a public Dropbox or Google folder and post the link.

el

On 29/12/2023 22:37, Andy wrote:
> Thanks - I'll have a look at these options too.
>
> I'm happy to send over a sample document, but wasn't aware if
> attachments are allowed. The documents come Lexis+, so require user
>  credentials to log in, but I could upload the file somewhere if
> that would help? Any ideas for a good location to do so?
[...]

__
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 request: Parsing docx files for key words and appending to a spreadsheet

2023-12-29 Thread Dr Eberhard W Lisse
I would also look at https://pandoc.org perhaps which can
export a number of formats...

And for spreadsheets https://github.com/jqnatividad/qsv is my
goto weapon.  Can also read and write XLSX and others.

A sample document or two would always be helpful...

el

On 29/12/2023 21:01, CALUM POLWART wrote:
> It sounded like he looked at officeR but I would agree
> 
> content <- officer::docx_summary("filename.docx")
> 
> Would get the text content into an object called content.
> 
> That object is a data.frame so you can then manipulate it.
> To be more specific, we might need an example of the DF
[...]
>> On Fri, Dec 29, 2023 at 10:14 AM Andy 
>> wrote:
[...]
>>> I'd like to be able to accomplish the following:
>>>
>>> (1) Append the title, the month, the author, the number of
>>> words, and page number(s) to a spreadsheet
>>>
>>> (2) Read each article and extract keywords (in the docs,
>>> these are listed in 'Subject' section as a list of
>>> keywords with a percentage showing the extent to which the
>>> keyword features in the article (e.g., FAST FASHION (72%))
>>> and to append the keyword and the % coverage to the same
>>> row in the spreadsheet.  However, I want to ensure that
>>> the keyword coverage meets the threshold of >= 50%; if
>>> not, then pass onto the next article in the directory.
>>> Rinse and repeat for the entire directory.
[...]

__
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] Code editor for writing R code

2023-11-30 Thread Dr Eberhard W Lisse
Sublime Text.

On all platforms.
On 29/11/2023 17:57, Christofer Bogaso wrote:
> Hi,
> 
> Currently I use VS-Code to write codes in R. While it is very good, it
> does not allow me to write Latex expressions in comments, which I am
> willing to have to write corresponding mathematical expressions as
> comments in my code files.
> 
> Does there exist any Code editor for R, that allows me to write Latex
> in comments?
> 
> Any information will be appreciated.
> 
> Thanks,
>

__
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] detect and replace outliers by the average

2023-04-20 Thread Dr Eberhard W Lisse
There is at least one outliers package on CRAN.

el
On 20/04/2023 20:43, AbouEl-Makarim Aboueissa wrote:
> Dear All:  *please discard my previous email*
> 
> 
> 
> *Re:* detect and replace outliers by the average
> 
> 
> 
> The dataset, please see attached, contains a group factoring column “
> *factor*” and two columns of data “x1” and “x2” with some NA values. I need
> some help to detect the outliers and replace it and the NAs with the
> average within each level (0,1,2) for each variable “x1” and “x2”.
> 
> 
> 
> I tried the below code, but it did not accomplish what I want to do.
> 
> 
> 
> 
> 
> data<-read.csv("G:/20-Spring_2023/Outliers/data.csv", header=TRUE)
> 
> data
> 
> replace_outlier_with_mean <- function(x) {
> 
>   replace(x, x %in% boxplot.stats(x)$out, mean(x, na.rm=TRUE))   ,
> na.rm=TRUE NOT working
> 
> }
> 
> data[] <- lapply(data, replace_outlier_with_mean)
> 
> 
> 
> 
> 
> Thank you all very much for your help in advance.
> 
> 
> 
> 
> 
> with many thanks
> 
> abou
> 
> 
> __
> 
> 
> *AbouEl-Makarim Aboueissa, PhD*
> 
> *Professor, Mathematics and Statistics*
> *Graduate Coordinator*
> 
> *Department of Mathematics and Statistics*
> *University of Southern Maine*

__
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] Reading Text files from UK Met Office into R again...

2022-10-09 Thread Dr Eberhard W Lisse
Does it say what the new format is?

On 2022-10-09 13:01 , Nick Wray wrote:
[...]
> Up to 2010 everything's fine and dandy - the data is in nice neat columns
> and I can download it and filter out what I don't want.  But after 2010 the
> format changes (The Met Office in fact say on their guidelines that it
> changes)  - it's still a text doc but instead of columns it seems to be one
> long vector.  Here is a short sample:
[...]

__
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] Reading very large text files into R

2022-09-29 Thread Dr Eberhard W Lisse
To me this file looks like a CSV with 15 fields (on each line) not 16,
the last field being empty with the exception of the one which has the
'B'.  The 14th is always empty.

I also note that it does not seem to have a new line at the end.


I can strongly recommend QSV to manipulate CSV files and CSVIEW to look
at them

After renaming the file for convenience you can do something like

qsv input --trim-fields --trim-headers sample.csv \
| qsv select -n "1,2,6,7,8,9,10" \
| qsv rename "date,c2,type,c4,c5,c6,c7" \
| csview -i5 -np0

and get something like

┌──┬┬──┬───┬┬┬──┬──┐
│# │  date  │  c2  │ type  │ c4 │ c5 │c6│c7│
├──┼┼──┼───┼┼┼──┼──┤
│1 │1980-01-01 10:00│226918│WAHRAIN│5124│1001│0 │  │
│2 │1980-01-01 10:00│228562│WAHRAIN│491 │1001│0 │  │
│3 │1980-01-01 10:00│231581│WAHRAIN│5213│1001│0 │  │
│4 │1980-01-01 10:00│232671│WAHRAIN│487 │1001│0 │  │
│5 │1980-01-01 10:00│232913│WAHRAIN│5243│1001│0 │  │
│6 │1980-01-01 10:00│234362│WAHRAIN│5265│1001│0 │  │
│7 │1980-01-01 10:00│234682│WAHRAIN│5271│1001│0 │  │
│8 │1980-01-01 10:00│235389│WAHRAIN│5279│1001│0 │  │
│9 │1980-01-01 10:00│236466│WAHRAIN│497 │1001│0 │  │
│10│1980-01-01 10:00│243350│SREW   │484 │1001│0 │  │
│11│1980-01-01 10:00│243350│WAHRAIN│484 │1001│0 │0 │
└──┴┴──┴───┴┴┴──┴──┘

As the files do not have headers, you could, if you have multiple files,
even do something like

qsv cat rows s*.csv \
| qsv input --trim-fields --trim-headers \
| qsv select -n "1,2,6,7,8,9,10" \
| qsv rename "date,c2,type,c4,c5,c6,c7" \
| qsv dedup 2>/dev/null -o readmeintoR.csv


If it was REALLY a file with different numbers of fields you can use
CSVQ and do something like

cat s*csv \
| csvq --format CSV --no-header --allow-uneven-fields \
"SELECT c1 as date, c2, c6 as type, c7 as c4,
  c8 as c5, c9 as c6, c10 as c7
FROM stdin" \
| qsv input --trim-fields --trim-headers \
| qsv dedup 2>/dev/null -o readmeintoR.csv

And, finally, depending on how long the reading of the CSV takes, I
would save it into a RDS, loading of which is very fast.


greetings, el

On 2022-09-29 17:26 , Nick Wray wrote:
> Hi Bert   
> 
> Right Thing is, I didn't know that there even was an instruction like
> read.csv(text = "...  your text...  ") so at any rate I can paste the
> original text files in by hand if there's no shorter cut
> Thanks v much Nick
[...]

__
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] How to parse a really silly date with lubridate

2022-07-13 Thread Dr Eberhard W Lisse



Bui,

thanks, this what Avi suggested in an email to me as well and works.

It's so easy if you know it :-)-O

el

On 2022-07-13 23:40 , Rui Barradas wrote:

Hello,

Are you looking for mutate? In the example below I haven't included the 
filter, since the tibble only has 2 rows. But the date column is coerced 
to an actual datetime class in place, without the need for NewDate.


suppressPackageStartupMessages({
   library(tibble)
   library(dplyr)
})

DDATA <- tibble(Date = c('9. Jul 2022 at 11:39', '10. Jul 2022 at 01:58'))

DDATA %>%
   mutate(Date = lubridate::dmy_hm(Date))
#> # A tibble: 2 × 1
#>   Date
#>   
#> 1 2022-07-09 11:39:00
#> 2 2022-07-10 01:58:00


Hope this helps,

Rui Barradas

[...]

__
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] How to parse a really silly date with lubridate

2022-07-13 Thread Dr Eberhard W Lisse



Hi,

while all of the below work in a character vector, none works in
the tibble.

The following

DDATA %>%
add_column(as.tibble(lubridate::dmy_hm(DDATA$Date)),
.before = "Period") %>%
rename(NewDate=value) %>%
select(Date,NewDate) %>%
filter(between(as.Date(NewDate),as.Date('2022-07-09'),
as.Date('2022-07-10')))

does work

# A tibble: 3 × 2
  Date  NewDate
   
1 9. Jul 2022 at 11:39  2022-07-09 11:39:00
2 10. Jul 2022 at 01:58 2022-07-10 01:58:00
3 10. Jul 2022 at 11:26 2022-07-10 11:26:00

but I wonder if that can not be done more elegantly, ie by direct
replacements in the column.

greetings, el

On 2022-07-13 16:48 , Rui Barradas wrote:
[...]
> d <- c('9. Jul 2022 at 11:39', '10. Jul 2022 at 01:58')
> lubridate::dmy_hm(d)
> #> [1] "2022-07-09 11:39:00 UTC" "2022-07-10 01:58:00 UTC"
[...]

On 2022-07-13 16:03 , Ben Tupper wrote:
[...]
> s = c("9. Jul 2022 at 11:39", "10. Jul 2022 at 01:58")
> as.POSIXct(s, format = "%d. %b %Y at %H:%M")
> as.POSIXct(s, format = "%d. %b %Y at %H:%M", tz = "UTC")
[...]

On 2022-07-13 15:52 , Ivan Krylov wrote:
[...]
> Sys.setlocale('LC_TIME', 'C')
> strptime(
>   c('9. Jul 2022 at 11:39', '10. Jul 2022 at 01:58'),
>   '%d. %b %Y at %H:%M'
> )
[...]


> Às 14:40 de 13/07/2022, Dr Eberhard Lisse escreveu:
>>
>> Hi,
>>
>> I have data file which generated by an otherwise very nice (diabetes
>> log) app, but exports dates really silly.
>>
>> After reading the enclosed mwe.csv into R like so
>>
>>   MWE <- read_delim('mwe.csv', delim = ';') %>%
>>  select(Date) %>%
>>  print()
>>
>>
>> this comes out as:
>>
>>   # A tibble: 2 × 1
>>  Date
>>  
>>   1 9. Jul 2022 at 11:39
>>   2 10. Jul 2022 at 01:58
>>
>>
>> No matter what I try I am not able to parse this inside R to get at
>> proper dates (I have loaded tidyverse and lubridate).
>>
>> I can easily do somethig
>>
>>   csvq  -d ';' -t '%e. %b %Y at %H:%i' \
>>  'SELECT Date as oridate,
>>  DATETIME_FORMAT(Date, "%Y-%m-%d %H:%m") AS date
>>  FROM mwe'
>>
>>   +---+--+
>>   |oridate|   date   |
>>   +---+--+
>>   | 9. Jul 2022 at 11:39  | 2022-07-09 11:07 |
>>   | 10. Jul 2022 at 01:58 | 2022-07-10 01:07 |
>>   +---+--+
>>
>> and hence could easily do something like
>>
>>   csvq  -d ';' -t '%e. %b %Y at %H:%i' \
>>'ALTER mwe
>>SET Date = DATETIME_FORMAT(Date, "%Y-%m-%d %H:%m")'
>>
>> but would rather like to be able to do it inside R and would therefor
>> appreciate any advice in this regard.
>>
>>
>> greetings, el
>>
>

__
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] cleanup/replacing a value on condition of another value

2021-10-26 Thread Dr Eberhard W Lisse

Thanks.

Your method

   mutate(
  cases = ifelse(
 country == 'Namibia'
& type == 'confirmed'
& date == '2021-10-23'
& cases == 357,
 NA,
 cases
  )
   )

works, as does Rui's

   mutate(
  cases = replace(
 cases,
 which(country == 'Namibia'
& type == 'confirmed'
& date == '2021-10-23'
& cases == 357),
 NA
  )
   )

Thank you both, again.

el

On 2021-10-25 23:14 , Avi Gross via R-help wrote:
> I wonder why it is not as simple as:
>
> Call mutate on the data and have a condition that looks like:
>
> data %>% mutate(cases = ifelse(multiple_cond, NA, cases) -> output
[...]

__
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] cleanup/replacing a value on condition of another value

2021-10-25 Thread Dr Eberhard W Lisse



Thank you very much,

'which' does the trick :-)-O

greetings, el

On 2021-10-25 19:06 , Rui Barradas wrote:

Hello,

Here is a pipe to replace based on the composite condition.
It uses ?base::replace with an integer index vector.


[...]

library(dplyr)

data(coronavirus, package = "coronavirus")

coronavirus %>%

[...]

   mutate(cases = replace(cases,
  which(country == 'Namibia' &
  date == '2021-10-23' &
  cases == 357), NA)
   )

[...]


Hope this helps,

Rui Barradas

[...]

__
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] cleanup/replacing a value on condition of another value

2021-10-25 Thread Dr Eberhard W Lisse

Rui,

that works for me too, but is not what I need to do.

I want to make the 'cases' value for this particular country AND this
particular date AND this particular type AND this particular value (ie
ALL conditions must be fulfilled) become NA so that the tibble would
change from

[...]
2 Namibia 2021-10-24 death 4
3 Namibia 2021-10-23 confirmed   357
4 Namibia 2021-10-23 death 1
[...]

to

[...]
2 Namibia 2021-10-24 death 4
3 Namibia 2021-10-23 confirmed   357
4 Namibia 2021-10-23 death 1
[...]

as long as they don't fix the dataset, and if/when they do it goes to
the expected 23 value :-)-O

greetings, el

On 2021-10-25 17:26 , Rui Barradas wrote:
> Hello,
>
> The following works with me.
>
>
> library(coronavirus)
> library(dplyr)
>
> data(coronavirus, package = "coronavirus")
> #update_dataset(silence = FALSE)
>
> coronavirus %>%
>select(country, date, type, cases) %>%
>filter(
>  country == 'Namibia',
>  date == '2021-10-23',
>  cases == 357
>)
>
>
>
> Can you post the pipe code you are running?
>
> Hope this helps,
>
> Rui Barradas
>
> Às 12:25 de 25/10/21, Dr Eberhard W Lisse escreveu:
>> Hi,
>>
>> I have data from JHU via the 'coronavirus' package which has a value for
>> the confirmed cases for 2021-10-23 which differs drastically (357) from
>> what is reported in country (23).
>>
>>  # A tibble: 962 × 4
>>country date   type  cases
>> 
>>  1 Namibia 2021-10-24 confirmed23
>>  2 Namibia 2021-10-24 death 4
>>  3 Namibia 2021-10-23 confirmed   357
>>  4 Namibia 2021-10-23 death 1
>>  5 Namibia 2021-10-22 confirmed30
>>  6 Namibia 2021-10-22 death 1
>>  # … with 956 more rows
>>
>> I am using a '%>%' pipeline and am struggling to mutate 'cases' to NA
>> using something like
>>
>>  country == 'Namibia' & date == '2021-10-23' & cases == 357
>>
>> so that if or when the data-set is corrected I don't have to change the
>> code (immediately), even after some googling.
>>
>> I can do
>>
>>  cases == 357
>>
>> only, but that could find other cases as well, which is obviously not
>> the thing to do
>>
>> Any suggestions?
>>
>> greetings, el
>>
>> __
>> 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] cleanup/replacing a value on condition of another value

2021-10-25 Thread Dr Eberhard W Lisse

Hi,

I have data from JHU via the 'coronavirus' package which has a value for
the confirmed cases for 2021-10-23 which differs drastically (357) from
what is reported in country (23).

# A tibble: 962 × 4
  country date   type  cases
   
1 Namibia 2021-10-24 confirmed23
2 Namibia 2021-10-24 death 4
3 Namibia 2021-10-23 confirmed   357
4 Namibia 2021-10-23 death 1
5 Namibia 2021-10-22 confirmed30
6 Namibia 2021-10-22 death 1
# … with 956 more rows

I am using a '%>%' pipeline and am struggling to mutate 'cases' to NA
using something like

country == 'Namibia' & date == '2021-10-23' & cases == 357

so that if or when the data-set is corrected I don't have to change the
code (immediately), even after some googling.

I can do

cases == 357

only, but that could find other cases as well, which is obviously not 
the thing to do


Any suggestions?

greetings, el

__
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] How to average minutes per hour per month in the form of '# hours #minutes'

2021-03-26 Thread Dr Eberhard W Lisse

Jeff,

thank you. However, if I knew how to do this, I would probably not
have asked :-)-O

I think I have been reasonably comprehensive in describing my issue, but
let me do it now with the real life problem:

My malpractice insurance gives me a discount if I consult up to 22
hours per week in a 3 months period.

I add every patient, date and minutes whenever I see her into a MySQL
database.  I want to file the report of my hours worked with them for
the first 3 month period (November to January and not properly quarterly
unfortunately :-)-0), and while I can generate this with LyX/LateX and
knitR producing a (super)tabular table containing the full list, and
tables for time per week and time per month I really can't figure out is
how to average the hours worked per week for each month (even if weeks
don't align with months properly :-)-O)

While I am at it how would I get this to sort properly (year, month) if
I used the proper names of the months, ie '%Y %B' or '%B %Y'?

  CONSMINUTES %>%
select(datum, dauer)  %>%
group_by(month = format(datum, '%Y %m'),
  week = format(datum, '%V'))  %>%
summarise_if(is.numeric, sum) %>%
mutate(hm=sprintf("%d Hour%s %d Minutes", dauer %/% 60,
  ifelse((dauer %/% 60) == 1, " ", "s"), dauer %% 60)) %>%   
select(-dauer)


Any help, or just pointers to where I can read this up, are highly
appreciated.

greetings, el


On 2021-03-25 22:37 , Jeff Newmiller wrote:
> This is a very unclear question.  Weeks don't line up with months..
> so you need to clarify how you would do this or at least give an
> explicit example of input data and result data.
>
> On March 25, 2021 11:34:15 AM PDT, Dr Eberhard W Lisse 
 wrote:

>> Thanks, that is helpful.
>>
>> But, how do I group it to produce hours worked per week per month?
>>
>> el
>>
>>
>> On 2021-03-25 19:03 , Greg Snow wrote:
>>> Here is one approach:
>>>
>>> tmp <- data.frame(min=seq(0,150, by=15))
>>>
>>> tmp %>%
>>> mutate(hm=sprintf("%2d Hour%s %2d Minutes",
>>>   min %/% 60, ifelse((min %/% 60) == 1, " ", "s"),
>>>   min %% 60))
>>>
>>> You could replace `sprintf` with `str_glue` (and update the syntax
>>> as well) if you realy need tidyverse, but you would also loose some
>>> formatting capability.
>>>
>>> I don't know of tidyverse versions of `%/%` or `%%`.  If you need
>>> the numeric values instead of a string then just remove the
>>> `sprintf` and use mutate directly with `min %/% 60` and `min %% 60`.
>>>
>>> This of course assumes all of your data is in minutes (by the time
>>> you pipe to this code) and that all hours have 60 minutes (I don't
>>> know of any leap hours.
>>>
>>> On Sun, Mar 21, 2021 at 8:31 AM Dr Eberhard W Lisse 
>> wrote:
>>>>
>>>> Hi,
>>>>
>>>> I have minutes worked by day (with some more information)
>>>>
>>>> which when using
>>>>
>>>>   library(tidyverse)
>>>>   library(lubridate)
>>>>
>>>> run through
>>>>
>>>>   CONSMINUTES %>%
>>>>   select(datum, dauer) %>%
>>>>   arrange(desc(datum))
>>>>
>>>> look somewhat like
>>>>
>>>>   # A tibble: 142 x 2
>>>>  datum  dauer
>>>>   
>>>>1 2021-03-1830
>>>>2 2021-03-1730
>>>>3 2021-03-1630
>>>>4 2021-03-1630
>>>>5 2021-03-1630
>>>>6 2021-03-1630
>>>>7 2021-03-1130
>>>>8 2021-03-1130
>>>>9 2021-03-1130
>>>>   10 2021-03-1130
>>>>   # … with 132 more rows
>>>>
>>>> I can extract minutes per hour
>>>>
>>>>   CONSMINUTES %>%
>>>>   select(datum, dauer) %>%
>>>>   group_by(week = format(datum, '%Y %V'))%>%
>>>>   summarise_if(is.numeric, sum)
>>>>
>>>> and minutes per month
>>>>
>>>>   CONSMINUTES %>%
>>>>   select(datum, dauer) %>%
>>>>   group_by(month = format(datum, '%Y %m'))%>%
>>>>   summarise_if(is.numeric, sum)
>>>>
>>>> I need to show the time worked per week per month in the format of
>>>>
>>>>   '# hours # minutes'
>>>>
>>>> and would like to also be able to show the average time per week
>>>> per month.
>>>>
>>>> How can I do that (preferably with tidyverse :-)-O)?
>>>>
>>>> greetings, el

__
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] How to average minutes per hour per month in the form of '# hours #minutes'

2021-03-25 Thread Dr Eberhard W Lisse

Thanks, that is helpful.

But, how do I group it to produce hours worked per week per month?

el


On 2021-03-25 19:03 , Greg Snow wrote:

Here is one approach:

tmp <- data.frame(min=seq(0,150, by=15))

tmp %>%
   mutate(hm=sprintf("%2d Hour%s %2d Minutes",
 min %/% 60, ifelse((min %/% 60) == 1, " ", "s"),
 min %% 60))

You could replace `sprintf` with `str_glue` (and update the syntax as
well) if you realy need tidyverse, but you would also loose some
formatting capability.

I don't know of tidyverse versions of `%/%` or `%%`.  If you need the
numeric values instead of a string then just remove the `sprintf` and
use mutate directly with `min %/% 60` and `min %% 60`.

This of course assumes all of your data is in minutes (by the time you
pipe to this code) and that all hours have 60 minutes (I don't know of
any leap hours.

On Sun, Mar 21, 2021 at 8:31 AM Dr Eberhard W Lisse  wrote:


Hi,

I have minutes worked by day (with some more information)

which when using

 library(tidyverse)
 library(lubridate)

run through

 CONSMINUTES %>%
 select(datum, dauer) %>%
 arrange(desc(datum))

look somewhat like

 # A tibble: 142 x 2
datum  dauer
 
  1 2021-03-1830
  2 2021-03-1730
  3 2021-03-1630
  4 2021-03-1630
  5 2021-03-1630
  6 2021-03-1630
  7 2021-03-1130
  8 2021-03-1130
  9 2021-03-1130
 10 2021-03-1130
 # … with 132 more rows

I can extract minutes per hour

 CONSMINUTES %>%
 select(datum, dauer) %>%
 group_by(week = format(datum, '%Y %V'))%>%
 summarise_if(is.numeric, sum)

and minutes per month

 CONSMINUTES %>%
 select(datum, dauer) %>%
 group_by(month = format(datum, '%Y %m'))%>%
 summarise_if(is.numeric, sum)

I need to show the time worked per week per month in the format of

 '# hours # minutes'

and would like to also be able to show the average time per week per
month.

How can I do that (preferably with tidyverse :-)-O)?

greetings, el

__
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] How to average minutes per hour per month in the form of '# hours #minutes'

2021-03-21 Thread Dr Eberhard W Lisse

Hi,

I have minutes worked by day (with some more information)

which when using

library(tidyverse)
library(lubridate)

run through

CONSMINUTES %>%
select(datum, dauer) %>%
arrange(desc(datum))

look somewhat like

# A tibble: 142 x 2
   datum  dauer

 1 2021-03-1830
 2 2021-03-1730
 3 2021-03-1630
 4 2021-03-1630
 5 2021-03-1630
 6 2021-03-1630
 7 2021-03-1130
 8 2021-03-1130
 9 2021-03-1130
10 2021-03-1130
# … with 132 more rows

I can extract minutes per hour

CONSMINUTES %>%
select(datum, dauer) %>%
group_by(week = format(datum, '%Y %V'))%>%
summarise_if(is.numeric, sum)

and minutes per month

CONSMINUTES %>%
select(datum, dauer) %>%
group_by(month = format(datum, '%Y %m'))%>%
summarise_if(is.numeric, sum)

I need to show the time worked per week per month in the format of

'# hours # minutes'

and would like to also be able to show the average time per week per
month.

How can I do that (preferably with tidyverse :-)-O)?

greetings, el

__
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] Command history

2021-03-01 Thread Dr Eberhard W Lisse
I don't use R.app.

And as I wrote later, there are a number of .Rhistory so it depends
on where you start R/RStudio from.


el

On 2021-03-01 22:29 , David Carlson wrote:
> On the Mac there can be 2 files.  The R Studio uses .Rhistory, but Rapp
> uses .Rapp.history.
> 
> David L Carlson
> 
> On Sun, Feb 28, 2021 at 9:06 AM Dr Eberhard W Lisse  <mailto:e...@lisse.na>> wrote:
> 
> On the Mac it is ~/.Rhistory
> 
> el
> 
> On 2021-02-28 15:39 , Mahmood Naderan-Tahan wrote:
> > Hi
> >
> > May I know where is the location of commands we used in R in the
>     history?
>     >
> >
> > Regards,
> > Mahmood--
> Dr. Eberhard W. Lisse   \         /       Obstetrician & Gynaecologist
> e...@lisse.na             / *      |  Telephone: +264 81 124 6733 (cell)
> PO Box 8421 Bachbrecht  \      /  If this email is signed with GPG/PGP
> 10007, Namibia           ;/ Sect 20 of Act No. 4 of 2019 may apply
> 
> __
> R-help@r-project.org <mailto:R-help@r-project.org> mailing list --
> To UNSUBSCRIBE and more, see
> 
> https://urldefense.com/v3/__https://stat.ethz.ch/mailman/listinfo/r-help__;!!KwNVnqRv!SUf5kuq252PAyFzTK-iHj_UuxwZnkuU_IN9jLFqA2A4KEY2Tg5h4iIQNLWMbd-s$
> 
> <https://urldefense.com/v3/__https://stat.ethz.ch/mailman/listinfo/r-help__;!!KwNVnqRv!SUf5kuq252PAyFzTK-iHj_UuxwZnkuU_IN9jLFqA2A4KEY2Tg5h4iIQNLWMbd-s$>
> 
> PLEASE do read the posting guide
> 
> https://urldefense.com/v3/__http://www.R-project.org/posting-guide.html__;!!KwNVnqRv!SUf5kuq252PAyFzTK-iHj_UuxwZnkuU_IN9jLFqA2A4KEY2Tg5h4iIQNnW6K_7Y$
> 
> <https://urldefense.com/v3/__http://www.R-project.org/posting-guide.html__;!!KwNVnqRv!SUf5kuq252PAyFzTK-iHj_UuxwZnkuU_IN9jLFqA2A4KEY2Tg5h4iIQNnW6K_7Y$>
> 
> and provide commented, minimal, self-contained, reproducible code.
> 

-- 
Dr. Eberhard W. Lisse   \ /   Obstetrician & Gynaecologist
e...@lisse.na / *  |  Telephone: +264 81 124 6733 (cell)
PO Box 8421 Bachbrecht  \  /  If this email is signed with GPG/PGP
10007, Namibia   ;/ Sect 20 of Act No. 4 of 2019 may apply

__
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] Command history

2021-02-28 Thread Dr Eberhard W Lisse
Oh

find ~ -name .Rhistory 2>/dev/null

shows 12 file :-)-O


vriendelijke groeten/sincères amitiés,

el

On 2021-02-28 17:17 , Mahmood Naderan-Tahan wrote:
> OK. It seems that it depends on where R is launched.
> 
> In my case, I found .Rhistory file in ~/Documents.
> 
> 
> Regards,
> Mahmood
[...]
-- 
Dr. Eberhard W. Lisse   \ /   Obstetrician & Gynaecologist
e...@lisse.na / *  |  Telephone: +264 81 124 6733 (cell)
PO Box 8421 Bachbrecht  \  /  If this email is signed with GPG/PGP
10007, Namibia   ;/ Sect 20 of Act No. 4 of 2019 may apply

__
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] Command history

2021-02-28 Thread Dr Eberhard W Lisse
On the Mac it is ~/.Rhistory

el

On 2021-02-28 15:39 , Mahmood Naderan-Tahan wrote:
> Hi
> 
> May I know where is the location of commands we used in R in the history?
> 
> 
> Regards,
> Mahmood-- 
Dr. Eberhard W. Lisse   \ /   Obstetrician & Gynaecologist
e...@lisse.na / *  |  Telephone: +264 81 124 6733 (cell)
PO Box 8421 Bachbrecht  \  /  If this email is signed with GPG/PGP
10007, Namibia   ;/ Sect 20 of Act No. 4 of 2019 may apply

__
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] Troubles installing Rcmdr on Mac

2021-01-12 Thread Dr Eberhard W Lisse
John,

maybe I misunderestimate the students :-)-O but there is not much
sophistication required to follow simple instructions while thinking
about what one is doing when doing so.  At least that was my generation
of students did.

If they can install XQuartz, they can install the command line tools.

And, it's not about RCmdr but about the source packages that you may
want to have to install for which the command line tools are required.

Finally, RStudio is so much easier and more powerful, that I wonder why 
one is bothering with this including XQuartz.

greetings, el

On 12/01/2021 16:19, John Fox wrote:
> Dear Eberhard,
> 
> On 2021-01-12 12:32 a.m., Dr Eberhard W Lisse wrote:
>> John,
>>
>> what is wrong with installing Xcode’s command lime tools (not Xcode
>> itself)?
> 
> Nothing, and I did miss the distinction, but it shouldn't be
> necessary, and the instructions for installing the Rcmdr are already
> more complicated on macOS than on other platforms because of the
> necessity to install XQuartz.  Users should be able to install the
> Rcmdr package on macOS without having to install packages from source.
> 
> Remember that Rcmdr users are typically students in basic statistics
> courses, many of whom have limited software sophistication.
> Unnecessarily complicating the installation is undesirable.  Of
> course, if it's necessary to complicate the installation, one has to
> live with that.
> 
> I'll be interested to learn whether my suggestions solve the problem.
> If not, I can add an instruction concerning the Xcode tools to the
> Rcmdr installation notes for macOS.
> 
> Thanks for your help,
>  John
[...]

-- 
Dr. Eberhard W. Lisse   \ /   Obstetrician & Gynaecologist 
e...@lisse.na / *  |  Telephone: +264 81 124 6733 (cell)
PO Box 8421 Bachbrecht  \  /  If this email is signed with GPG/PGP
10007, Namibia   ;/ Sect 20 of Act No. 4 of 2019 may apply

__
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] Troubles installing Rcmdr on Mac

2021-01-11 Thread Dr Eberhard W Lisse
John,

what is wrong with installing Xcode’s command lime tools (not Xcode itself)?


—
Sent from Dr Lisse’s iPhone
On 12 Jan 2021, 04:30 +0200, John Fox , wrote:
> Dear Stephane,
>
> I've taken yet another look at this and have an additional suggestion
> for your students to try:
>
> install.packages("Rcmdr", type="mac.binary")
>
> That should avoid any attempt to install Rcmdr package dependencies from
> source.
>
> I hope this helps,
> John
>
> On 2021-01-11 3:53 p.m., John Fox wrote:
> > Dear Stephane and Eberhard,
> >
> > As an addendum to my previous response, I uninstalled the Rcmdr package
> > and all of its direct and indirect dependencies and then reinstalled the
> > package -- on a macOS 11.1 system running R 4.0.3 with all other
> > packages up-to-date.
> >
> > I then reinstalled the Rcmdr and dependencies via the command
> > install.packages("Rcmdr"), and responded "no" when asked whether to
> > install some packages from source (perhaps this is the explanation for
> > the problem, if your students responded "yes" without having Xcode
> > installed).
> >
> > Following these steps, everything (still) works fine. I therefore can't
> > duplicate your students' problem, which makes it hard to suggest how to
> > fix it, without having some additional details.
> >
> > Best,
> >  John
> >
> >
> > On 2021-01-11 3:33 p.m., John Fox wrote:
> > > Dear Stephane and Eberhard,
> > >
> > > It should not be necessary to install Xcode (which includes otools) to
> > > install and use the Rcmdr package on macOS because it shouldn't be
> > > necessary to install the CRAN packages required from source. I'm
> > > currently running the Rcmdr on two macOS 11.1 systems, with all CRAN
> > > packages up-to-date, and don't have any problems.
> > >
> > > Stephane, have you and your students checked the Rcmdr installation
> > > notes (at
> > > )
> > > and followed the instructions there? If you have, and still experience
> > > this problem, it would help to have some more information about what
> > > they did to install the Rcmdr and what happened.
> > >
> > > In the meantime, I'll try a fresh install of the Rcmdr and
> > > dependencies to see whether I encounter any difficulties.
> > >
> > > Best,
> > >   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.

[[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] Troubles installing Rcmdr on Mac

2021-01-11 Thread Dr Eberhard W Lisse
Use RStudio.

But it can be that the command line tools are missing, which you (may) need to 
compile packages (from source).Ask one of them to open a terminal window and 
type the command ‘make —version’ without the ‘’) if that results in an error 
they need to enter ‘sudo xcode-select —install’ and then their password when 
asked.If that fixes the issue have all of them do that.

el

—
Sent from Dr Lisse’s iPhone
On 11 Jan 2021, 20:39 +0200, CHAMPELY STEPHANE 
, wrote:
> Dear colleagues,
> I try to help my (french) student since five days to install Rcmd for mac and 
> they have (ALL of them, and I use windows so I am not very skilled for that 
> task) the same problem. When they load Rcmd, some supplementary tools (in 
> order to use the command "otool") are missing according a message and trying 
> to download them leads to a message indicated that it is not at the present 
> moment available (since Thursday last week...)
> So the menu of the Rcmdr are "white". Any idea where this technical problem 
> come from ?
> Thank you fr any help !
>
> [[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.

[[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] Windows path backward slash

2020-12-24 Thread Dr Eberhard W Lisse
What happens if you go to the import tool in RStudio?

It should do your bidding, and, it produces code which
you then can copy and paste.

el

On 2020-12-24 19:31 , Anbu A wrote:
> Hi Bill,
>   r"{C:\Users\Anbu\Desktop\sas\}"  - This is the key and code below worked.
> fsasdat<-function(dsn) {
>   pat=r"{C:\Users\Anbu\Desktop\sas\}"
>   str1=str_c(pat,dsn,".sas7bdat")
>   read_sas(str1)
> #return(str1)
> }
> allmetrx=fsasdat("all")
> str(allmetrx)
> 
> Thank you.
> 
> Anbu.
> 
> 
> On Thu, Dec 24, 2020 at 12:12 PM Bill Dunlap 
> wrote:
> 
>> The "\n" is probably not in the file name.  Does omitting it from the call
>> to str_c help?
>>
>> -Bill
>>
>> On Thu, Dec 24, 2020 at 6:20 AM Anbu A  wrote:
>>
>>> Hi All,
>>> I am a newbie. This is my first program.
>>> I am trying to read SAS dataset from below path. I added escape "\" along
>>> "\" found in path C:\Users\axyz\Desktop\sas\  but still not working.
>>>
>>> fsasdat<-function(dsn) {
>>>   pat="C:\\Users\\axyz\\Desktop\\sas\\"
>>>   str1=str_c(pat,dsn,".sas7bdat","\n")
>>>   allmetrx=read_sas(str1)
>>> }
>>> fsasdat("all")
>>>
>>> Please help me.
>>>
>>> Thanks,
>>> AA.
>>>
>>> [[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.
>>>
>>
> 
>   [[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.
> 

-- 
Dr. Eberhard W. Lisse   \ /   Obstetrician & Gynaecologist
e...@lisse.na / *  |  Telephone: +264 81 124 6733 (cell)
PO Box 8421 Bachbrecht  \  /  If this email is signed with GPG/PGP
10007, Namibia   ;/ Sect 20 of Act No. 4 of 2019 may apply

__
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] Finance & R

2020-12-23 Thread Dr Eberhard W Lisse
Joshua,

there may be some cultural differences in play, some people are direct,
some don't like the American passive aggressiveness, and then English
may not be the first language of a poster.

A package may be a bit outdated, or not. If so, it in itself means
nothing other than that it is a bit outdated. Even if it is free of
bugs, and do what it is supposed to do, fast.

I think it is legitimate to ask here for alternatives.

el

On 2020-12-23 20:06 , Joshua Ulrich wrote:
> Hi Ben,
>
> It's not very polite to call people's work "outdated", especially when
> given to you for free.  Those packages have been around and stable
> for the better part of a decade, will remain stable, are actively
> maintained, and all work well together to form a comprehensive suite
> of tools for financial analysis.
>
> Best,
> Josh
>
> On Wed, Dec 23, 2020 at 11:58 AM Ben van den Anker via R-help
>  wrote:
>>
>>
>>
>> Hello everyone,
>> Could anyonre recommend some good resources for finance applications
>> in R? I find the packages quantmod, TTR and PerformanceAnalytics a
>> bit outdated. There must be something more recent on the market. Any
>> suggestions will be much appreciated!
>>
>> Cheers,
>> Ben van den Anker
[...]
-- 
Dr. Eberhard W. Lisse   \ /   Obstetrician & Gynaecologist
e...@lisse.na / *  |  Telephone: +264 81 124 6733 (cell)
PO Box 8421 Bachbrecht  \  /  If this email is signed with GPG/PGP
10007, Namibia   ;/ Sect 20 of Act No. 4 of 2019 may apply

__
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] FInd packages in need of Update (like RStudio)

2020-12-23 Thread Dr Eberhard W Lisse
Or rather

Rscript -e 'local({r <- getOption("repos");r["CRAN"] <-
"https://cloud.r-project.org/";options(repos =
r)});update.packages(dependencies = TRUE, ask=FALSE)'

as a one liner :-)-O

el

On 2020-12-23 17:59 , Dr Eberhard W Lisse wrote:
> Thanks,
> 
>   update.packages(dependencies = TRUE, ask=FALSE)
> 
> does what I want.
> 
> greetings, el[...]

-- 
Dr. Eberhard W. Lisse   \ /   Obstetrician & Gynaecologist
e...@lisse.na / *  |  Telephone: +264 81 124 6733 (cell)
PO Box 8421 Bachbrecht  \  /  If this email is signed with GPG/PGP
10007, Namibia   ;/ Sect 20 of Act No. 4 of 2019 may apply

__
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] FInd packages in need of Update (like RStudio)

2020-12-23 Thread Dr Eberhard W Lisse
Thank you,

but the RFTM suggestion helped me even more :-)-O

greetings, el

On 2020-12-23 17:06 , Sarah Goslee wrote:
> Does update.packages() meet your needs?
> 
> 
> Sarah
> 
> On Wed, Dec 23, 2020 at 9:39 AM Dr Eberhard W Lisse  wrote:
>>
>> Hi,
>>
>> does anyone know how one would look which packages require an update
>> (like the Tools -> Update Packages) but can do it from R (ie Rscript) or
>> any other way from the command line (on the MAc)
>>
>> I would like to build this into my update script which currently does
>> brew, cpan and pip3 :-)-O
>>
>> greetings, el
>> --
>> Dr. Eberhard W. Lisse   \ /   Obstetrician & Gynaecologist
>> e...@lisse.na / *  |  Telephone: +264 81 124 6733 (cell)
>> PO Box 8421 Bachbrecht  \  /  If this email is signed with GPG/PGP
>> 10007, Namibia   ;/ Sect 20 of Act No. 4 of 2019 may apply
>>
>> __
>> 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.
> 
> 
> 

-- 
Dr. Eberhard W. Lisse   \ /   Obstetrician & Gynaecologist
e...@lisse.na / *  |  Telephone: +264 81 124 6733 (cell)
PO Box 8421 Bachbrecht  \  /  If this email is signed with GPG/PGP
10007, Namibia   ;/ Sect 20 of Act No. 4 of 2019 may apply

__
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] FInd packages in need of Update (like RStudio)

2020-12-23 Thread Dr Eberhard W Lisse
Thanks,

update.packages(dependencies = TRUE, ask=FALSE)

does what I want.

greetings, el

On 2020-12-23 17:30 , Deepayan Sarkar wrote:
> On Wed, Dec 23, 2020 at 8:09 PM Dr Eberhard W Lisse  wrote:
>>
>> Hi,
>>
>> does anyone know how one would look which packages require an update
>> (like the Tools -> Update Packages) but can do it from R (ie Rscript) or
>> any other way from the command line (on the MAc)
> 
> ? old.packages
> 
> Best,
> -Deepayan
> 
>> I would like to build this into my update script which currently does
>> brew, cpan and pip3 :-)-O
>>
>> greetings, el
>> --
>> Dr. Eberhard W. Lisse   \ /   Obstetrician & Gynaecologist
>> e...@lisse.na / *  |  Telephone: +264 81 124 6733 (cell)
>> PO Box 8421 Bachbrecht  \  /  If this email is signed with GPG/PGP
>> 10007, Namibia   ;/ Sect 20 of Act No. 4 of 2019 may apply
>>
>> __
>> 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.

-- 
Dr. Eberhard W. Lisse   \ /   Obstetrician & Gynaecologist
e...@lisse.na / *  |  Telephone: +264 81 124 6733 (cell)
PO Box 8421 Bachbrecht  \  /  If this email is signed with GPG/PGP
10007, Namibia   ;/ Sect 20 of Act No. 4 of 2019 may apply

__
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] FInd packages in need of Update (like RStudio)

2020-12-23 Thread Dr Eberhard W Lisse
Hi,

does anyone know how one would look which packages require an update
(like the Tools -> Update Packages) but can do it from R (ie Rscript) or
any other way from the command line (on the MAc)

I would like to build this into my update script which currently does
brew, cpan and pip3 :-)-O

greetings, el
-- 
Dr. Eberhard W. Lisse   \ /   Obstetrician & Gynaecologist
e...@lisse.na / *  |  Telephone: +264 81 124 6733 (cell)
PO Box 8421 Bachbrecht  \  /  If this email is signed with GPG/PGP
10007, Namibia   ;/ Sect 20 of Act No. 4 of 2019 may apply

__
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] Subscript and superscript on one symbol; plotmath.

2020-12-09 Thread Dr Eberhard W Lisse
They let you guys go to the pup again? :-)-O

el

On 09/12/2020 10:06, Rolf Turner wrote:
[...]
> Is there any way to achieve, with plotmath, an effect like unto that
> produced by the LaTeX expression $\sigma^2_{11}$?  Or should I just
> give up and go to the pub? :-)
[...]
-- 
Dr. Eberhard W. Lisse   \ /   Obstetrician & Gynaecologist 
e...@lisse.na / *  |  Telephone: +264 81 124 6733 (cell)
PO Box 8421 Bachbrecht  \  /  If this email is signed with GPG/PGP
10007, Namibia   ;/ Sect 20 of Act No. 4 of 2019 may apply

__
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] write.csv covert Åland to land

2020-10-20 Thread Dr Eberhard W Lisse
Perhaps

?readr::write_delim()

el

On 20/10/2020 12:45, Dr Eberhard W Lisse wrote:
> Apologies, 
> 
> I meant
> 
> ?write.table()
> 
> el
> 
> On 20/10/2020 12:38, Jinsong Zhao wrote:
>> On 2020/10/20 17:23, Dr Eberhard W Lisse wrote:
>>> ?file.write()
>>>
>>> look for fileEncoding?
>>>
>>> el
>>>
>>
>> There is no file.write().  I have tried fileEncoding = "utf8" and
>> "latin1" in write.csv().  However, it does not have effect.  The output
>> is is land or land.
>>
>> Best,
>> Jinsong
> [...]
> 
> 

-- 
Dr. Eberhard W. Lisse   \ /   Obstetrician & Gynaecologist 
e...@lisse.na / *  |  Telephone: +264 81 124 6733 (cell)
PO Box 8421 Bachbrecht  \  /  If this email is signed with GPG/PGP
10007, Namibia   ;/ Sect 20 of Act No. 4 of 2019 may apply

__
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] write.csv covert Åland to land

2020-10-20 Thread Dr Eberhard W Lisse
Apologies, 

I meant

?write.table()

el

On 20/10/2020 12:38, Jinsong Zhao wrote:
> On 2020/10/20 17:23, Dr Eberhard W Lisse wrote:
>> ?file.write()
>>
>> look for fileEncoding?
>>
>> el
>>
> 
> There is no file.write().  I have tried fileEncoding = "utf8" and
> "latin1" in write.csv().  However, it does not have effect.  The output
> is is land or land.
> 
> Best,
> Jinsong
[...]


-- 
Dr. Eberhard W. Lisse   \ /   Obstetrician & Gynaecologist 
e...@lisse.na / *  |  Telephone: +264 81 124 6733 (cell)
PO Box 8421 Bachbrecht  \  /  If this email is signed with GPG/PGP
10007, Namibia   ;/ Sect 20 of Act No. 4 of 2019 may apply

__
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] write.csv covert Åland to land

2020-10-20 Thread Dr Eberhard W Lisse
?file.write()

look for fileEncoding?

el

On 20/10/2020 11:13, Jinsong Zhao wrote:
> Hi there,
> 
> I tried to export the names of country to a csv file with write.csv(). In the 
> resulted file, Åland was coverted to land. Is there any way could prevent 
> this happening? Thanks!
> 
>> abc
> [1] "Åland"
>> write.table(abc, file = "")
> "x"
> "1" "land"
> 
> Best,
> Jinsong
> 
> __
> 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.

-- 
Dr. Eberhard W. Lisse   \ /   Obstetrician & Gynaecologist 
e...@lisse.na / *  |  Telephone: +264 81 124 6733 (cell)
PO Box 8421 Bachbrecht  \  /  If this email is signed with GPG/PGP
10007, Namibia   ;/ Sect 20 of Act No. 4 of 2019 may apply

__
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] Dplyr question

2020-10-15 Thread Dr Eberhard W Lisse
This is well described in the manual.

Sounds like homework...

el

On 15/10/2020 12:39, Nico Gutierrez wrote:
> Hi All,
> 
> Trying to get familiar with dplyr so I have a basic question:
> 
> How to summarise sum(Values) per species, maintaining Code column (each 
> species has a Code):
> 
>   Species Values   Code
> 1Acanthocybium solandri33 LC
> 2Makaira nigricans20  VU
> 3Makaira nigricans 20 VU
> 4.   Makaira nigricans 20 VU
> 5   Sarda sarda2  LC
> 4Lethrinus lentjan   12   LC
> 5Raja pita8   DD
> 6Raja pita2   DD
> 
> I need:
> 
>  Species  Values   Code
> 1Acanthocybium solandri33 LC
> 2Makaira nigricans60  VU
> 3   Sarda sarda2  LC
> 4Lethrinus lentjan   12   LC
> 5Raja pita10  DD
> 
> 
> Thanks :)
> __
> 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.
> 

-- 
Dr. Eberhard W. Lisse   \ /   Obstetrician & Gynaecologist 
e...@lisse.na / *  |  Telephone: +264 81 124 6733 (cell)
PO Box 8421 Bachbrecht  \  /  If this email is signed with GPG/PGP
10007, Namibia   ;/ Sect 20 of Act No. 4 of 2019 may apply

__
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] merge question

2014-06-30 Thread Dr Eberhard W Lisse
Rolf,

I hear you. 

But, after reflection, ie I looked at my situation again, it is great :-)-O

el


Sent from Dr Lisse's iPad mini

> On Jun 30, 2014, at 0:48, Rolf Turner  wrote:
> 
> 
>> On 30/06/14 10:32, Dr Eberhard W Lisse wrote:
>> 
>> Thanks,
>> 
>> I then set NA to 0, and can do the sutraction,
>> 
>> great.
> 
> Not so great.  I haven't gone through the issues underlying this post, but 
> replacing NA by 0 will almost surely yield nonsense.  "Missing" is ***not*** 
> the same thing as "zero".  Pretending that it is will have disastrous 
> consequences.  Think through what you are trying to do more clearly.
> 
> cheers,
> 
> Rolf Turner

__
R-help@r-project.org mailing list
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] merge question

2014-06-29 Thread Dr Eberhard W Lisse
Thank you very much.

el

On 2014-06-30, 00:48 , Rolf Turner wrote:
> 
> On 30/06/14 10:32, Dr Eberhard W Lisse wrote:
> 
>> Thanks,
>>
>> I then set NA to 0, and can do the sutraction,
>>
>> great.
> 
> Not so great.  I haven't gone through the issues underlying this post,
> but replacing NA by 0 will almost surely yield nonsense.  "Missing" is
> ***not*** the same thing as "zero".  Pretending that it is will have
> disastrous consequences.  Think through what you are trying to do more
> clearly.
> 
> cheers,
> 
> Rolf Turner

__
R-help@r-project.org mailing list
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] merge question

2014-06-29 Thread Dr Eberhard W Lisse
Thanks,

I then set NA to 0, and can do the sutraction,

great.

el


On 2014-06-29, 22:32 , Michael Peng wrote:
> you can get a new data frame by
> merge(qpiso, qplegit, all.x = TRUE, all.y = TRUE, by = "iso" )
> Take the subtraction on the new data frame.
> 
> 
> 
> 
> 2014-06-29 11:24 GMT-05:00 Dr Eberhard Lisse  >:
> 
> I have two data frames like so
> 
> > qpiso
> iso requests
> 1A1   20
> 2A2  199
> 3AD5
> 4AE  176
> ...
> 189  ZW   82
> 
> > qplegit
> iso requests
> 1A2   36
> 2AE4
> 3AM2
> 4AO1
> ...
> 100  ZW3
> 
> 
> I want to create another dataframe qpspam which contains all pairs
> from pqiso with the values for requests of qplegit being subtracted
> from those which exist in qpiso,
> 
> ie
> iso requests
> 1A1   20
> 2A2  163
> 3AD5
> 4AE  172
> ...
> 189  ZW   79
> 
> but don't know how to do this, and google isn't too helpful.
> 
> As usual, a solution is preferred, but a pointer to where I can
> read this up is equally appreciated :-)-O
> 
> el
> 
> __
> R-help@r-project.org  mailing list
> 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
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] SQL vs R

2014-05-03 Thread Dr Eberhard W Lisse
Google Pressdram :-)-O

el

On 2014-05-03, 23:42 , Rolf Turner wrote:>
> On 04/05/14 00:05, Dr Eberhard W Lisse wrote:
>
>> Thank you very much, Mr Arkell.
>
> I don't get it.  Can anyone explain the (joke? allusion?) ?
>
> cheers,
>
> Rolf Turner
>

__
R-help@r-project.org mailing list
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] SQL vs R

2014-05-03 Thread Dr Eberhard W Lisse
Thanks,

will try to figure this out :-)-O

el

On 2014-05-03, 06:40 , Carlos Ortega wrote:
> Hi,
> 
> With the new package "dplyr" you can create equivalent SQL sintaxt
> queries like the one you need.
> You can find examples of how to apply it here:
> 
> http://martinsbioblogg.wordpress.com/2014/03/26/using-r-quickly-calculating-summary-statistics-with-dplyr/
> 
> http://martinsbioblogg.wordpress.com/2014/03/27/more-fun-with-and/
> 
> Regards,
> Carlos.
> 
> 
> 
> 
> 2014-05-02 23:23 GMT+02:00 Dr Eberhard Lisse  >:
> 
> Hi,
> 
> How do I do something like this without using sqldf?
> 
> a <- sqldf("SELECT COUNT(*) FROM b WHERE c = 'd'")
> 
> or
> 
> e <- sqldf("SELECT f, COUNT(*) FROM b GROUP BY f ORDER BY f")
> 
> greetings, el
> 
> __
> R-help@r-project.org  mailing list
> 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.
> 
> 
> 
> 
> -- 
> Saludos,
> Carlos Ortega
> www.qualityexcellence.es 

__
R-help@r-project.org mailing list
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] SQL vs R

2014-05-03 Thread Dr Eberhard W Lisse
Thank you very much, Mr Arkell.

el

On 2014-05-03, 07:11 , Bert Gunter wrote:
> By making the effort to learn R?
> 
> See e.g. the "Introduction to R" tutorial that ships with R.
> 
> -- Bert
> 
> Bert Gunter
> Genentech Nonclinical Biostatistics
> (650) 467-7374
> 
> "Data is not information. Information is not knowledge. And knowledge
> is certainly not wisdom."
> H. Gilbert Welch
> 
> 
> 
> 
> On Fri, May 2, 2014 at 2:23 PM, Dr Eberhard Lisse  wrote:
>> Hi,
>>
>> How do I do something like this without using sqldf?
>>
>> a <- sqldf("SELECT COUNT(*) FROM b WHERE c = 'd'")
>>
>> or
>>
>> e <- sqldf("SELECT f, COUNT(*) FROM b GROUP BY f ORDER BY f")
>>
>> greetings, el
>>
>> __
>> R-help@r-project.org mailing list
>> 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
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] PostgreSQL under Snow Leopard

2010-02-21 Thread Dr Eberhard W Lisse
Thank you, last post 2007.

el

On 2010-02-21 22:05 , David Winsemius wrote:
>

> You should check the R-Mac-SIG archives:
> 
> http://dir.gmane.org/gmane.comp.lang.r.mac
> 
> http://markmail.org/browse/org.r-project.r-sig-mac
> 
> And if not found, then post on that list.
> 
> David.

__
R-help@r-project.org mailing list
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] PostgreSQL under Snow Leopard

2010-02-21 Thread Dr Eberhard W Lisse
Hi,

I have nicely used RdbiPgSQL under 10.5 but now that I run 10.6
I can't get this to work.

I am quite sure I will not be the first to have this problem, so
can someone please point me somewhere where this has been described
or let me have a cookbook?

greetings, el

__
R-help@r-project.org mailing list
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] Sweave documents have corrupted double quotes

2009-01-17 Thread Dr Eberhard W Lisse

This is not a bug.

If you use a font that doesn't have a character which you want to use
it's an inconvenience :-)-O

el

On 18 Jan 2009, at 00:16 , Peter Dalgaard wrote:


Peter Dalgaard wrote:

Paul Johnson wrote:

Hey, everybody.

I am concluding that this Sweave wrecks quotation marks in  
typewriter

font is a bug in Sweave.


__
R-help@r-project.org mailing list
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] AT&T Researchers and the New York Times

2009-01-09 Thread Dr Eberhard W Lisse

No problem, easy peasy, just hack it together and put all the old
archives on so the subscribers can vote.

greetings, el

On 09 Jan 2009, at 14:45 , Roland Studer wrote:


I agree, that there are better plattforms.
I'd love to see something like Stack Overflow:
http://stackoverflow.com/

When you type your question, it compares it to previously answered
questions. Answers can get voted up and down. Answers AND questions  
can be

edited!

Regards
 Roland Studer

On Fri, Jan 9, 2009 at 6:58 AM, Dr Eberhard W Lisse   
wrote:



Robert,

go ahead, fix whatever bothers you, this is Open Sauce, not Jet- 
Engine

Science
:-)-O

el

On 09 Jan 2009, at 07:41 , Johannes Huesing wrote:

stephen sefick  [Fri, Jan 09, 2009 at 03:16:11AM  
CET]:



It has worked wonders for me over the last years.



On Thu, Jan 8, 2009 at 8:58 PM, Robert Wilkins >

wrote:


And by the way, ARE YOU GUYS EVER GOING TO FIX your mailing list
platform? It is extremely user-unfriendly and a technological  
clunk.





He possibly means the Web interface to the archive, which I am not
bothered
about since the list is mirrored on Gmane.

--
Johannes Hüsing



__
R-help@r-project.org mailing list
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.




--
http://www.sturmfrei.wordpress.com - Berner Mundartrock
home 031 535 43 40 | mobile 079 746 48 59

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
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.


--
Dr. Eberhard W. Lisse  \/ Obstetrician & Gynaecologist (Saar)
e...@lisse.na el108-ARIN /   *   |   Telephone: +264 81 124 6733 (cell)
PO Box 8421 \ / Please send DNS/NA-NiC related e-mail
Bachbrecht, Namibia ;/ to dns-ad...@na-nic.com.na

__
R-help@r-project.org mailing list
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] shake rattle() and roll

2009-01-08 Thread Dr Eberhard W Lisse

Graham,

nice package this :-)-O.

It was easy to set up MySQL but I struggled immensely to get the stock
ODBC working with PostgreSQL (8.3), which has been discussed on the
mailing list before (Prof Brian):

Warning messages:
1: In odbcDriverConnect(st, ...) :
 [RODBC] ERROR: Could not SQLDriverConnect
2: In odbcDriverConnect(st, ...) : ODBC connection failed

aka (DBD::ODBC in Perl)

Missing server name, port, or database name in call to CC_connect.  
(SQL-IM002)


aka (iodbctest)

SQLDriverConnectW = Unknown connect option (Set) (205) SQLSTATE=S1009

Figured it out, though:

Leopard comes with iODBC installed, and many people install unixODBC  
additionally.
Then then configure /sw/etc/odbc*.ini and unixODBC works, but iODBC  
doesn't.
Even if you symlink the INI files to /Library/ODBC it doesn't work.  
Even if you
remove theunixODBC installation and only use the /Library/ODBC/ 
odbc*.ini files
it doesn't work. Even if you copy libodbcpsql.so and libodbcpsqlS.so  
from
/sw/lib/ to /usr/local/lib/ and then remove unixODBC (through fink) it  
doesn't

work.

However, if you leave the two libs in /usr/local/lib after removel of  
unixODBC
install the libiodbc/libiodbc-shlibs packages from fink, and then  
symlink the

ini files to /sw/etc, it *DOES* work.

Leading me to suspect the version of iODBC that comes with 10.5.5 (and  
earlier)
is broken. Since Google is my friend I know that the CC_connect issue  
is also

prevalent on linux so I reckon it's not Mac specific.

All in all this is extremely cool, because I will have to use a  
firebird database
for my practice management software which doesn't have a direct R  
driver but now
I am confident will be able to use it (with the Read Only option :-)- 
O) to analyse

my ICD and Procedure Codes :-)-O


Three Requests for Features for rattle(): would it not be nice to also  
have direct
PostgreSQL (RdbiPgSQL) and MySQL (RMySQL) support and support for a  
SELECT statement?
In other words, sometimes the database tables directly don't give you  
what you need

and so you have to develop a (convoluted) SQL statement first.

Would be nice if one could ratlle(convolutedSQL) :-)-O

greetings, el
--
Dr. Eberhard W. Lisse   \/  Managing Member, |Ondis (cc)
accou...@ondis.co.na/ * | Telephone: +264 81 124 6733 (cell)
PO Box 98256 \ /Please do NOT send e-mail to e...@lisse.na
Windhoek Namibia ;/   if it is in ANY way DNS/|Ondis related




--
Dr. Eberhard W. Lisse  \/ Obstetrician & Gynaecologist (Saar)
e...@lisse.na el108-ARIN /   *   |   Telephone: +264 81 124 6733 (cell)
PO Box 8421 \ / Please send DNS/NA-NiC related e-mail
Bachbrecht, Namibia ;/ to dns-ad...@na-nic.com.na

__
R-help@r-project.org mailing list
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] AT&T Researchers and the New York Times

2009-01-08 Thread Dr Eberhard W Lisse

Robert,

go ahead, fix whatever bothers you, this is Open Sauce, not Jet-Engine  
Science

:-)-O

el

On 09 Jan 2009, at 07:41 , Johannes Huesing wrote:

stephen sefick  [Fri, Jan 09, 2009 at 03:16:11AM  
CET]:

It has worked wonders for me over the last years.


On Thu, Jan 8, 2009 at 8:58 PM, Robert Wilkins  
 wrote:

And by the way, ARE YOU GUYS EVER GOING TO FIX your mailing list
platform? It is extremely user-unfriendly and a technological clunk.


He possibly means the Web interface to the archive, which I am not  
bothered

about since the list is mirrored on Gmane.

--
Johannes Hüsing


__
R-help@r-project.org mailing list
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] Problem assigning "NA" as a level name in a list

2008-12-16 Thread Dr Eberhard W Lisse
Quite irritating to me as the Manager of .NA too, when I
used NA for .NA :-)-O

el

Peter Dalgaard wrote:
> Cliff Behrens wrote:
>> One of these permutations
>> is the character string "NA".  It seems that when I try to name one of
>> the dataList levels "NA", using names(dataList)<- nameList, the
>> names() function assigns the missing character to the level.  Is there
>> someway to preserve "NA" as the name of a level in dataList?

__
R-help@r-project.org mailing list
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] combining data from different datasets

2008-10-26 Thread Dr Eberhard W Lisse

Yes, it does. Thanks.

el

On 25 Oct 2008, at 03:32 , Steven McKinney wrote:


If you are using regular R graphs
(i.e. not lattice or other library
graphics) try setting the margins
with the mar argument to par()

e.g.
par(mar = c(5, 10, 5, 1))

The four numbers specify the amount
of margin room on the bottom, left, top, right
respectively.  Set the left margin value large
enough to give your labels enough room.


HTH


Steven McKinney


__
R-help@r-project.org mailing list
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] combining data from different datasets

2008-10-24 Thread Dr Eberhard W Lisse

Daniel,

the parameter all.x=TRUE is required.

greetings, el

On 24 Oct 2008, at 21:24 , Daniel Malter wrote:


?merge.

It looks though that your "iso" has no identifier variable whereas the
"rawdata" has, so you probably cannot merge it unless/until you have  
an

identifier in "iso".


__
R-help@r-project.org mailing list
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] combining data from different datasets

2008-10-24 Thread Dr Eberhard W Lisse

It's Complicated® :-)-O

I pull the data from a postgresql table, but I am getting
there, thank you the help.

Another question, I am barplotting the continents horizontally,
ie the more participants the lrger the bars are. I have managed
the make the labels (names of the nontinents) to be horizontally
but the longer ones (North and South America) flow off the left
side (right justified).

So, how do I make the plot smaller, and move it to the right so
that the complete names appear? I can make the plot smaller in
inches but that doesn't scale if I enlarge the window.

Pointers to read will be fine, but so far I haven't found it :-)-O

el

On 24 Oct 2008, at 18:24 , Gabor Grothendieck wrote:

On Fri, Oct 24, 2008 at 11:37 AM, Dr Eberhard W Lisse <[EMAIL PROTECTED]>  
wrote:


This looks very cool.

But I must still make a plan with regards to country = "NA" (Namibia)
or continent = "NA" (North America)

But there are the vignettes.

el



NA and "NA" are not the same:


DF <- data.frame(x = c("a", "NA", NA))
DF

    x
1a
2   NA
3 


is.na(NA)

[1] TRUE

is.na("NA")

[1] FALSE



--
Dr. Eberhard W. Lisse  \/ Obstetrician & Gynaecologist (Saar)
[EMAIL PROTECTED] el108-ARIN /   *   |   Telephone: +264 81 124 6733 (cell)
PO Box 8421 \ / Please send DNS/NA-NiC related e-mail
Bachbrecht, Namibia ;/ to [EMAIL PROTECTED]

__
R-help@r-project.org mailing list
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] combining data from different datasets

2008-10-24 Thread Dr Eberhard W Lisse

Gabor,

Thank you,

On 24 Oct 2008, at 17:16 , Gabor Grothendieck wrote:


Here are two solutions.  The first uses the R merge command
and the second uses the R sqldf package.  See ?merge
and http://sqldf.googlecode.com
Note that alter is an sql keyword so I have changed it
to alt for the second example:


merge(iso, rawdata)[c("alt", "sex", "country")]

 alter sex country
1NA   M Andorra
239   F Namibia


merge(rawdata, iso, by.x = "cctld", by.y = "code", all.x = TRUE)
[c("alter","sex", "cctld", "country")]

all.x = TRUE even pulls the cases with missing values




library(sqldf)


sqldf("select alt, sex, country from iso join rawdata  
using(country)")

 alt sex country
1  NA   M Andorra
2  39   F Namibia


This looks very cool.

But I must still make a plan with regards to country = "NA" (Namibia)
or continent = "NA" (North America)

But there are the vignettes.

el

__
R-help@r-project.org mailing list
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] combining data from different datasets

2008-10-24 Thread Dr Eberhard W Lisse

Hi,

I have two tables:


> iso
continent code code3 codenum  country
1  EU   AD   AND  20 Andorra, Principality of
2  AS   AE   ARE 784 United Arab Emirates
3  AS   AF   AFG   4 Afghanistan, Islamic Republic of
4  NA   AG   ATG  28  Antigua and Barbuda
5  NA   AI   AIA 660 Anguilla
159AF   NA   NAM 516 Namibia, Republic of
...
246AF   ZW   ZWE 716Zimbabwe, Republic of



and

> rawdata
   idno alter  sex cctld capacity topics content speakers
1 1NAMADA  2   12
2 252M  A  3   22
3 339FNAT  2   22
...

How do I make it print out something like

alter   sex country
1   NA  M   Andorra, Principality of
2   39  F   Namibia, Republic of
...

in other words do something like the following SQL:

SELECT r.alter, r.sex, i.country
FROM iso i, rawdata r
WHERE i.code = r.cctld

or even better:

alter   sex country
1   NA  M   Andorra, Principality of
2   52  M   
3   39  F   Namibia
...

And idea (where I can read up on this)?


el
--
Dr. Eberhard W. Lisse  \/ Obstetrician & Gynaecologist (Saar)
[EMAIL PROTECTED] el108-ARIN /   *   |   Telephone: +264 81 124 6733 (cell)
PO Box 8421 \ / Please send DNS/NA-NiC related e-mail
Bachbrecht, Namibia ;/ to [EMAIL PROTECTED]

__
R-help@r-project.org mailing list
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] GPG key not found

2008-10-22 Thread Dr Eberhard W Lisse

subkeys.pgp.net has 6 IP addresses, but all of them seem to
have the key now.

el


On 22 Oct 2008, at 17:05 , Martyn Plummer wrote:


Have you tried other keys? (mine is 97D3544E if you want to try).
If nothing works then it is probably a firewall problem.  Ask your
network administrator if port 11371 is blocked.

When I had this problem, neither "gpg --recv-keys" nor the web  
interface

at wwwkeys.pgp.net worked for me.

Martyn

On Wed, 2008-10-22 at 16:31 +0200, Renaud Gaujoux wrote:

Hi,

well... that is what I would like to see indeed. :(


But I keep getting my error, what's bothering me is that the web- 
based

tools also does not find the key...
Did you also try on http://keyserver.noreply.org/?

thanks


Dr Eberhard Lisse wrote:

gpg: requesting key E2A11821 from hkp server subkeys.pgp.net
gpg: key E2A11821: public key "Vincent Goulet
<[EMAIL PROTECTED]>" imported
gpg: no ultimately trusted keys found
gpg: Total number processed: 1
gpg:   imported: 1


on 10/22/08 3:42 PM Renaud Gaujoux said the following:


Hi,
I tried to install R 2.8 on Ubuntu Hardy via the Ubuntu mirroed  
repository.

I tried to import the GPG key with:

gpg --keyserver subkeys.pgp.net --recv-key E2A11821

but get the following error:

gpg: requesting key E2A11821 from hkp server subkeys.pgp.net
gpgkeys: key E2A11821 not found on keyserver
gpg: no valid OpenPGP data found.
gpg: Total number processed: 0

I also tried on http://keyserver.noreply.org/ as recommended, but  
no key

is found either...

Anybody else gets the error?


Thanks

__
R-help@r-project.org mailing list
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
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.


---
This message and its attachments are strictly confiden...{{dropped:17}}


__
R-help@r-project.org mailing list
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] Staging area for data before read into R

2008-10-21 Thread Dr Eberhard W Lisse

I fully agree, with important or large data sets you can not be
paranoid enough.

linux and the mac allow you to easily write scripts that handle
dumping, zipping, copying (locally and elsewhere) and verifying
the data. Once written correctly and tested they can run fully
automatic with cron. Been doing this for 15 years.


And where you are advised to burn 2 DVDs, burn 5 each. Read the data
on at least two different hardwares and operating systems.  Send at
least one of each by courier to a collaborating colleague on a
different continent.

As they say, different hard disk, differenr power supply, different
earthquake :-)-O

el

On 21 Oct 2008, at 21:18 , Ted Byers wrote:





[...]



Dr. Snow is right in recommending going the route of
using an RDBMS and in saying that it isn't that hard to get  
started.  I'd be
recommending PostgreSQL, though, since it is relatively easy to use,  
and it
has pl/r (which lets you run R code within stored procedures in the  
DB)

which carries obvious advantages.


[...]

If I were in his place, I'd say my data is sacred, and can not be  
replaced
(just as you can't step into the same stream twice); and therefore  
I'd use a
RDBMS to manage it, and the very moment it is all entered, I'd make  
a backup
of both the data (e.g. in MySQL I'd use mysqldump) AND the software,  
and
copy both backups to two CDs or DVDs.  And, if the data were  
originally
recorded on paper, I'd be scanning the pages and copying those  
images onto a
couple CDs or DVDs also: with two copies on optical media, one copy  
can be
stored in a fireproof vault while the other is in the office ready  
to be
used should a HDD fail, or some other disaster interrupt my work.   
OK, so

I'm paranoid about my data, but I'd rather go the extra mile than risk
losing it.





--
Dr. Eberhard W. Lisse  \/ Obstetrician & Gynaecologist (Saar)
[EMAIL PROTECTED] el108-ARIN /   *   |   Telephone: +264 81 124 6733 (cell)
PO Box 8421 \ / Please send DNS/NA-NiC related e-mail
Bachbrecht, Namibia ;/ to [EMAIL PROTECTED]

__
R-help@r-project.org mailing list
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] Copyright Symbol

2008-10-12 Thread Dr Eberhard W Lisse

Brian,

I use:

R version 2.7.2 (2008-08-25)
i386-apple-darwin8.11.1

locale:
C

attached base packages:
[1] stats graphics  grDevices utils datasets  methods   base

other attached packages:
[1] plotrix_2.4-7RdbiPgSQL_1.14.0 Rdbi_1.14.0


I didn't think of it as a Mac specific issue, because I want to run
the script on all sorts of setups, Mac, Windows, Linux, GUI and X.


But, in any case, thank you for the advice, the symbols work.

greetings, el

On 12 Oct 2008, at 00:32 , Prof Brian Ripley wrote:

What OS, what graphics device, what locale, what version of R?  (As  
asked for in the posting guide.)


In many cases you can just use "\uA9" as part of text to be plotted.

There is two copyright symbols in Adobe Symbol, so you can probably  
use
symbol("\323") and symbol("\343") in plotmath if you don't have the  
symbol in your usual character set.


On Sat, 11 Oct 2008, Dr Eberhard W Lisse wrote:


How do I put a copyright symbol (C) (or ©) into a plot?

title/sub or legend.

And/or somewhere to the bottom right of the image.

greetings, el

__
R-help@r-project.org mailing list
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.


Yes. that does mean YOU!

--
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UK        Fax:  +44 1865 272595


--
Dr. Eberhard W. Lisse  \/ Obstetrician & Gynaecologist (Saar)
[EMAIL PROTECTED] el108-ARIN /   *   |   Telephone: +264 81 124 6733 (cell)
PO Box 8421 \ / Please send DNS/NA-NiC related e-mail
Bachbrecht, Namibia ;/ to [EMAIL PROTECTED]

__
R-help@r-project.org mailing list
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] Copyright Symbol

2008-10-11 Thread Dr Eberhard W Lisse

How do I put a copyright symbol (C) (or ©) into a plot?

title/sub or legend.

And/or somewhere to the bottom right of the image.

greetings, el

__
R-help@r-project.org mailing list
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] Sexy Little Number :-)-O

2008-10-05 Thread Dr Eberhard W Lisse

Got me the Asus EEE PC 1000 (the one with the 8 and 32 GIG solid state
drives, and added a 4GiG SD for the swap space. Will add another Gig
of RAM for a total of 2). Threw the old (Xandros) Linux off and the
EEE specific Ubuntu 8.04.1 onto it. Got an atom Intel processor which
apparently has two cores. Quite impressive...

Does anyone know, off hand, how I set up the CRAN repository so it
updates from the latest packages (2.7.2)?

What happenend to the South African mirror by the way?

greetings, el
--
Dr. Eberhard W. Lisse  \/ Obstetrician & Gynaecologist (Saar)
[EMAIL PROTECTED] el108-ARIN /   *   |   Telephone: +264 81 124 6733 (cell)
PO Box 8421 \ / Please send DNS/NA-NiC related e-mail
Bachbrecht, Namibia ;/ to [EMAIL PROTECTED]

__
R-help@r-project.org mailing list
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] "Update in Mac OS"

2008-10-05 Thread Dr Eberhard W Lisse

Load the 2.7.2 mini DMBG and install over the top. Finish and klaar.

el

On 05 Oct 2008, at 11:28 , Fredrik Lundgren wrote:


Dear R-ers,

I'm using R 2.7.1 Mac OS. What is the best way for update
to 2.7.2 to keep my previous libraries?

Fredrik



--
Dr. Eberhard W. Lisse  \/ Obstetrician & Gynaecologist (Saar)
[EMAIL PROTECTED] el108-ARIN /   *   |   Telephone: +264 81 124 6733 (cell)
PO Box 8421 \ / Please send DNS/NA-NiC related e-mail
Bachbrecht, Namibia ;/ to [EMAIL PROTECTED]

__
R-help@r-project.org mailing list
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] Interbase/Firebird

2008-09-17 Thread Dr Eberhard W Lisse

ODBC,

didn't think of that, thanks.

el

On 18 Sep 2008, at 00:31 , David Winsemius wrote:



On Sep 17, 2008, at 6:00 PM, Dr Eberhard W Lisse wrote:


Hi,

is there a Rdbi or other package to use firebird in R?

I am reviewing options for my Practice software and might have
to switch to a firebird based package so I would of course like
to be able to do some stats in R.



Per Prof Ripley:

http://tolstoy.newcastle.edu.au/R/help/04/10/6358.html

--
David Winsemius



__
R-help@r-project.org mailing list
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] Interbase/Firebird

2008-09-17 Thread Dr Eberhard W Lisse

Hi,

is there a Rdbi or other package to use firebird in R?

I am reviewing options for my Practice software and might have
to switch to a firebird based package so I would of course like
to be able to do some stats in R.

greetings, el

__
R-help@r-project.org mailing list
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] Power PC with a linux distribution and R

2008-09-12 Thread Dr Eberhard W Lisse

Adam,

I (or rather the kids and the wife) got two iMinis and one iBook
with G4. They all run 10.5.4 happily on their 1GB of RAM...

greetings, el

On 12 Sep 2008, at 23:43 , Adam D. I. Kramer wrote:

To Stephen's credit, Apple will no longer support PowerPC chips  
(such as his
G4) in the next operating system (Snow Leopard), so some sort of  
switchover

will be necessary in order to maintain SOME sort of state-of-the-art
software packaging for PPC-based Mac users in the near future.

Also, it is important to note that Leopard on a G4 iBook would  
probably run
disgustingly (read: unusably) slow unless the memory is upgraded: It  
shipped
with 256MB of RAM (and that money would be better saved for a new  
computer),

and Leopard (on my Macbook Pro) is currently using about 700MB for the
operating system. Switching to linux and X-windows allows for an old  
system

to be, in a word, functional.


__
R-help@r-project.org mailing list
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] Power PC with a linux distribution and R

2008-09-12 Thread Dr Eberhard W Lisse

Yes, of course.

That's why the :-)-O was there

el

On 12 Sep 2008, at 23:01 , Doran, Harold wrote:


Are you aware that a BSD unix OS runs on the mac already?


__
R-help@r-project.org mailing list
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] Power PC with a linux distribution and R

2008-09-12 Thread Dr Eberhard W Lisse

Yes,

I'd install the OS X Leopard (10.5.4) distribution on it :-)-O

el

On 12 Sep 2008, at 22:30 , stephen sefick wrote:


This is an operating system question, but it is with the intent of
using R on that operating system.  I have an ibook G4 Power PC that I
am going to install linux on.  Is there a better, worse, or perhaps
easier (I am a linux newby migrating from mac) distribution that I
should look at.  I appreciate your help.  I didn't post this in the
sig-mac because I don't know if it fits there better than anywhere
else.
thanks

--
Stephen Sefick


__
R-help@r-project.org mailing list
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] Problemas con JRI

2008-09-11 Thread Dr Eberhard W Lisse

Kann man das vielleicht mal auf Englisch fragen?

mfg, el

On 11 Sep 2008, at 23:42 , Ángel Orosa Rodríguez wrote:


Hola, me llamo Ángel y estoy haciendo una aplicación en Java que usa
funciones ya implementadas en R, siento molestarte para esta  
tontería, pero
es que ya ni paso de la instalación del JRI. A ver si me puedes  
ayudar, te

lo agradecería muchísimo!!

A ver, yo leí en la página de JRI que hacen falta las mismas  
herramientas
que para R, MINGc y el conjunto de herramientas de /bin (/bin  
toolset),
vale, pues el programa ya lo he bajado e instalado, pero la verdad  
es que no
me ha aparecido nada, ni siquiera un ejecutable; por otra parte no  
sé qué es
el /bin toolset. Esas son mis dos dudas, jeje, que son pocas pero  
grandes,

si sacas tiempo para contestarme, te lo agradecería.

Un saludo.


--
Ángel Orosa Rodríguez

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list
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
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] RSiteSearch for words ``as one entity''.

2008-09-11 Thread Dr Eberhard W Lisse




Brian,

open will call whatever program is defined for a certain extension.  
You can
set this with a plug in to System Preferences called Default Apps for  
example.


So on my Mac(s) Firefox is the default.

el


On 11 Sep 2008, at 08:33 , Prof Brian Ripley wrote:

If firefox is involved on a Mac, that is one difference.  My Mac is  
using 'open' (the default, I believe) and that is calling Safari  
(the default, I believe).


Yes, it would be the job of browseURL to encode URLs where  
required.  But at least on Windows and using the -remoteURL  
mechanism (as on Linux) it is not.  R itself does have URLencode.


On Thu, 11 Sep 2008, Rolf Turner wrote:



On 11/09/2008, at 10:09 AM, Marc Schwartz wrote:




As Prof. Ripley noted, try using debug(RSiteSearch) and then step
through the code to see where $HOME is being added to the URL  
variable.
That can help pin it down further. If the URL is not corrupted by  
the
time browseURL() is called, then use debug(browseURL) to trace  
within

that function to see if something is happening there.




__
R-help@r-project.org mailing list
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] Compiling date

2008-09-09 Thread Dr Eberhard W Lisse

Is this Month-Day or Day-Month or a mixture of both?

I still think using the Format -> Cell -> Date will work
much better...

el


On 09 Sep 2008, at 11:21 , David Scott wrote:


On Mon, 8 Sep 2008, Megh Dal wrote:


Hi,

I have following kind of dataset (all are dates) in my Excel sheet.

09/08/08
09/05/08
09/04/08
09/02/08
09/01/08
29/08/2008
28/08/2008
27/08/2008
26/08/2008
25/08/2008
22/08/2008
21/08/2008
20/08/2008
18/08/2008
14/08/2008
13/08/2008
08/12/08
08/11/08
08/08/08
08/07/08

However I want to use R to compile those data to make all dates in  
same format. Can anyone please tell me any automated way for doing  
that?




Well you have to read them in as character first. Then use sub to  
make the two digit years into four digits. The following could  
probably be improved by a regular expression whiz, but works:



strngs <- c("06/05/08","23/11/2008")
sub("([0-9][0-9]/[0-9][0-9]/)([0-9][0-9]$)","\\120\\2",strngs)

[1] "06/05/2008" "23/11/2008"


David Scott


__
R-help@r-project.org mailing list
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] ON MAC, how to copy a plot on to Word document?

2008-09-07 Thread Dr Eberhard W Lisse

I just CMD-C'd it and pasted it into OpenOffice with CMD-V.

el

On 07 Sep 2008, at 16:57 , John Kane wrote:

I think you need to save the plot and import it into Word.  AFAIK  
you can only copy and paste a plot in Windows.


Have a look at ?png  (There are other formats available)


__
R-help@r-project.org mailing list
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] (with subject)

2008-09-05 Thread Dr Eberhard W Lisse

Oh, YES, thank you!

This weekend I'll try and figure out how to plot these events on
a 24 hour scale, i.e I'll aggregate the SQL query on the time
But not on the date) to see how many of those fall outside of
normal working hours :-)-O

greetings, el

On 05 Sep 2008, at 00:59 , Gabor Grothendieck wrote:


I assume the problem is that you want the axis to have all 12
months but your data is much shorter.  Try this:

mos <- seq(as.Date("2008-01-01"), length = 12, by = "month")
plot(range(mos), range(rawData$y), type = "n", xaxt = "n")
lines(rawData$Date, rawData$y)
axis(1, mos, month.abb)


__
R-help@r-project.org mailing list
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] (with subject)

2008-09-04 Thread Dr Eberhard W Lisse

Dirk, Gabor,

thanks for your advice, I have now tried to study these
vignettes, but I must say, as an aging Gynecologist,
I am facing an enormous learning curve :-)-O.

This works nicely:

rawData <- data.frame(x = c("2008-03-01", "2008-03-21", "2008-03-23",  
"2008-04-08", "2008-04-20", "2008-05-10", "2008-06-20"), y = c(4, 6,  
8, 5, 7, 2 ,1))

rawData[,"x"] <- as.Date(rawData[,"x"])
with(rawData, plot(x, y, main="Some text", type='l'))

How do I make the X-Axis start on 2008-01-01, end on 2008-12-31,
with tick marks for every month (ie month.abb[1:12] or something
similar)?

A pointer is enough, weekend is coming up and I am off :-)-O

I also need to add 2 lines statements, but I reckon I can figure that  
out

by myself :-)-O


greetings, el
--
Dr. Eberhard W. Lisse  \/ Obstetrician & Gynaecologist (Saar)
[EMAIL PROTECTED] el108-ARIN /   *   |   Telephone: +264 81 124 6733 (cell)
PO Box 8421 \ / Please send DNS/NA-NiC related e-mail
Bachbrecht, Namibia ;/ to [EMAIL PROTECTED]

__
R-help@r-project.org mailing list
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] (no subject)

2008-09-03 Thread Dr Eberhard W Lisse

Hi,

I am getting accumulated data from PostgreSQL, ie for every day in
which a condition is true I get the number (count) of cases. Starting
date is 2008-01-01 and end day the last day for which the condition
is true (which is not necessarily today).

I obviously do not get records (dates) with count = 0, in other words
this is not a complete list of every day since 2008-01-01.

Now I want I plot this, with the sum on the Y axis and the months
on the X axis, preferably as a line drawing.

Any ideas?

el
--
Dr. Eberhard W. Lisse  \/ Obstetrician & Gynaecologist (Saar)
[EMAIL PROTECTED] el108-ARIN /   *   |   Telephone: +264 81 124 6733 (cell)
PO Box 8421 \ / Please send DNS/NA-NiC related e-mail
Bachbrecht, Namibia ;/ to [EMAIL PROTECTED]

__
R-help@r-project.org mailing list
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.