Re: [R] Package renv and Rscript

2020-04-14 Thread Ben Tupper
Hi,

Ah, of course - the wrapper would be a shell wrapper not an R wrapper ...

###
#!/bin/sh
cd /path/to/project
Rscript /path/to/script.R /path/to/config_file
###

Thanks so much!
Ben

On Tue, Apr 14, 2020 at 2:13 PM Thierry Onkelinx 
wrote:

> Dear Ben,
>
> I think that you first need to go to your project and then start Rscript
> from that location. renv() needs to pick up the .Renviron file located at
> the root of your project.
>
> Best regards,
>
> ir. Thierry Onkelinx
> Statisticus / Statistician
>
> Vlaamse Overheid / Government of Flanders
> INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND
> FOREST
> Team Biometrie & Kwaliteitszorg / Team Biometrics & Quality Assurance
> thierry.onkel...@inbo.be
> Havenlaan 88 bus 73, 1000 Brussel
> www.inbo.be
>
>
> ///
> To call in the statistician after the experiment is done may be no more
> than asking him to perform a post-mortem examination: he may be able to say
> what the experiment died of. ~ Sir Ronald Aylmer Fisher
> The plural of anecdote is not data. ~ Roger Brinner
> The combination of some data and an aching desire for an answer does not
> ensure that a reasonable answer can be extracted from a given body of data.
> ~ John Tukey
>
> ///
>
> 
>
>
> Op di 14 apr. 2020 om 19:53 schreef Ben Tupper :
>
>> Whoops!  The silly "send" button jumped out and grabbed my cursor before I
>> was ready for it.  Second try...
>>
>> I am using renv (https://rstudio.github.io/renv/) to maintain a project
>> environment in a directory (ala '/path/to/project').
>>
>> Within the project I have a number of scripts that I call with one
>> argument
>> using...
>>
>> $ Rscript /path/to/script.R /path/to/config_file
>>
>> I can kick this off successfully with the renv environment when I manually
>> start Rscript within the project directory. Now I would like to be able to
>> hand the script kick-off to either crontab or the PBS queueing system.
>> But
>> I haven't figured out how to get the instance of R that is kicked off to
>> do
>> so using the renv project space (i.e. using the R libraries as established
>> in the project.)
>>
>> At first I thought I would call a simple wrapper script such that accepted
>> two arguments '/path/to/script.R' and '/path/to/config_file'. I planned to
>> use ...
>>
>> ###
>> args <- commandArgs(trailingOnly = TRUE)
>> path_to_script <- args[1]
>> path_to_config <- args[2]
>> renv::run(path_to_script,
>>   project = '/path/to/project')
>> ###
>>
>> Unfortunately renv::run() doesn't provide a vehicle for passing other
>> script arguments along.  So, in this case, there's no way to communicate
>> the configuration file to the script.
>>
>> Is there a recommended way to call Rscript such that the renv environment
>> gets picked up?
>>
>> Thanks!
>> Ben
>>
>>
>> On Tue, Apr 14, 2020 at 1:41 PM Ben Tupper  wrote:
>>
>> > Hi,
>> >
>> > I am using renv (https://rstudio.github.io/renv/) to maintain a project
>> > environment in a directory (ala /path/to/project)
>> >
>> >
>> > Within the project I have a number of scripts that I call using...
>> >
>> > $ Rscript /path/to/script.R /path/to/config_file
>> >
>> > I can kick this off successfully with the renv environment when I
>> manually
>> > start Rscript within the project directory. Now I would like to be able
>> to
>> > hand the script kick off to either crontab or the PBS queueing system.
>> >
>> > At first I thought I would actually call a wrapper script such that
>> > accepted two arguments '/path/to/script.R' and '/path/to/config_file'. I
>> > planned to use
>> >
>> > renv::run('/path/to/script.R',
>> >
>> >
>> > --
>> > Ben Tupper
>> > Bigelow Laboratory for Ocean Science
>> > East Boothbay, Maine
>> > http://www.bigelow.org/
>> > https://eco.bigelow.org
>> >
>> >
>>
>> --
>> Ben Tupper
>> Bigelow Laboratory for Ocean Science
>> East Boothbay, Maine
>> http://www.bigelow.org/
>> https://eco.bigelow.org
>>
>> [[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.
>>
>

-- 
Ben Tupper
Bigelow Laboratory for Ocean Science
East Boothbay, Maine
http://www.bigelow.org/
https://eco.bigelow.org

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Span for loess regression

2020-04-14 Thread varin sacha via R-help
Dear R-experts,

I am trying to find the best span for my loess regression. Here below a 
reproducible example. I don't get the result. Am I missing something ?

Many thanks for your help.


a<-c(2,3,4,3,2,6,5,7,4,5,12,13,21,6,4,5,6,7)
b<-c(12,13,32,14,23,21,76,34,12,32,43,23,12,32,43,12,32,11)
model <- loess(b ~ a)
bestLoess <- function(model, spans = c(.05, .95)) {
 f <- function(span) {
 mod <- update(model, span = span)
 loessGCV(mod)[["gcv"]]
 }
 result <- optimize(f, spans)
 result
 }
###

__
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-es] desagregar distribución de frecuencias

2020-04-14 Thread Carlos Ortega
Hola,

Sí, esta es una forma...


> dat_freq <- data.frame(
+   val = c(8, 8.5, 9, 10, 10.5, 11, 11.5),
+   freq = c(1, 3, 5, 7, 4, 2, 1)
+ )
>
> rep(dat_freq$val, dat_freq$freq)
 [1]  8.0  8.5  8.5  8.5  9.0  9.0  9.0  9.0  9.0 10.0 10.0 10.0 10.0 10.0
10.0 10.0 10.5 10.5 10.5 10.5 11.0
[22] 11.0 11.5

Gracias,
Carlos Ortega
www.qualityexcellence.es




El mar., 14 abr. 2020 a las 21:40, ANA VENTERO MARTIN ()
escribió:

> Hola a tod@s,
> Trabajo con datos de abundancia (número de individuos) por tallas
> (medidas al medio centímetro inferior) de diferentes especies de peces
> y mis datos base son el número medido de peces por talla. Necesitaría
> vuestra ayuda para transformar las distribuciones de frecuencias de
> talla a los datos brutos que las generaían.
> Es decir, pasar de algo como esto
> 8   1
> 8.53
> 9  5
> 107
> 10.5 4
> 112
> 11.5 1
> A esto
> 8
> 8.5
> 8.5
> 8.5
> 9
> 9
> 9
> 9
> 9
> 10
> 10
> 10
> 10
> 10
> 10
> 10
> 10.5
> 10.5
> 10.5
> 10.5
> 11
> 11
> 11.5
> Gracias de antemano y mucho ánimo para estos tiempos inciertos que vivimos.
> Ana
>
> [[alternative HTML version deleted]]
>
> ___
> R-help-es mailing list
> R-help-es@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-help-es
>


-- 
Saludos,
Carlos Ortega
www.qualityexcellence.es

[[alternative HTML version deleted]]

___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es


[R-es] desagregar distribución de frecuencias

2020-04-14 Thread ANA VENTERO MARTIN
Hola a tod@s,
Trabajo con datos de abundancia (número de individuos) por tallas  
(medidas al medio centímetro inferior) de diferentes especies de peces  
y mis datos base son el número medido de peces por talla. Necesitaría  
vuestra ayuda para transformar las distribuciones de frecuencias de  
talla a los datos brutos que las generaían.
Es decir, pasar de algo como esto
8           1
8.5        3
9          5
10        7
10.5     4
11        2
11.5     1
A esto
8
8.5
8.5
8.5
9
9
9
9
9
10
10
10
10
10
10
10
10.5
10.5
10.5
10.5
11
11
11.5
Gracias de antemano y mucho ánimo para estos tiempos inciertos que vivimos.
Ana

[[alternative HTML version deleted]]

___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es


Re: [R] Difference in offset values in R and STATA

2020-04-14 Thread Patrick (Malone Quantitative)
Also, is the default base for "log" the same in both programs?


On Tue, Apr 14, 2020 at 3:36 PM Sorkin, John  wrote:
>
> Your question is unlikely to be answered unless you post code demonstrating 
> the problem
> J
>
> John David Sorkin M.D., Ph.D.
> Professor of Medicine
> Chief, Biostatistics and Informatics
> University of Maryland School of Medicine Division of Gerontology and 
> Geriatric Medicine
> Baltimore VA Medical Center
> 10 North Greene Street
> GRECC (BT/18/GR)
> Baltimore, MD 21201-1524
> (Phone) 410-605-7119
> (Fax) 410-605-7913 (Please call phone number above prior to 
> faxing)
>
> On Apr 14, 2020, at 3:23 PM, Haddison Mureithi  
> wrote:
>
> Hae guys,
> When performing a poisson regression sometimes one has to input the
> offset/exposure variable to account for individual time spent in a certain
> therapy before acquiring a certain condition of interest, whereby in r
> offset(log(months)) and in STATA offset(log(months)) results differ.
> Thereby increasing the difference of the overall outcome, i don't know why
> any one know why?
>
>[[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-helpdata=02%7C01%7C%7Cb386607c67fa45f5ac3508d7e0a923cc%7C717009a620de461a88940312a395cac9%7C0%7C0%7C637224889939614430sdata=VsicWcmiBw162nLk6CZGKx5pKW4SbBliXeYY%2BLYu90Q%3Dreserved=0
> PLEASE do read the posting guide 
> https://nam03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.r-project.org%2Fposting-guide.htmldata=02%7C01%7C%7Cb386607c67fa45f5ac3508d7e0a923cc%7C717009a620de461a88940312a395cac9%7C0%7C0%7C637224889939614430sdata=D4wrhP70NpBLjcE8Yd9JZCIykwqf4dDTla4Zkyk%2FQ5Q%3Dreserved=0
> 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.



-- 
Patrick S. Malone, Ph.D., Malone Quantitative
NEW Service Models: http://malonequantitative.com

He/Him/His

__
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] Difference in offset values in R and STATA

2020-04-14 Thread Sorkin, John
Your question is unlikely to be answered unless you post code demonstrating the 
problem
J

John David Sorkin M.D., Ph.D.
Professor of Medicine
Chief, Biostatistics and Informatics
University of Maryland School of Medicine Division of Gerontology and Geriatric 
Medicine
Baltimore VA Medical Center
10 North Greene Street
GRECC (BT/18/GR)
Baltimore, MD 21201-1524
(Phone) 410-605-7119
(Fax) 410-605-7913 (Please call phone number above prior to 
faxing)

On Apr 14, 2020, at 3:23 PM, Haddison Mureithi  
wrote:

Hae guys,
When performing a poisson regression sometimes one has to input the
offset/exposure variable to account for individual time spent in a certain
therapy before acquiring a certain condition of interest, whereby in r
offset(log(months)) and in STATA offset(log(months)) results differ.
Thereby increasing the difference of the overall outcome, i don't know why
any one know why?

   [[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fstat.ethz.ch%2Fmailman%2Flistinfo%2Fr-helpdata=02%7C01%7C%7Cb386607c67fa45f5ac3508d7e0a923cc%7C717009a620de461a88940312a395cac9%7C0%7C0%7C637224889939614430sdata=VsicWcmiBw162nLk6CZGKx5pKW4SbBliXeYY%2BLYu90Q%3Dreserved=0
PLEASE do read the posting guide 
https://nam03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.r-project.org%2Fposting-guide.htmldata=02%7C01%7C%7Cb386607c67fa45f5ac3508d7e0a923cc%7C717009a620de461a88940312a395cac9%7C0%7C0%7C637224889939614430sdata=D4wrhP70NpBLjcE8Yd9JZCIykwqf4dDTla4Zkyk%2FQ5Q%3Dreserved=0
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.


[R] Difference in offset values in R and STATA

2020-04-14 Thread Haddison Mureithi
Hae guys,
When performing a poisson regression sometimes one has to input the
offset/exposure variable to account for individual time spent in a certain
therapy before acquiring a certain condition of interest, whereby in r
offset(log(months)) and in STATA offset(log(months)) results differ.
Thereby increasing the difference of the overall outcome, i don't know why
any one know why?

[[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-es] (sin asunto)

2020-04-14 Thread Carlos Ortega
Hola Manuel,

Prueba a forzar la salida del gráfico de ggplot con "print(pyt)".

Gracias,
Carlos Ortega
www.qualityexcellence.es

El mar., 14 abr. 2020 a las 19:49, Manuel Mendoza (<
mmend...@fulbrightmail.org>) escribió:

> Hola de nuevo, hago un mapa con ggplot:
>
> pyt<-ggplot(data, aes(x = longitud, y = latitud)) +
> geom_point(aes(color = factor(ptyrup)))
> windows();pyt
>
> y después hago un loop con for. En vez de  print(i), que me indica por
> dónde va el loop,  me gustaría que me fuera añadiendo una línea vertical al
> mapa en la longitud que corresponde a i. Con plot () es muy fácil:
> abline(v=i), pero con ggplot, no me añade la línea, y si hago un nuevo mapa
> con la nueva línea, me borra la anterior.
>
> Creía haberlo solucionado incluyendo en el loop:
>
>   pyt <- pyt+
>   geom_vline(xintercept = i)
>   pyt
>
> Pero tampoco funciona. Es extraño, pues sale bien si hago yo las
> iteraciones, una a una, pero cuando hago el loop no dibuja las líneas.
>
> Gracias, una vez más,
> Manuel
>
>
>
> Muchas gracias, como siempre.
>
> [[alternative HTML version deleted]]
>
> ___
> R-help-es mailing list
> R-help-es@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-help-es
>


-- 
Saludos,
Carlos Ortega
www.qualityexcellence.es

[[alternative HTML version deleted]]

___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es


Re: [R] Package renv and Rscript

2020-04-14 Thread Thierry Onkelinx via R-help
Dear Ben,

I think that you first need to go to your project and then start Rscript
from that location. renv() needs to pick up the .Renviron file located at
the root of your project.

Best regards,

ir. Thierry Onkelinx
Statisticus / Statistician

Vlaamse Overheid / Government of Flanders
INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND
FOREST
Team Biometrie & Kwaliteitszorg / Team Biometrics & Quality Assurance
thierry.onkel...@inbo.be
Havenlaan 88 bus 73, 1000 Brussel
www.inbo.be

///
To call in the statistician after the experiment is done may be no more
than asking him to perform a post-mortem examination: he may be able to say
what the experiment died of. ~ Sir Ronald Aylmer Fisher
The plural of anecdote is not data. ~ Roger Brinner
The combination of some data and an aching desire for an answer does not
ensure that a reasonable answer can be extracted from a given body of data.
~ John Tukey
///




Op di 14 apr. 2020 om 19:53 schreef Ben Tupper :

> Whoops!  The silly "send" button jumped out and grabbed my cursor before I
> was ready for it.  Second try...
>
> I am using renv (https://rstudio.github.io/renv/) to maintain a project
> environment in a directory (ala '/path/to/project').
>
> Within the project I have a number of scripts that I call with one argument
> using...
>
> $ Rscript /path/to/script.R /path/to/config_file
>
> I can kick this off successfully with the renv environment when I manually
> start Rscript within the project directory. Now I would like to be able to
> hand the script kick-off to either crontab or the PBS queueing system.  But
> I haven't figured out how to get the instance of R that is kicked off to do
> so using the renv project space (i.e. using the R libraries as established
> in the project.)
>
> At first I thought I would call a simple wrapper script such that accepted
> two arguments '/path/to/script.R' and '/path/to/config_file'. I planned to
> use ...
>
> ###
> args <- commandArgs(trailingOnly = TRUE)
> path_to_script <- args[1]
> path_to_config <- args[2]
> renv::run(path_to_script,
>   project = '/path/to/project')
> ###
>
> Unfortunately renv::run() doesn't provide a vehicle for passing other
> script arguments along.  So, in this case, there's no way to communicate
> the configuration file to the script.
>
> Is there a recommended way to call Rscript such that the renv environment
> gets picked up?
>
> Thanks!
> Ben
>
>
> On Tue, Apr 14, 2020 at 1:41 PM Ben Tupper  wrote:
>
> > Hi,
> >
> > I am using renv (https://rstudio.github.io/renv/) to maintain a project
> > environment in a directory (ala /path/to/project)
> >
> >
> > Within the project I have a number of scripts that I call using...
> >
> > $ Rscript /path/to/script.R /path/to/config_file
> >
> > I can kick this off successfully with the renv environment when I
> manually
> > start Rscript within the project directory. Now I would like to be able
> to
> > hand the script kick off to either crontab or the PBS queueing system.
> >
> > At first I thought I would actually call a wrapper script such that
> > accepted two arguments '/path/to/script.R' and '/path/to/config_file'. I
> > planned to use
> >
> > renv::run('/path/to/script.R',
> >
> >
> > --
> > Ben Tupper
> > Bigelow Laboratory for Ocean Science
> > East Boothbay, Maine
> > http://www.bigelow.org/
> > https://eco.bigelow.org
> >
> >
>
> --
> Ben Tupper
> Bigelow Laboratory for Ocean Science
> East Boothbay, Maine
> http://www.bigelow.org/
> https://eco.bigelow.org
>
> [[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] spatstat installation

2020-04-14 Thread Bert Gunter
If you don't receive a satisfactory answer here in a day or so, post
on the R-sig-geo list where the experts in this sort of thing hang
around.

Cheers,
Bert

Bert Gunter

"The trouble with having an open mind is that people keep coming along
and sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )

On Tue, Apr 14, 2020 at 8:39 AM Mauro Pedone  wrote:
>
> Hello ,
> I am trying the spatstat package installation
> on R 3.3.0
>
> the package is spatstat_1.63-3.tar.gz
> ,the OS is oracle enterprise linux 7
>
> at the end I receive the error
> Error : .onAttach failed in attachNamespace() for 'spatstat', details:
>   call: if (today - as.Date(rdate) > 365) {
>   error: missing value where TRUE/FALSE needed
>
> ask to the community if someone encountered this problem.
>
> thanks and regards
>
> Mauro
>
>
>
>
> root@ctrdb10 supporting]#  R CMD INSTALL spatstat_1.63-3.tar.gz
> * installing to library ‘/usr/lib64/R/library’
> * installing *source* package ‘spatstat’ ...
> ** package ‘spatstat’ successfully unpacked and MD5 sums checked
> ** libs
> gcc -m64 -std=gnu99 -I/usr/lib64/R/../../include/R -DNDEBUG
> -I/systemr/port/Linux-X64/include/zlib -I/systemr/port/Linux-X64/include/xz
> -I/systemr/port/Linux-X64/include/bzip2
> -I/systemr/port/Linux-X64/include -fpic  -g -O2  -c Ediggatsti.c -o
> Ediggatsti.o
> gcc -m64 -std=gnu99 -I/usr/lib64/R/../../include/R -DNDEBUG
> -I/systemr/port/Linux-X64/include/zlib -I/systemr/port/Linux-X64/include/xz
> -I/systemr/port/Linux-X64/include/bzip2
> -I/systemr/port/Linux-X64/include -fpic  -g -O2  -c Ediggra.c -o
> Ediggra.o
> gcc -m64 -std=gnu99 -I/usr/lib64/R/../../include/R -DNDEBUG
> -I/systemr/port/Linux-X64/include/zlib -I/systemr/port/Linux-X64/include/xz
> -I/systemr/port/Linux-X64/include/bzip2
> -I/systemr/port/Linux-X64/include -fpic  -g -O2  -c Efiksel.c -o
> Efiksel.o
> gcc -m64 -std=gnu99 -I/usr/lib64/R/../../include/R -DNDEBUG
> -I/systemr/port/Linux-X64/include/zlib -I/systemr/port/Linux-X64/include/xz
> -I/systemr/port/Linux-X64/include/bzip2
> -I/systemr/port/Linux-X64/include -fpic  -g -O2  -c Egeyer.c -o Egeyer.o
> gcc -m64 -std=gnu99 -I/usr/lib64/R/../../include/R -DNDEBUG
> -I/systemr/port/Linux-X64/include/zlib -I/systemr/port/Linux-X64/include/xz
> -I/systemr/port/Linux-X64/include/bzip2
> -I/systemr/port/Linux-X64/include -fpic  -g -O2  -c Estrauss.c -o
> Estrauss.o
> gcc -m64 -std=gnu99 -I/usr/lib64/R/../../include/R -DNDEBUG
> -I/systemr/port/Linux-X64/include/zlib -I/systemr/port/Linux-X64/include/xz
> -I/systemr/port/Linux-X64/include/bzip2
> -I/systemr/port/Linux-X64/include -fpic  -g -O2  -c Kborder.c -o
> Kborder.o
> gcc -m64 -std=gnu99 -I/usr/lib64/R/../../include/R -DNDEBUG
> -I/systemr/port/Linux-X64/include/zlib -I/systemr/port/Linux-X64/include/xz
> -I/systemr/port/Linux-X64/include/bzip2
> -I/systemr/port/Linux-X64/include -fpic  -g -O2  -c Knone.c -o Knone.o
> gcc -m64 -std=gnu99 -I/usr/lib64/R/../../include/R -DNDEBUG
> -I/systemr/port/Linux-X64/include/zlib -I/systemr/port/Linux-X64/include/xz
> -I/systemr/port/Linux-X64/include/bzip2
> -I/systemr/port/Linux-X64/include -fpic  -g -O2  -c Krect.c -o Krect.o
> g++ -m64 -I/usr/lib64/R/../../include/R -DNDEBUG
> -I/systemr/port/Linux-X64/include/zlib -I/systemr/port/Linux-X64/include/xz
> -I/systemr/port/Linux-X64/include/bzip2
> -I/systemr/port/Linux-X64/include -fpic  -g -O2  -c Perfect.cc -o
> Perfect.o
> gcc -m64 -std=gnu99 -I/usr/lib64/R/../../include/R -DNDEBUG
> -I/systemr/port/Linux-X64/include/zlib -I/systemr/port/Linux-X64/include/xz
> -I/systemr/port/Linux-X64/include/bzip2
> -I/systemr/port/Linux-X64/include -fpic  -g -O2  -c areadiff.c -o
> areadiff.o
>
> 
>
> 
>
> vcov.mppm   html
> vcov.ppmhtml
> vcov.slrm   html
> venn.tess   html
> verticeshtml
> volume  html
> weighted.median html
> where.max   html
> whichhalfplane  html
> whist   html
> will.expand html
> with.fv html
> with.hyperframe html
> with.msrhtml
> with.ssfhtml
> yardstick   html
> zapsmall.im html
> zclustermodel   html
> ** building package indices
> ** installing vignettes
> ** testing if installed package can be loaded
> Error : .onAttach failed in attachNamespace() for 'spatstat', details:
>   call: if (today - as.Date(rdate) > 365) {
>   error: missing value where TRUE/FALSE 

Re: [R] Package renv and Rscript

2020-04-14 Thread Ben Tupper
Whoops!  The silly "send" button jumped out and grabbed my cursor before I
was ready for it.  Second try...

I am using renv (https://rstudio.github.io/renv/) to maintain a project
environment in a directory (ala '/path/to/project').

Within the project I have a number of scripts that I call with one argument
using...

$ Rscript /path/to/script.R /path/to/config_file

I can kick this off successfully with the renv environment when I manually
start Rscript within the project directory. Now I would like to be able to
hand the script kick-off to either crontab or the PBS queueing system.  But
I haven't figured out how to get the instance of R that is kicked off to do
so using the renv project space (i.e. using the R libraries as established
in the project.)

At first I thought I would call a simple wrapper script such that accepted
two arguments '/path/to/script.R' and '/path/to/config_file'. I planned to
use ...

###
args <- commandArgs(trailingOnly = TRUE)
path_to_script <- args[1]
path_to_config <- args[2]
renv::run(path_to_script,
  project = '/path/to/project')
###

Unfortunately renv::run() doesn't provide a vehicle for passing other
script arguments along.  So, in this case, there's no way to communicate
the configuration file to the script.

Is there a recommended way to call Rscript such that the renv environment
gets picked up?

Thanks!
Ben


On Tue, Apr 14, 2020 at 1:41 PM Ben Tupper  wrote:

> Hi,
>
> I am using renv (https://rstudio.github.io/renv/) to maintain a project
> environment in a directory (ala /path/to/project)
>
>
> Within the project I have a number of scripts that I call using...
>
> $ Rscript /path/to/script.R /path/to/config_file
>
> I can kick this off successfully with the renv environment when I manually
> start Rscript within the project directory. Now I would like to be able to
> hand the script kick off to either crontab or the PBS queueing system.
>
> At first I thought I would actually call a wrapper script such that
> accepted two arguments '/path/to/script.R' and '/path/to/config_file'. I
> planned to use
>
> renv::run('/path/to/script.R',
>
>
> --
> Ben Tupper
> Bigelow Laboratory for Ocean Science
> East Boothbay, Maine
> http://www.bigelow.org/
> https://eco.bigelow.org
>
>

-- 
Ben Tupper
Bigelow Laboratory for Ocean Science
East Boothbay, Maine
http://www.bigelow.org/
https://eco.bigelow.org

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R-es] (sin asunto)

2020-04-14 Thread Manuel Mendoza
Hola de nuevo, hago un mapa con ggplot:

pyt<-ggplot(data, aes(x = longitud, y = latitud)) +
geom_point(aes(color = factor(ptyrup)))
windows();pyt

y después hago un loop con for. En vez de  print(i), que me indica por
dónde va el loop,  me gustaría que me fuera añadiendo una línea vertical al
mapa en la longitud que corresponde a i. Con plot () es muy fácil:
abline(v=i), pero con ggplot, no me añade la línea, y si hago un nuevo mapa
con la nueva línea, me borra la anterior.

Creía haberlo solucionado incluyendo en el loop:

  pyt <- pyt+
  geom_vline(xintercept = i)
  pyt

Pero tampoco funciona. Es extraño, pues sale bien si hago yo las
iteraciones, una a una, pero cuando hago el loop no dibuja las líneas.

Gracias, una vez más,
Manuel



Muchas gracias, como siempre.

[[alternative HTML version deleted]]

___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es


[R] Package renv and Rscript

2020-04-14 Thread Ben Tupper
Hi,

I am using renv (https://rstudio.github.io/renv/) to maintain a project
environment in a directory (ala /path/to/project)


Within the project I have a number of scripts that I call using...

$ Rscript /path/to/script.R /path/to/config_file

I can kick this off successfully with the renv environment when I manually
start Rscript within the project directory. Now I would like to be able to
hand the script kick off to either crontab or the PBS queueing system.

At first I thought I would actually call a wrapper script such that
accepted two arguments '/path/to/script.R' and '/path/to/config_file'. I
planned to use

renv::run('/path/to/script.R',


-- 
Ben Tupper
Bigelow Laboratory for Ocean Science
East Boothbay, Maine
http://www.bigelow.org/
https://eco.bigelow.org

[[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-es] ¿puede alguien leerme esto?

2020-04-14 Thread José Trujillo Carmona

Tienes toda la razón. Lo he interpretado yo mal.

Perdonad el ruido.

Saludos.

El 14/4/20 a las 17:48, jorge.senan escribió:

Hola José,
Perdona pero, al menos en mi consola, si señalas con el signo menos - 
en las filas o en las columnas significa exclusión.
además en el caso de df[-1:-1,] me exluye solo la primera fila. 
Ejemplo A. Otra forma de exluir un grupo seria incluyendo : -c(1:3). 
Con el signo de negación y vector.


El tema de indicar la última posición sé que ocurre en las listas. 
Ejemplo B.


Ya me direis, por favor. Me habeis dejado con la intriga. Siempre lo 
he hecho así...


Saludos



Ejemplo A

a<-data.frame(a= c("1","2s","3s",4,5))
a[1,]

[1] 1
Levels: 1 2s 3s 4 5

a[-1,]

[1] 2s 3s 4  5
Levels: 1 2s 3s 4 5

a[-3,]

[1] 1  2s 4  5
Levels: 1 2s 3s 4 5

a[-1:-3,]

[1] 4 5
Levels: 1 2s 3s 4 5

a[-1:-1,]

[1] 2s 3s 4  5
Levels: 1 2s 3s 4 5

a[-1:-3, !names(a) %in% "a"]

data frame with 0 columns and 2 rows

Ejemplo B

list_a<-list(a= "uno",b= c(1,2,3))
list_a[-1]

$b
[1] 1 2 3

list_a[-2]

$a
[1] "uno"

list_a[-1:-2]

named list()


El 14.04.2020 16:56, José Trujillo Carmona escribió:
Los corchetes seleccionan en un dataframe (conjunto de datos), filas 
y columnas.


Los números anteriores a la coma las filas y lo que haya después de la
coma las columnas.

Antes de la coma tienes los números 1:50, que serían desde el primero
al 50 de las 150 filas que hay.

Pero si son negativos el primero te dice donde empezar, siendo el -1
la última fila y el segundo número hasta donde llegar siendo 149 la
penúltima fila, 148 la antepenúltima, ... -1:-1 serían todas las
filas.

Respecto de las columnas en el primer caso tienes puestas las columnas
cuyos nombres no sean Species y en el segundo caso la columna Species.

Saludos.


El 14/4/20 a las 16:32, Manuel Mendoza escribió:

Perdonad, os mandé lo que yo estaba haciendo. Es esto:

X = iris[-1:-50,!names(iris) %in% "Species"]

Y = iris[-1:-50,"Species"]

[[alternative HTML version deleted]]

___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es


___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es


___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es


Re: [R-es] ¿puede alguien leerme esto?

2020-04-14 Thread jorge.senan

Hola José,
Perdona pero, al menos en mi consola, si señalas con el signo menos - en 
las filas o en las columnas significa exclusión.
además en el caso de df[-1:-1,] me exluye solo la primera fila. Ejemplo 
A. Otra forma de exluir un grupo seria incluyendo : -c(1:3). Con el 
signo de negación y vector.


El tema de indicar la última posición sé que ocurre en las listas. 
Ejemplo B.


Ya me direis, por favor. Me habeis dejado con la intriga. Siempre lo he 
hecho así...


Saludos



Ejemplo A

a<-data.frame(a= c("1","2s","3s",4,5))
a[1,]

[1] 1
Levels: 1 2s 3s 4 5

a[-1,]

[1] 2s 3s 4  5
Levels: 1 2s 3s 4 5

a[-3,]

[1] 1  2s 4  5
Levels: 1 2s 3s 4 5

a[-1:-3,]

[1] 4 5
Levels: 1 2s 3s 4 5

a[-1:-1,]

[1] 2s 3s 4  5
Levels: 1 2s 3s 4 5

a[-1:-3, !names(a) %in% "a"]

data frame with 0 columns and 2 rows

Ejemplo B

list_a<-list(a= "uno",b= c(1,2,3))
list_a[-1]

$b
[1] 1 2 3

list_a[-2]

$a
[1] "uno"

list_a[-1:-2]

named list()


El 14.04.2020 16:56, José Trujillo Carmona escribió:
Los corchetes seleccionan en un dataframe (conjunto de datos), filas y 
columnas.


Los números anteriores a la coma las filas y lo que haya después de la
coma las columnas.

Antes de la coma tienes los números 1:50, que serían desde el primero
al 50 de las 150 filas que hay.

Pero si son negativos el primero te dice donde empezar, siendo el -1
la última fila y el segundo número hasta donde llegar siendo 149 la
penúltima fila, 148 la antepenúltima, ... -1:-1 serían todas las
filas.

Respecto de las columnas en el primer caso tienes puestas las columnas
cuyos nombres no sean Species y en el segundo caso la columna Species.

Saludos.


El 14/4/20 a las 16:32, Manuel Mendoza escribió:

Perdonad, os mandé lo que yo estaba haciendo. Es esto:

X = iris[-1:-50,!names(iris) %in% "Species"]

Y = iris[-1:-50,"Species"]

[[alternative HTML version deleted]]

___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es


___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es


___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es


Re: [R] A simple string alienation question.

2020-04-14 Thread Erich Subscriptions
read.csv has parameters sep, quote and dec
You have to get these right to represent the structure of you input file.

> On 14.04.2020, at 11:28, Sam Charya via R-help  wrote:
> 
> 
> 
> Hello Dear R Community,
> I would ask a little bit of help from you please:I have a dataset, which is 
> in a CSV file – I have read it into R as follows: 
>  V11   tropical fruit"2   whole milk"3pip fruit"4 
> other vegetables"5   whole milk"6   rolls/buns"
> The issue is: the data set in Csv file also appears with the quotation marks 
> “. I can’t get rid of the quotation marks. I want to do it in R. The Quotes 
> only appear at the end of the string. The dataset has many rows – this is 
> just a copy. My intention is to be able to get rid of the quotes and then 
> want to separate the strings with a ‘/’. i.e. rolls/buns should be rolls in 
> one column and buns in another.
> I know this is something very simple I am lacking – but if you could please 
> show me how to do this? If someone could throw some light please. I read the 
> data in with a simple read.csv statement: 
>  calc <- read.csv("Fight.csv", stringsAsFactors = F, header = F)  str(x) 
> Output: > str(calc)'data.frame': 38765 obs. of  1 variable: $ V1: chr  
> "tropical fruit\"" "whole milk\"" "pip fruit\"" "other vegetables\"" ...
> Many Thanks in advance for your help.
> Kind Regards,
> Sam. 
> 
> 
> 
> 
>   [[alternative HTML version deleted]]
> 
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] spatstat installation

2020-04-14 Thread Mauro Pedone
Hello ,
I am trying the spatstat package installation
on R 3.3.0

the package is spatstat_1.63-3.tar.gz
,the OS is oracle enterprise linux 7

at the end I receive the error
Error : .onAttach failed in attachNamespace() for 'spatstat', details:
  call: if (today - as.Date(rdate) > 365) {
  error: missing value where TRUE/FALSE needed

ask to the community if someone encountered this problem.

thanks and regards

Mauro




root@ctrdb10 supporting]#  R CMD INSTALL spatstat_1.63-3.tar.gz
* installing to library ‘/usr/lib64/R/library’
* installing *source* package ‘spatstat’ ...
** package ‘spatstat’ successfully unpacked and MD5 sums checked
** libs
gcc -m64 -std=gnu99 -I/usr/lib64/R/../../include/R -DNDEBUG
-I/systemr/port/Linux-X64/include/zlib -I/systemr/port/Linux-X64/include/xz
-I/systemr/port/Linux-X64/include/bzip2
-I/systemr/port/Linux-X64/include -fpic  -g -O2  -c Ediggatsti.c -o
Ediggatsti.o
gcc -m64 -std=gnu99 -I/usr/lib64/R/../../include/R -DNDEBUG
-I/systemr/port/Linux-X64/include/zlib -I/systemr/port/Linux-X64/include/xz
-I/systemr/port/Linux-X64/include/bzip2
-I/systemr/port/Linux-X64/include -fpic  -g -O2  -c Ediggra.c -o
Ediggra.o
gcc -m64 -std=gnu99 -I/usr/lib64/R/../../include/R -DNDEBUG
-I/systemr/port/Linux-X64/include/zlib -I/systemr/port/Linux-X64/include/xz
-I/systemr/port/Linux-X64/include/bzip2
-I/systemr/port/Linux-X64/include -fpic  -g -O2  -c Efiksel.c -o
Efiksel.o
gcc -m64 -std=gnu99 -I/usr/lib64/R/../../include/R -DNDEBUG
-I/systemr/port/Linux-X64/include/zlib -I/systemr/port/Linux-X64/include/xz
-I/systemr/port/Linux-X64/include/bzip2
-I/systemr/port/Linux-X64/include -fpic  -g -O2  -c Egeyer.c -o Egeyer.o
gcc -m64 -std=gnu99 -I/usr/lib64/R/../../include/R -DNDEBUG
-I/systemr/port/Linux-X64/include/zlib -I/systemr/port/Linux-X64/include/xz
-I/systemr/port/Linux-X64/include/bzip2
-I/systemr/port/Linux-X64/include -fpic  -g -O2  -c Estrauss.c -o
Estrauss.o
gcc -m64 -std=gnu99 -I/usr/lib64/R/../../include/R -DNDEBUG
-I/systemr/port/Linux-X64/include/zlib -I/systemr/port/Linux-X64/include/xz
-I/systemr/port/Linux-X64/include/bzip2
-I/systemr/port/Linux-X64/include -fpic  -g -O2  -c Kborder.c -o
Kborder.o
gcc -m64 -std=gnu99 -I/usr/lib64/R/../../include/R -DNDEBUG
-I/systemr/port/Linux-X64/include/zlib -I/systemr/port/Linux-X64/include/xz
-I/systemr/port/Linux-X64/include/bzip2
-I/systemr/port/Linux-X64/include -fpic  -g -O2  -c Knone.c -o Knone.o
gcc -m64 -std=gnu99 -I/usr/lib64/R/../../include/R -DNDEBUG
-I/systemr/port/Linux-X64/include/zlib -I/systemr/port/Linux-X64/include/xz
-I/systemr/port/Linux-X64/include/bzip2
-I/systemr/port/Linux-X64/include -fpic  -g -O2  -c Krect.c -o Krect.o
g++ -m64 -I/usr/lib64/R/../../include/R -DNDEBUG
-I/systemr/port/Linux-X64/include/zlib -I/systemr/port/Linux-X64/include/xz
-I/systemr/port/Linux-X64/include/bzip2
-I/systemr/port/Linux-X64/include -fpic  -g -O2  -c Perfect.cc -o
Perfect.o
gcc -m64 -std=gnu99 -I/usr/lib64/R/../../include/R -DNDEBUG
-I/systemr/port/Linux-X64/include/zlib -I/systemr/port/Linux-X64/include/xz
-I/systemr/port/Linux-X64/include/bzip2
-I/systemr/port/Linux-X64/include -fpic  -g -O2  -c areadiff.c -o
areadiff.o





vcov.mppm   html
vcov.ppmhtml
vcov.slrm   html
venn.tess   html
verticeshtml
volume  html
weighted.median html
where.max   html
whichhalfplane  html
whist   html
will.expand html
with.fv html
with.hyperframe html
with.msrhtml
with.ssfhtml
yardstick   html
zapsmall.im html
zclustermodel   html
** building package indices
** installing vignettes
** testing if installed package can be loaded
Error : .onAttach failed in attachNamespace() for 'spatstat', details:
  call: if (today - as.Date(rdate) > 365) {
  error: missing value where TRUE/FALSE needed
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/usr/lib64/R/library/spatstat’

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] A simple string alienation problem

2020-04-14 Thread Soumyadip Bhattacharyya
***Dear Eric,*
sending from gmail following the way you suggested. Hope now everyone
can see this email.  I have also attached the first 50 rows of the
FIght.csv.***
***Output - I will try to do Market basket analysis on this to find
out rules that I am learning. so once I have the data in transactional
format - then I can run the algorithm and keep learning. This little
problem has caused a barrier in my path - I can alienate the string in
excel - but wanted to do in R - so researching I tried doing this:
x<- substr(x, 1, nchar(x) - 1)  // but I wasn't successful and I tried
many other things - its not coming in the transactional format. ***
Hence now reached out to the experts. Many Thanks.

Hello Dear R Community,

I would ask a little bit of help from you please:I have a dataset,
which is in a CSV file – I have read it into R as follows:

  V1
tropical fruit"
whole milk"
pip fruit"
other vegetables"
whole milk"
rolls/buns"

The issue is: the data set in csv file also appears with the quotation
marks “. I can’t get rid of the quotation marks. I want to do it in R.
The Quotes only appear at the end of the string. The dataset has many
rows – this is just a copy. My intention is to be able to get rid of
the quotes and then want to separate the strings with a ‘/’. i.e.
rolls/buns should be rolls in one column and buns in another.

I know this is something very simple I am lacking – but if you could
please show me how to do this? If someone could throw some light
please. I read the data in with a simple read.csv statement:

> x <- read.csv("Fight.csv", stringsAsFactors = F, header = F)
> str(x)
Output:
> str(calc)
'data.frame':   38765 obs. of  1 variable:
$ V1: chr  "tropical fruit\"" "whole milk\"" "pip fruit\"" "other
vegetables\"" ...

Many Thanks in advance for your help.
Kind Regards,
Sam.
__
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-es] ¿puede alguien leerme esto?

2020-04-14 Thread José Trujillo Carmona
Los corchetes seleccionan en un dataframe (conjunto de datos), filas y 
columnas.


Los números anteriores a la coma las filas y lo que haya después de la 
coma las columnas.


Antes de la coma tienes los números 1:50, que serían desde el primero al 
50 de las 150 filas que hay.


Pero si son negativos el primero te dice donde empezar, siendo el -1 la 
última fila y el segundo número hasta donde llegar siendo 149 la 
penúltima fila, 148 la antepenúltima, ... -1:-1 serían todas las filas.


Respecto de las columnas en el primer caso tienes puestas las columnas 
cuyos nombres no sean Species y en el segundo caso la columna Species.


Saludos.


El 14/4/20 a las 16:32, Manuel Mendoza escribió:

Perdonad, os mandé lo que yo estaba haciendo. Es esto:

X = iris[-1:-50,!names(iris) %in% "Species"]

Y = iris[-1:-50,"Species"]

[[alternative HTML version deleted]]

___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es


___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es


[R-es] ¿puede alguien leerme esto?

2020-04-14 Thread Manuel Mendoza
Perdonad, os mandé lo que yo estaba haciendo. Es esto:

X = iris[-1:-50,!names(iris) %in% "Species"]

Y = iris[-1:-50,"Species"]

[[alternative HTML version deleted]]

___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es


[R-es] ¿puede alguien leerme esto?

2020-04-14 Thread Manuel Mendoza
Buenas tardes, ¿puede alguien leerme esto? es de un ejemplo de forestFloor

X = data[-1:-50,!names(data) %in% "ptyrup"]
Y = iris[-1:-50,"Species"]

Gracias

[[alternative HTML version deleted]]

___
R-help-es mailing list
R-help-es@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-help-es


Re: [R] A simple string alienation problem

2020-04-14 Thread Eric Berger
Hi Sam,
My code below adds new columns to your data frame so you have the original
columns in order to compare.
(Also this could help in case there are a few rows that don't work in the
full set.)

> x <- read.csv("Fight.csv", stringsAsFactors = F, header = F)
>  x$V3 <- sub("\\\"","",x$V1)  # remove the "
> iV <- grep("/",x$V3)  # get the indices of the rows that have / in the
name
> x$V4 <- x$V2  # or rep(NA,nrow(x))
> x$V4[iV] <- sub(".*/","",x$V3[iV])  # remove up-to-and-including the /
> x$V3[iV] <- sub("/.*","",x$V3[iV])  # remove from the / and beyond
> x

HTH,
Eric




On Tue, Apr 14, 2020 at 1:55 PM Soumyadip Bhattacharyya <
s.b.sam2...@gmail.com> wrote:

> ***Dear Eric,*
> sending from gmail following the way you suggested. Hope now everyone
> can see this email.  I have also attached the first 50 rows of the
> FIght.csv.***
> ***Output - I will try to do Market basket analysis on this to find
> out rules that I am learning. so once I have the data in transactional
> format - then I can run the algorithm and keep learning. This little
> problem has caused a barrier in my path - I can alienate the string in
> excel - but wanted to do in R - so researching I tried doing this:
> x<- substr(x, 1, nchar(x) - 1)  // but I wasn't successful and I tried
> many other things - its not coming in the transactional format. ***
> Hence now reached out to the experts. Many Thanks.
>
> Hello Dear R Community,
>
> I would ask a little bit of help from you please:I have a dataset,
> which is in a CSV file – I have read it into R as follows:
>
>   V1
> tropical fruit"
> whole milk"
> pip fruit"
> other vegetables"
> whole milk"
> rolls/buns"
>
> The issue is: the data set in csv file also appears with the quotation
> marks “. I can’t get rid of the quotation marks. I want to do it in R.
> The Quotes only appear at the end of the string. The dataset has many
> rows – this is just a copy. My intention is to be able to get rid of
> the quotes and then want to separate the strings with a ‘/’. i.e.
> rolls/buns should be rolls in one column and buns in another.
>
> I know this is something very simple I am lacking – but if you could
> please show me how to do this? If someone could throw some light
> please. I read the data in with a simple read.csv statement:
>
> > x <- read.csv("Fight.csv", stringsAsFactors = F, header = F)
> > str(x)
> Output:
> > str(calc)
> 'data.frame':   38765 obs. of  1 variable:
> $ V1: chr  "tropical fruit\"" "whole milk\"" "pip fruit\"" "other
> vegetables\"" ...
>
> Many Thanks in advance for your help.
> Kind Regards,
> Sam.
>

[[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] A simple string alienation question.

2020-04-14 Thread Eric Berger
Hi Sam,
This should be straightforward. But to help out the people who could give
you an answer it would be better if you could provide the information a bit
more clearly as follows:
1. send your email in plain text mode. If you use gmail, when you are
composing your email, you can click on the 3 dots in the lower right and
select 'Plain text mode'. The R-help list doesn't handle HTML.
2. We cannot see your "Fight.csv" file. Include in your email, say, the
first couple of lines of this file.
3. Also provide the sample output (or data frame) that you would like to
get from this shortened version of your input.

Best,
Eric


On Tue, Apr 14, 2020 at 12:29 PM Sam Charya via R-help 
wrote:

>
>
> Hello Dear R Community,
> I would ask a little bit of help from you please:I have a dataset, which
> is in a CSV file – I have read it into R as follows:
>  V11   tropical fruit"2   whole milk"3pip
> fruit"4 other vegetables"5   whole milk"6   rolls/buns"
> The issue is: the data set in Csv file also appears with the quotation
> marks “. I can’t get rid of the quotation marks. I want to do it in R. The
> Quotes only appear at the end of the string. The dataset has many rows –
> this is just a copy. My intention is to be able to get rid of the quotes
> and then want to separate the strings with a ‘/’. i.e. rolls/buns should be
> rolls in one column and buns in another.
> I know this is something very simple I am lacking – but if you could
> please show me how to do this? If someone could throw some light please. I
> read the data in with a simple read.csv statement:
>  calc <- read.csv("Fight.csv", stringsAsFactors = F, header = F)  str(x)
> Output: > str(calc)'data.frame': 38765 obs. of  1 variable: $ V1: chr
> "tropical fruit\"" "whole milk\"" "pip fruit\"" "other vegetables\"" ...
> Many Thanks in advance for your help.
> Kind Regards,
> Sam.
>
>
>
>
> [[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] Error with devTools

2020-04-14 Thread Eric Berger
RStudio provides a terminal window. You could print out the environment
variables there and then adjust the ones in your R console session
appropriately. I could give you some guidance under linux, but it seems you
use Windows. Perhaps others can help with the details.

On Tue, Apr 14, 2020 at 12:14 PM Duncan Murdoch 
wrote:

> No, I mean the path to the other Rtools.  I think the only solution to
> avoid the quiet = TRUE is to modify the devtools package, or don't use it.
>
> Duncan Murdoch
>
> On 14/04/2020 4:18 a.m., iurii.chernia...@t-systems.com wrote:
> > Hi Duncan ,
> > Thank you for your answer, you mean R path?
> >   I have in PATH  "C:\Program Files\R\R-3.6.2\bin\x64"
> >
> >
> > Maybe you can provide me , how I can switch quiet = TRUE to False?
> >
> >
> >
> >
> > -Original Message-
> > From: Duncan Murdoch 
> > Sent: Monday, April 13, 2020 11:33 PM
> > To: Cherniatin, Iurii ;
> r-help@r-project.org
> > Subject: Re: [R] Error with devTools
> >
> > On 13/04/2020 2:50 p.m., iurii.chernia...@t-systems.com wrote:
> >> Hi everyone!
> >> Could somebody help me, I`m trying to run devtools::test() from
> R-console and it doesn't` work, but it works via RStudio if I will remove
> devtools before.
> >
> > I'd guess you don't have the PATH set properly so compilers etc can't be
> found, but devtools::test hides the information that would confirm that,
> because it compiles with quiet = TRUE hard coded.
> >
> > Duncan Murdoch
> >
> >>
> >>Error from console:
> >>
> >>
> >> Loading space
> >> Error in (function (command = NULL, args = character(), error_on_status
> = TRUE,  :
> >> System command 'Rcmd.exe' failed, exit status: 1, stdout + stderr:
> >> E> * installing *source* package 'space' ...
> >> E> ** using staged installation
> >> E> ** libs
> >> E> no DLL was created
> >> E> ERROR: compilation failed for package 'space'
> >> E> * removing
> 'C:/Users/user/AppData/Local/Temp/RtmpSESXUZ/devtools_install_3f9853f01a48/space'
> >> Type .Last.error.trace to see where the error occured
> >>>
> >>>
> >>>
> >>> .Last.error.trace
> >>
> >> Stack trace:
> >>
> >> 1. devtools::test()
> >> 2. devtools:::load_all(pkg$path, quiet = TRUE, export_all =
> >> export_all) 3. pkgload::load_all(path = path, reset = reset, recompile
> = recompile,  ...
> >> 4. pkgbuild::compile_dll(path, quiet = quiet) 5.
> >> withr::with_makevars(compiler_flags(TRUE), assignment = "+=",  ...
> >> 6. withr:::with_envvar(c(R_MAKEVARS_USER = makevars_file), { ...
> >> 7. base:::force(code)
> >> 8. base:::force(code)
> >> 9. pkgbuild:::install_min(path, dest = install_dir, components =
> "libs",  ...
> >> 10. pkgbuild:::rcmd_build_tools("INSTALL", c(path, paste("--library=",
> ...
> >> 11. pkgbuild:::with_build_tools(callr::rcmd_safe(..., env = env,  ...
> >> 12. withr::with_path(rtools_path(), code) 13. base:::force(code) 14.
> >> callr::rcmd_safe(..., env = env, spinner = FALSE, show = FALSE,  ...
> >> 15. callr:::run_r(options)
> >> 16. base:::with(options, with_envvar(env, do.call(processx::run,  ...
> >> 17. base:::with.default(options, with_envvar(env,
> do.call(processx::run,  ...
> >> 18. base:::eval(substitute(expr), data, enclos = parent.frame()) 19.
> >> base:::eval(substitute(expr), data, enclos = parent.frame()) 20.
> >> callr:::with_envvar(env, do.call(processx::run, c(list(bin, args =
> real_cmd ...
> >> 21. base:::force(code)
> >> 22. base:::do.call(processx::run, c(list(bin, args = real_cmdargs,  ...
> >> 23. (function (command = NULL, args = character(), error_on_status =
> TRUE,  ...
> >> 24. throw(new_process_error(res, call = sys.call(), echo = echo,  ...
> >>
> >> x System command 'Rcmd.exe' failed, exit status: 1, stdout + stderr:
> >> E> * installing *source* package 'space' ...
> >> E> ** using staged installation
> >> E> ** libs
> >> E> no DLL was created
> >> E> ERROR: compilation failed for package 'space'
> >> E> * removing
> 'C:/Users/user/AppData/Local/Temp/RtmpSESXUZ/devtools_install_3f9853f01a48/space'
> >>
> >>
> >>
> >> Environment:
> >>
> >> 1) Windows 10 X64
> >>
> >> 2) R lib : 3.6.3
> >>
> >> 3) R-Studio 1.2.5042
> >>
> >>
> >>  [[alternative HTML version deleted]]
> >>
> >> __
> >> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> >> https://stat.ethz.ch/mailman/listinfo/r-help
> >> PLEASE do read the posting guide
> >> http://www.R-project.org/posting-guide.html
> >> and provide commented, minimal, self-contained, reproducible code.
> >>
> >
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, 

[R] A simple string alienation question.

2020-04-14 Thread Sam Charya via R-help
 

Hello Dear R Community,
I would ask a little bit of help from you please:I have a dataset, which is in 
a CSV file – I have read it into R as follows: 
                 V11   tropical fruit"2       whole milk"3        pip fruit"4 
other vegetables"5       whole milk"6       rolls/buns"
The issue is: the data set in Csv file also appears with the quotation marks “. 
I can’t get rid of the quotation marks. I want to do it in R. The Quotes only 
appear at the end of the string. The dataset has many rows – this is just a 
copy. My intention is to be able to get rid of the quotes and then want to 
separate the strings with a ‘/’. i.e. rolls/buns should be rolls in one column 
and buns in another.
I know this is something very simple I am lacking – but if you could please 
show me how to do this? If someone could throw some light please. I read the 
data in with a simple read.csv statement: 
 calc <- read.csv("Fight.csv", stringsAsFactors = F, header = F)  str(x) 
Output: > str(calc)'data.frame': 38765 obs. of  1 variable: $ V1: chr  
"tropical fruit\"" "whole milk\"" "pip fruit\"" "other vegetables\"" ...
Many Thanks in advance for your help.
Kind Regards,
Sam. 




[[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] Error with devTools

2020-04-14 Thread Duncan Murdoch
No, I mean the path to the other Rtools.  I think the only solution to 
avoid the quiet = TRUE is to modify the devtools package, or don't use it.


Duncan Murdoch

On 14/04/2020 4:18 a.m., iurii.chernia...@t-systems.com wrote:

Hi Duncan ,
Thank you for your answer, you mean R path?
  I have in PATH  "C:\Program Files\R\R-3.6.2\bin\x64"



Maybe you can provide me , how I can switch quiet = TRUE to False?




-Original Message-
From: Duncan Murdoch 
Sent: Monday, April 13, 2020 11:33 PM
To: Cherniatin, Iurii ; r-help@r-project.org
Subject: Re: [R] Error with devTools

On 13/04/2020 2:50 p.m., iurii.chernia...@t-systems.com wrote:

Hi everyone!
Could somebody help me, I`m trying to run devtools::test() from R-console and 
it doesn't` work, but it works via RStudio if I will remove devtools before.


I'd guess you don't have the PATH set properly so compilers etc can't be found, 
but devtools::test hides the information that would confirm that, because it 
compiles with quiet = TRUE hard coded.

Duncan Murdoch



   Error from console:


Loading space
Error in (function (command = NULL, args = character(), error_on_status = TRUE, 
 :
System command 'Rcmd.exe' failed, exit status: 1, stdout + stderr:
E> * installing *source* package 'space' ...
E> ** using staged installation
E> ** libs
E> no DLL was created
E> ERROR: compilation failed for package 'space'
E> * removing 
'C:/Users/user/AppData/Local/Temp/RtmpSESXUZ/devtools_install_3f9853f01a48/space'
Type .Last.error.trace to see where the error occured




.Last.error.trace


Stack trace:

1. devtools::test()
2. devtools:::load_all(pkg$path, quiet = TRUE, export_all =
export_all) 3. pkgload::load_all(path = path, reset = reset, recompile = 
recompile,  ...
4. pkgbuild::compile_dll(path, quiet = quiet) 5.
withr::with_makevars(compiler_flags(TRUE), assignment = "+=",  ...
6. withr:::with_envvar(c(R_MAKEVARS_USER = makevars_file), { ...
7. base:::force(code)
8. base:::force(code)
9. pkgbuild:::install_min(path, dest = install_dir, components = "libs",  ...
10. pkgbuild:::rcmd_build_tools("INSTALL", c(path, paste("--library=",  ...
11. pkgbuild:::with_build_tools(callr::rcmd_safe(..., env = env,  ...
12. withr::with_path(rtools_path(), code) 13. base:::force(code) 14.
callr::rcmd_safe(..., env = env, spinner = FALSE, show = FALSE,  ...
15. callr:::run_r(options)
16. base:::with(options, with_envvar(env, do.call(processx::run,  ...
17. base:::with.default(options, with_envvar(env, do.call(processx::run,  ...
18. base:::eval(substitute(expr), data, enclos = parent.frame()) 19.
base:::eval(substitute(expr), data, enclos = parent.frame()) 20.
callr:::with_envvar(env, do.call(processx::run, c(list(bin, args = real_cmd ...
21. base:::force(code)
22. base:::do.call(processx::run, c(list(bin, args = real_cmdargs,  ...
23. (function (command = NULL, args = character(), error_on_status = TRUE,  ...
24. throw(new_process_error(res, call = sys.call(), echo = echo,  ...

x System command 'Rcmd.exe' failed, exit status: 1, stdout + stderr:
E> * installing *source* package 'space' ...
E> ** using staged installation
E> ** libs
E> no DLL was created
E> ERROR: compilation failed for package 'space'
E> * removing 
'C:/Users/user/AppData/Local/Temp/RtmpSESXUZ/devtools_install_3f9853f01a48/space'



Environment:

1) Windows 10 X64

2) R lib : 3.6.3

3) R-Studio 1.2.5042


[[alternative HTML version deleted]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.





__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Error with devTools

2020-04-14 Thread Iurii.Cherniatin
Hi Duncan ,
   Thank you for your answer, you mean R path?  
 I have in PATH  "C:\Program Files\R\R-3.6.2\bin\x64"
   

Maybe you can provide me , how I can switch quiet = TRUE to False?




-Original Message-
From: Duncan Murdoch  
Sent: Monday, April 13, 2020 11:33 PM
To: Cherniatin, Iurii ; r-help@r-project.org
Subject: Re: [R] Error with devTools

On 13/04/2020 2:50 p.m., iurii.chernia...@t-systems.com wrote:
> Hi everyone!
> Could somebody help me, I`m trying to run devtools::test() from R-console and 
> it doesn't` work, but it works via RStudio if I will remove devtools before.

I'd guess you don't have the PATH set properly so compilers etc can't be found, 
but devtools::test hides the information that would confirm that, because it 
compiles with quiet = TRUE hard coded.

Duncan Murdoch

> 
>   Error from console:
> 
> 
> Loading space
> Error in (function (command = NULL, args = character(), error_on_status = 
> TRUE,  :
>System command 'Rcmd.exe' failed, exit status: 1, stdout + stderr:
> E> * installing *source* package 'space' ...
> E> ** using staged installation
> E> ** libs
> E> no DLL was created
> E> ERROR: compilation failed for package 'space'
> E> * removing 
> 'C:/Users/user/AppData/Local/Temp/RtmpSESXUZ/devtools_install_3f9853f01a48/space'
> Type .Last.error.trace to see where the error occured
>>
>>
>>
>> .Last.error.trace
> 
> Stack trace:
> 
> 1. devtools::test()
> 2. devtools:::load_all(pkg$path, quiet = TRUE, export_all = 
> export_all) 3. pkgload::load_all(path = path, reset = reset, recompile = 
> recompile,  ...
> 4. pkgbuild::compile_dll(path, quiet = quiet) 5. 
> withr::with_makevars(compiler_flags(TRUE), assignment = "+=",  ...
> 6. withr:::with_envvar(c(R_MAKEVARS_USER = makevars_file), { ...
> 7. base:::force(code)
> 8. base:::force(code)
> 9. pkgbuild:::install_min(path, dest = install_dir, components = "libs",  ...
> 10. pkgbuild:::rcmd_build_tools("INSTALL", c(path, paste("--library=",  ...
> 11. pkgbuild:::with_build_tools(callr::rcmd_safe(..., env = env,  ...
> 12. withr::with_path(rtools_path(), code) 13. base:::force(code) 14. 
> callr::rcmd_safe(..., env = env, spinner = FALSE, show = FALSE,  ...
> 15. callr:::run_r(options)
> 16. base:::with(options, with_envvar(env, do.call(processx::run,  ...
> 17. base:::with.default(options, with_envvar(env, do.call(processx::run,  ...
> 18. base:::eval(substitute(expr), data, enclos = parent.frame()) 19. 
> base:::eval(substitute(expr), data, enclos = parent.frame()) 20. 
> callr:::with_envvar(env, do.call(processx::run, c(list(bin, args = real_cmd 
> ...
> 21. base:::force(code)
> 22. base:::do.call(processx::run, c(list(bin, args = real_cmdargs,  ...
> 23. (function (command = NULL, args = character(), error_on_status = TRUE,  
> ...
> 24. throw(new_process_error(res, call = sys.call(), echo = echo,  ...
> 
> x System command 'Rcmd.exe' failed, exit status: 1, stdout + stderr:
> E> * installing *source* package 'space' ...
> E> ** using staged installation
> E> ** libs
> E> no DLL was created
> E> ERROR: compilation failed for package 'space'
> E> * removing 
> 'C:/Users/user/AppData/Local/Temp/RtmpSESXUZ/devtools_install_3f9853f01a48/space'
> 
> 
> 
> Environment:
> 
> 1) Windows 10 X64
> 
> 2) R lib : 3.6.3
> 
> 3) R-Studio 1.2.5042
> 
> 
>   [[alternative HTML version deleted]]
> 
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide 
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
> 

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.