Re: [R] Moving 2nd column into 1st column using R

2019-09-09 Thread Jim Lemon
Hi Zuhri,
Try:

mydf<-mydf[,c(2,1)]

You might be surprised.

Jim

On Tue, Sep 10, 2019 at 12:20 PM smart hendsome via R-help
 wrote:
>
> Hi R-user,
> I have a problem regarding R.  How can I move my 2nd column into 1st column.  
> For example I have data as below:
>  mydf <- data.frame(matrix(1:6, ncol = 2))
>  mydf
>   X1 X2   1   4   2   5   3   6
> I want move my 2nd column become like this:
>   X11  234   5   6
> Hope anyone can help me. Many thanks.
>
> Zuhri
>
> [[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] Moving 2nd column into 1st column using R

2019-09-09 Thread David Winsemius



On 9/9/19 7:19 PM, smart hendsome via R-help wrote:

Hi R-user,
I have a problem regarding R.  How can I move my 2nd column into 1st column.  
For example I have data as below:
  mydf <- data.frame(matrix(1:6, ncol = 2))
  mydf
   X1 X2   1   4   2   5   3   6
I want move my 2nd column become like this:
   X1    1      2    3    4   5   6
Hope anyone can help me. Many thanks.

Zuhri
  
	[[alternative HTML version deleted]]



I doubt that anyone can tell what your intentions are. You ahve posted 
in html and the mailserver does not interpret html code. So repost in 
plain text  as the posting guide advises.



--

David.



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


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


[ESS] Issue with polymode installed from ELPA

2019-09-09 Thread Sparapani, Rodney via ESS-help
Hi Gang:

I am stumped.  I tried to install polymode from ELPA into Vincent Goulet's
distro of Emacs and ESS (it no longer contains polymode sadly).  
macOS 10.14.4 Mojave, Emacs version 26.2 and ESS version 18.10.2  
The ELPA install seemed to go well.  My load-path starts with
("/Users/rsparapa/.emacs.d/elpa/poly-R-0.2" 
"/Users/rsparapa/.emacs.d/elpa/poly-markdown-0.2" 
"/Users/rsparapa/.emacs.d/elpa/markdown-mode-2.3" 
"/Users/rsparapa/.emacs.d/elpa/poly-noweb-0.2" 
"/Users/rsparapa/.emacs.d/elpa/polymode-0.2" ...
So, everything looks good.  But, I get errors when I put simple requires in 
.emacs like (require 'polymode)
So, I hard-coded all of the paths, but this gets hairy since now I have to 
hard-code all of the dependencies too ...
(require 'polymode-classes "~/.emacs.d/elpa/polymode-0.2/polymode-classes.el")
(require 'polymode-core "~/.emacs.d/elpa/polymode-0.2/polymode-core.el")
(require 'polymode-compat "~/.emacs.d/elpa/polymode-0.2/polymode-compat.el")
(require 'polymode-methods "~/.emacs.d/elpa/polymode-0.2/polymode-methods.el")
(require 'polymode-export "~/.emacs.d/elpa/polymode-0.2/polymode-export.el")
(require 'polymode-weave "~/.emacs.d/elpa/polymode-0.2/polymode-weave.el")
(require 'polymode-base "~/.emacs.d/elpa/polymode-0.2/polymode-base.el")
(require 'poly-lock "~/.emacs.d/elpa/polymode-0.2/poly-lock.el")
(require 'polymode "~/.emacs.d/elpa/polymode-0.2/polymode.el")
(require 'poly-noweb "~/.emacs.d/elpa/poly-noweb-0.2/poly-noweb.el")
(require 'poly-markdown "~/.emacs.d/elpa/poly-markdown-0.2/poly-markdown.el")
(require 'poly-R "~/.emacs.d/elpa/poly-R-0.2/poly-R.el")
Getting the order of the dependencies right was a pain as well.  However, 
brute force fixed it!  But, I don't want to go through this ever again for
obvious reasons.  It took me over an hour for what is supposed to be a 5 or
10 minute install.  Does anyone have an idea of WTF is going wrong here?

Thanks,

Rodney



__
ESS-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/ess-help


[R] Moving 2nd column into 1st column using R

2019-09-09 Thread smart hendsome via R-help
Hi R-user,
I have a problem regarding R.  How can I move my 2nd column into 1st column.  
For example I have data as below:
 mydf <- data.frame(matrix(1:6, ncol = 2))
 mydf
  X1 X2   1   4   2   5   3   6
I want move my 2nd column become like this:
  X1    1      2    3    4   5   6
Hope anyone can help me. Many thanks.

Zuhri
 
[[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] Choosing specific Date Range from non-sequential Date

2019-09-09 Thread Ogbos Okike
Dear All,
Many thanks for all your contributions, suggestions and advice.
I find them all useful.
Best wishes
Ogbos

On Mon, Sep 9, 2019 at 9:35 PM Rui Barradas  wrote:
>
> Hello,
>
> I cannot reproduce the error but I coerce to class "Date" first.
>
>
> MOSCFD50[[1]] <- as.Date(MOSCFD50[[1]])
> names(MOSCFD50) <- c("date", "value")
>
> # Your subset
> Year <- subset(MOSCFD50, date > "1998-01-01" & date < "2005-12-31")
>
> # Another way, if there are NA's, use which(i)
> i <- MOSCFD50$date > "1998-01-01" & MOSCFD50$date < "2005-12-31"
> Year2 <- MOSCFD50[i, ]
>
> identical(Year, Year2)
> #[1] TRUE
>
>
> Data:
>
>
> MOSCFD50 <- read.table(text = "
> 1997-11-23 -2.91709629064653
> 1997-12-07 -0.960255426066815
> 1997-12-11 -1.98210752999868
> 1997-12-20 -1.10800598439855
> 1998-01-01 -1.00090115428118
> 1998-01-29 -1.03056081882709
> 1998-03-27 -0.873243859498216
> 1998-04-09 -2.06378384750109
> 1998-04-12 -2.06826431469008
> 1998-04-19 -2.49834620746286
> 1998-05-02 -6.4357083781542
> 1998-05-17 -2.25359807972754
> 1998-05-21 -2.55799006865995
> 1999-08-22 -2.25114162617707
> 1999-08-25 -1.47905397376409
> 1999-09-05 -0.641589808755325
> 1999-09-09 -0.648954682695949
> 1999-09-13 -0.726364489272492
> 1999-09-16 -1.28445236942011
> ")
>
>
> Hope this helps,
>
> Rui Barradas
>
>
> Às 20:14 de 09/09/19, Ogbos Okike escreveu:
> > Dear Bert and Jeff,
> > Thank you for looking at this.
> > I am surprised my message was not in plain text. It has been
> > configured to send message to the list in plain text earlier before.
> >
> > The data again please.
> >
> > 1997-11-23 -2.91709629064653
> > 1997-12-07 -0.960255426066815
> > 1997-12-11 -1.98210752999868
> > 1997-12-20 -1.10800598439855
> > 1998-01-01 -1.00090115428118
> > 1998-01-29 -1.03056081882709
> > 1998-03-27 -0.873243859498216
> > 1998-04-09 -2.06378384750109
> > 1998-04-12 -2.06826431469008
> > 1998-04-19 -2.49834620746286
> > 1998-05-02 -6.4357083781542
> > 1998-05-17 -2.25359807972754
> > 1998-05-21 -2.55799006865995
> > 1999-08-22 -2.25114162617707
> > 1999-08-25 -1.47905397376409
> > 1999-09-05 -0.641589808755325
> > 1999-09-09 -0.648954682695949
> > 1999-09-13 -0.726364489272492
> > 1999-09-16 -1.28445236942011
> >
> > The first column is  date and the second is another data of interest.
> >
> > The date is long but note sequential. Runs randomly from 1953 to 2019.
> >
> > I would like to select any range of date from year A to year B.
> >
> > Thank you again for your help.
> > Best
> > Ogbos
> >
> >
> > On Mon, Sep 9, 2019 at 6:18 PM Jeff Newmiller  
> > wrote:
> >>
> >> Or the column is not named "date", or it is a factor... and the question 
> >> is not posted in plain text
> >>
> >> On September 9, 2019 9:55:48 AM PDT, Bert Gunter  
> >> wrote:
> >>> I would guess that you first need to convert your textual dates to a
> >>> date-time object via as.date, but as you failed to provide a
> >>> reproducible
> >>> example (e.g. via dput) I may be wrong. Maybe others may have greater
> >>> insight.
> >>>
> >>> Bert Gunter
> >>>
> >>> "The trouble with having an open mind is that people keep coming along
> >>> and
> >>> sticking things into it."
> >>> -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
> >>>
> >>>
> >>> On Mon, Sep 9, 2019 at 8:55 AM Ogbos Okike 
> >>> wrote:
> >>>
>  Dear Contributors,
>  I have a data frame of the form:
>  1997-11-23 -2.91709629064653
>  1997-12-07 -0.960255426066815
>  1997-12-11 -1.98210752999868
>  1997-12-20 -1.10800598439855
>  1998-01-01 -1.00090115428118
>  1998-01-29 -1.03056081882709
>  1998-03-27 -0.873243859498216
>  1998-04-09 -2.06378384750109
>  1998-04-12 -2.06826431469008
>  1998-04-19 -2.49834620746286
>  1998-05-02 -6.4357083781542
>  1998-05-17 -2.25359807972754
>  1998-05-21 -2.55799006865995
>  1999-08-22 -2.25114162617707
>  1999-08-25 -1.47905397376409
>  1999-09-05 -0.641589808755325
>  1999-09-09 -0.648954682695949
>  1999-09-13 -0.726364489272492
>  1999-09-16 -1.28445236942011
> 
>  The events happen randomly and so the date is non-sequential. It run
> >>> form
>  1953 to 2019.
> 
>  I would like to select all the events/dates between 1998 to 2005.
> 
>  One of the things I tried is:
>  Year <- subset(MOSCFD50, date > "1998-01-01" & date < "2005-12-31").
> 
>  But it didn't work.
> 
>  I would be thankful if you could please redirect me.
> 
>  Thank you very much.
>  Best regards
>  Ogbos
> 
>   [[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] R_BATCH_OPTIONS not respected?

2019-09-09 Thread Marius Hofert
Hi,

I typically start R with "--no-restore --no-save" (to avoid .RData
files being written) and would like to have the same behavior under 'R
CMD BATCH'. I use R_BATCH_OPTIONS="--no-restore --no-save" in my
~/.Renviron but running an R script with 'R CMD BATCH' still produces
a .RData file. What's the correct way of getting the '--no-restore
--no-save' options when in batch mode?

(This is on macOS 10.14.6 with R version 3.6.1)

Thanks & cheers,
M

__
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] Choosing specific Date Range from non-sequential Date

2019-09-09 Thread Rui Barradas

Hello,

I cannot reproduce the error but I coerce to class "Date" first.


MOSCFD50[[1]] <- as.Date(MOSCFD50[[1]])
names(MOSCFD50) <- c("date", "value")

# Your subset
Year <- subset(MOSCFD50, date > "1998-01-01" & date < "2005-12-31")

# Another way, if there are NA's, use which(i)
i <- MOSCFD50$date > "1998-01-01" & MOSCFD50$date < "2005-12-31"
Year2 <- MOSCFD50[i, ]

identical(Year, Year2)
#[1] TRUE


Data:


MOSCFD50 <- read.table(text = "
1997-11-23 -2.91709629064653
1997-12-07 -0.960255426066815
1997-12-11 -1.98210752999868
1997-12-20 -1.10800598439855
1998-01-01 -1.00090115428118
1998-01-29 -1.03056081882709
1998-03-27 -0.873243859498216
1998-04-09 -2.06378384750109
1998-04-12 -2.06826431469008
1998-04-19 -2.49834620746286
1998-05-02 -6.4357083781542
1998-05-17 -2.25359807972754
1998-05-21 -2.55799006865995
1999-08-22 -2.25114162617707
1999-08-25 -1.47905397376409
1999-09-05 -0.641589808755325
1999-09-09 -0.648954682695949
1999-09-13 -0.726364489272492
1999-09-16 -1.28445236942011
")


Hope this helps,

Rui Barradas


Às 20:14 de 09/09/19, Ogbos Okike escreveu:

Dear Bert and Jeff,
Thank you for looking at this.
I am surprised my message was not in plain text. It has been
configured to send message to the list in plain text earlier before.

The data again please.

1997-11-23 -2.91709629064653
1997-12-07 -0.960255426066815
1997-12-11 -1.98210752999868
1997-12-20 -1.10800598439855
1998-01-01 -1.00090115428118
1998-01-29 -1.03056081882709
1998-03-27 -0.873243859498216
1998-04-09 -2.06378384750109
1998-04-12 -2.06826431469008
1998-04-19 -2.49834620746286
1998-05-02 -6.4357083781542
1998-05-17 -2.25359807972754
1998-05-21 -2.55799006865995
1999-08-22 -2.25114162617707
1999-08-25 -1.47905397376409
1999-09-05 -0.641589808755325
1999-09-09 -0.648954682695949
1999-09-13 -0.726364489272492
1999-09-16 -1.28445236942011

The first column is  date and the second is another data of interest.

The date is long but note sequential. Runs randomly from 1953 to 2019.

I would like to select any range of date from year A to year B.

Thank you again for your help.
Best
Ogbos


On Mon, Sep 9, 2019 at 6:18 PM Jeff Newmiller  wrote:


Or the column is not named "date", or it is a factor... and the question is not 
posted in plain text

On September 9, 2019 9:55:48 AM PDT, Bert Gunter  wrote:

I would guess that you first need to convert your textual dates to a
date-time object via as.date, but as you failed to provide a
reproducible
example (e.g. via dput) I may be wrong. Maybe others may have greater
insight.

Bert Gunter

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


On Mon, Sep 9, 2019 at 8:55 AM Ogbos Okike 
wrote:


Dear Contributors,
I have a data frame of the form:
1997-11-23 -2.91709629064653
1997-12-07 -0.960255426066815
1997-12-11 -1.98210752999868
1997-12-20 -1.10800598439855
1998-01-01 -1.00090115428118
1998-01-29 -1.03056081882709
1998-03-27 -0.873243859498216
1998-04-09 -2.06378384750109
1998-04-12 -2.06826431469008
1998-04-19 -2.49834620746286
1998-05-02 -6.4357083781542
1998-05-17 -2.25359807972754
1998-05-21 -2.55799006865995
1999-08-22 -2.25114162617707
1999-08-25 -1.47905397376409
1999-09-05 -0.641589808755325
1999-09-09 -0.648954682695949
1999-09-13 -0.726364489272492
1999-09-16 -1.28445236942011

The events happen randomly and so the date is non-sequential. It run

form

1953 to 2019.

I would like to select all the events/dates between 1998 to 2005.

One of the things I tried is:
Year <- subset(MOSCFD50, date > "1998-01-01" & date < "2005-12-31").

But it didn't work.

I would be thankful if you could please redirect me.

Thank you very much.
Best regards
Ogbos

 [[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.


--
Sent from my phone. Please excuse my brevity.


__
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 

Re: [R] Choosing specific Date Range from non-sequential Date

2019-09-09 Thread William Dunlap via R-help
To get a quick answer to your question you should provide a smallexample
that one can simply copy and paste into an R session.  It also helps to
show some details about how something does not work, more than " But it
didn't work."   E.g.,

d <- read.table(header=FALSE, text="1997-11-23 -2.91709629064653
1997-12-07 -0.960255426066815
1997-12-11 -1.98210752999868
1997-12-20 -1.10800598439855
1998-01-01 -1.00090115428118
1998-01-29 -1.03056081882709")
names(d) <- c("date", "measurement")
subset(d, date > "1997-12-15" & date < "1998-01-16")

which gave:

[1] datemeasurement
<0 rows> (or 0-length row.names)
Warning messages:
1: In Ops.factor(date, "1997-12-15") : ‘>’ not meaningful for factors
2: In Ops.factor(date, "1998-01-16") : ‘<’ not meaningful for factors

People seeing the call to read.table() and the warning messages from
subset() could quickly and confidently recommend adding
the colClasses=c("Date", "numeric") to the call to read.table.  Without
that information, both questioners and helpers become frustrated.

Bill Dunlap
TIBCO Software
wdunlap tibco.com


On Mon, Sep 9, 2019 at 12:15 PM Ogbos Okike 
wrote:

> Dear Bert and Jeff,
> Thank you for looking at this.
> I am surprised my message was not in plain text. It has been
> configured to send message to the list in plain text earlier before.
>
> The data again please.
>
> 1997-11-23 -2.91709629064653
> 1997-12-07 -0.960255426066815
> 1997-12-11 -1.98210752999868
> 1997-12-20 -1.10800598439855
> 1998-01-01 -1.00090115428118
> 1998-01-29 -1.03056081882709
> 1998-03-27 -0.873243859498216
> 1998-04-09 -2.06378384750109
> 1998-04-12 -2.06826431469008
> 1998-04-19 -2.49834620746286
> 1998-05-02 -6.4357083781542
> 1998-05-17 -2.25359807972754
> 1998-05-21 -2.55799006865995
> 1999-08-22 -2.25114162617707
> 1999-08-25 -1.47905397376409
> 1999-09-05 -0.641589808755325
> 1999-09-09 -0.648954682695949
> 1999-09-13 -0.726364489272492
> 1999-09-16 -1.28445236942011
>
> The first column is  date and the second is another data of interest.
>
> The date is long but note sequential. Runs randomly from 1953 to 2019.
>
> I would like to select any range of date from year A to year B.
>
> Thank you again for your help.
> Best
> Ogbos
>
>
> On Mon, Sep 9, 2019 at 6:18 PM Jeff Newmiller 
> wrote:
> >
> > Or the column is not named "date", or it is a factor... and the question
> is not posted in plain text
> >
> > On September 9, 2019 9:55:48 AM PDT, Bert Gunter 
> wrote:
> > >I would guess that you first need to convert your textual dates to a
> > >date-time object via as.date, but as you failed to provide a
> > >reproducible
> > >example (e.g. via dput) I may be wrong. Maybe others may have greater
> > >insight.
> > >
> > >Bert Gunter
> > >
> > >"The trouble with having an open mind is that people keep coming along
> > >and
> > >sticking things into it."
> > >-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
> > >
> > >
> > >On Mon, Sep 9, 2019 at 8:55 AM Ogbos Okike 
> > >wrote:
> > >
> > >> Dear Contributors,
> > >> I have a data frame of the form:
> > >> 1997-11-23 -2.91709629064653
> > >> 1997-12-07 -0.960255426066815
> > >> 1997-12-11 -1.98210752999868
> > >> 1997-12-20 -1.10800598439855
> > >> 1998-01-01 -1.00090115428118
> > >> 1998-01-29 -1.03056081882709
> > >> 1998-03-27 -0.873243859498216
> > >> 1998-04-09 -2.06378384750109
> > >> 1998-04-12 -2.06826431469008
> > >> 1998-04-19 -2.49834620746286
> > >> 1998-05-02 -6.4357083781542
> > >> 1998-05-17 -2.25359807972754
> > >> 1998-05-21 -2.55799006865995
> > >> 1999-08-22 -2.25114162617707
> > >> 1999-08-25 -1.47905397376409
> > >> 1999-09-05 -0.641589808755325
> > >> 1999-09-09 -0.648954682695949
> > >> 1999-09-13 -0.726364489272492
> > >> 1999-09-16 -1.28445236942011
> > >>
> > >> The events happen randomly and so the date is non-sequential. It run
> > >form
> > >> 1953 to 2019.
> > >>
> > >> I would like to select all the events/dates between 1998 to 2005.
> > >>
> > >> One of the things I tried is:
> > >> Year <- subset(MOSCFD50, date > "1998-01-01" & date < "2005-12-31").
> > >>
> > >> But it didn't work.
> > >>
> > >> I would be thankful if you could please redirect me.
> > >>
> > >> Thank you very much.
> > >> Best regards
> > >> Ogbos
> > >>
> > >> [[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 

[R] Choosing specific Date Range from non-sequential Date: Problem Fixed

2019-09-09 Thread Ogbos Okike
Dear Bert and Jeff,
The result is an output of another code and it will be too long or
unnecessary to show all I'm I did to arrive at the given data frame.

Since my single line code works for Jeff, I had to take a second look
and try to get it working for me. I then read the data frame using
d<-read.table("MOSC",colClasses=c("Date","numeric"))  and tried:
Year <- subset(d1, d1[[1]] > "1998-01-01" & d1[[1]] < "2006-01-01")
and arrived at my goal.

Thank you for the hint.
Best regards
Ogbos


On Mon, Sep 9, 2019 at 8:22 PM Jeff Newmiller  wrote:
>
> Works for me. Apparently you are not showing us everything you are doing. As 
> Bert recommended, you need to use the dput function rather than dumping 
> numbers into the email if we are to know how your data are stored in memory 
> which will affect what results you get. I highly recommend using the reprex 
> package to verify that your example is reproducible.
>
> On September 9, 2019 12:14:50 PM PDT, Ogbos Okike  
> wrote:
> >Dear Bert and Jeff,
> >Thank you for looking at this.
> >I am surprised my message was not in plain text. It has been
> >configured to send message to the list in plain text earlier before.
> >
> >The data again please.
> >
> >1997-11-23 -2.91709629064653
> >1997-12-07 -0.960255426066815
> >1997-12-11 -1.98210752999868
> >1997-12-20 -1.10800598439855
> >1998-01-01 -1.00090115428118
> >1998-01-29 -1.03056081882709
> >1998-03-27 -0.873243859498216
> >1998-04-09 -2.06378384750109
> >1998-04-12 -2.06826431469008
> >1998-04-19 -2.49834620746286
> >1998-05-02 -6.4357083781542
> >1998-05-17 -2.25359807972754
> >1998-05-21 -2.55799006865995
> >1999-08-22 -2.25114162617707
> >1999-08-25 -1.47905397376409
> >1999-09-05 -0.641589808755325
> >1999-09-09 -0.648954682695949
> >1999-09-13 -0.726364489272492
> >1999-09-16 -1.28445236942011
> >
> >The first column is  date and the second is another data of interest.
> >
> >The date is long but note sequential. Runs randomly from 1953 to 2019.
> >
> >I would like to select any range of date from year A to year B.
> >
> >Thank you again for your help.
> >Best
> >Ogbos
> >
> >
> >On Mon, Sep 9, 2019 at 6:18 PM Jeff Newmiller
> > wrote:
> >>
> >> Or the column is not named "date", or it is a factor... and the
> >question is not posted in plain text
> >>
> >> On September 9, 2019 9:55:48 AM PDT, Bert Gunter
> > wrote:
> >> >I would guess that you first need to convert your textual dates to a
> >> >date-time object via as.date, but as you failed to provide a
> >> >reproducible
> >> >example (e.g. via dput) I may be wrong. Maybe others may have
> >greater
> >> >insight.
> >> >
> >> >Bert Gunter
> >> >
> >> >"The trouble with having an open mind is that people keep coming
> >along
> >> >and
> >> >sticking things into it."
> >> >-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
> >> >
> >> >
> >> >On Mon, Sep 9, 2019 at 8:55 AM Ogbos Okike
> >
> >> >wrote:
> >> >
> >> >> Dear Contributors,
> >> >> I have a data frame of the form:
> >> >> 1997-11-23 -2.91709629064653
> >> >> 1997-12-07 -0.960255426066815
> >> >> 1997-12-11 -1.98210752999868
> >> >> 1997-12-20 -1.10800598439855
> >> >> 1998-01-01 -1.00090115428118
> >> >> 1998-01-29 -1.03056081882709
> >> >> 1998-03-27 -0.873243859498216
> >> >> 1998-04-09 -2.06378384750109
> >> >> 1998-04-12 -2.06826431469008
> >> >> 1998-04-19 -2.49834620746286
> >> >> 1998-05-02 -6.4357083781542
> >> >> 1998-05-17 -2.25359807972754
> >> >> 1998-05-21 -2.55799006865995
> >> >> 1999-08-22 -2.25114162617707
> >> >> 1999-08-25 -1.47905397376409
> >> >> 1999-09-05 -0.641589808755325
> >> >> 1999-09-09 -0.648954682695949
> >> >> 1999-09-13 -0.726364489272492
> >> >> 1999-09-16 -1.28445236942011
> >> >>
> >> >> The events happen randomly and so the date is non-sequential. It
> >run
> >> >form
> >> >> 1953 to 2019.
> >> >>
> >> >> I would like to select all the events/dates between 1998 to 2005.
> >> >>
> >> >> One of the things I tried is:
> >> >> Year <- subset(MOSCFD50, date > "1998-01-01" & date <
> >"2005-12-31").
> >> >>
> >> >> But it didn't work.
> >> >>
> >> >> I would be thankful if you could please redirect me.
> >> >>
> >> >> Thank you very much.
> >> >> Best regards
> >> >> Ogbos
> >> >>
> >> >> [[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, 

Re: [R] Choosing specific Date Range from non-sequential Date

2019-09-09 Thread Jeff Newmiller
Works for me. Apparently you are not showing us everything you are doing. As 
Bert recommended, you need to use the dput function rather than dumping numbers 
into the email if we are to know how your data are stored in memory which will 
affect what results you get. I highly recommend using the reprex package to 
verify that your example is reproducible.

On September 9, 2019 12:14:50 PM PDT, Ogbos Okike  
wrote:
>Dear Bert and Jeff,
>Thank you for looking at this.
>I am surprised my message was not in plain text. It has been
>configured to send message to the list in plain text earlier before.
>
>The data again please.
>
>1997-11-23 -2.91709629064653
>1997-12-07 -0.960255426066815
>1997-12-11 -1.98210752999868
>1997-12-20 -1.10800598439855
>1998-01-01 -1.00090115428118
>1998-01-29 -1.03056081882709
>1998-03-27 -0.873243859498216
>1998-04-09 -2.06378384750109
>1998-04-12 -2.06826431469008
>1998-04-19 -2.49834620746286
>1998-05-02 -6.4357083781542
>1998-05-17 -2.25359807972754
>1998-05-21 -2.55799006865995
>1999-08-22 -2.25114162617707
>1999-08-25 -1.47905397376409
>1999-09-05 -0.641589808755325
>1999-09-09 -0.648954682695949
>1999-09-13 -0.726364489272492
>1999-09-16 -1.28445236942011
>
>The first column is  date and the second is another data of interest.
>
>The date is long but note sequential. Runs randomly from 1953 to 2019.
>
>I would like to select any range of date from year A to year B.
>
>Thank you again for your help.
>Best
>Ogbos
>
>
>On Mon, Sep 9, 2019 at 6:18 PM Jeff Newmiller
> wrote:
>>
>> Or the column is not named "date", or it is a factor... and the
>question is not posted in plain text
>>
>> On September 9, 2019 9:55:48 AM PDT, Bert Gunter
> wrote:
>> >I would guess that you first need to convert your textual dates to a
>> >date-time object via as.date, but as you failed to provide a
>> >reproducible
>> >example (e.g. via dput) I may be wrong. Maybe others may have
>greater
>> >insight.
>> >
>> >Bert Gunter
>> >
>> >"The trouble with having an open mind is that people keep coming
>along
>> >and
>> >sticking things into it."
>> >-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
>> >
>> >
>> >On Mon, Sep 9, 2019 at 8:55 AM Ogbos Okike
>
>> >wrote:
>> >
>> >> Dear Contributors,
>> >> I have a data frame of the form:
>> >> 1997-11-23 -2.91709629064653
>> >> 1997-12-07 -0.960255426066815
>> >> 1997-12-11 -1.98210752999868
>> >> 1997-12-20 -1.10800598439855
>> >> 1998-01-01 -1.00090115428118
>> >> 1998-01-29 -1.03056081882709
>> >> 1998-03-27 -0.873243859498216
>> >> 1998-04-09 -2.06378384750109
>> >> 1998-04-12 -2.06826431469008
>> >> 1998-04-19 -2.49834620746286
>> >> 1998-05-02 -6.4357083781542
>> >> 1998-05-17 -2.25359807972754
>> >> 1998-05-21 -2.55799006865995
>> >> 1999-08-22 -2.25114162617707
>> >> 1999-08-25 -1.47905397376409
>> >> 1999-09-05 -0.641589808755325
>> >> 1999-09-09 -0.648954682695949
>> >> 1999-09-13 -0.726364489272492
>> >> 1999-09-16 -1.28445236942011
>> >>
>> >> The events happen randomly and so the date is non-sequential. It
>run
>> >form
>> >> 1953 to 2019.
>> >>
>> >> I would like to select all the events/dates between 1998 to 2005.
>> >>
>> >> One of the things I tried is:
>> >> Year <- subset(MOSCFD50, date > "1998-01-01" & date <
>"2005-12-31").
>> >>
>> >> But it didn't work.
>> >>
>> >> I would be thankful if you could please redirect me.
>> >>
>> >> Thank you very much.
>> >> Best regards
>> >> Ogbos
>> >>
>> >> [[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.
>>
>> --
>> Sent from my phone. Please excuse my brevity.

-- 
Sent from my phone. Please excuse my brevity.

__
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] Choosing specific Date Range from non-sequential Date

2019-09-09 Thread Ogbos Okike
Dear Bert and Jeff,
Thank you for looking at this.
I am surprised my message was not in plain text. It has been
configured to send message to the list in plain text earlier before.

The data again please.

1997-11-23 -2.91709629064653
1997-12-07 -0.960255426066815
1997-12-11 -1.98210752999868
1997-12-20 -1.10800598439855
1998-01-01 -1.00090115428118
1998-01-29 -1.03056081882709
1998-03-27 -0.873243859498216
1998-04-09 -2.06378384750109
1998-04-12 -2.06826431469008
1998-04-19 -2.49834620746286
1998-05-02 -6.4357083781542
1998-05-17 -2.25359807972754
1998-05-21 -2.55799006865995
1999-08-22 -2.25114162617707
1999-08-25 -1.47905397376409
1999-09-05 -0.641589808755325
1999-09-09 -0.648954682695949
1999-09-13 -0.726364489272492
1999-09-16 -1.28445236942011

The first column is  date and the second is another data of interest.

The date is long but note sequential. Runs randomly from 1953 to 2019.

I would like to select any range of date from year A to year B.

Thank you again for your help.
Best
Ogbos


On Mon, Sep 9, 2019 at 6:18 PM Jeff Newmiller  wrote:
>
> Or the column is not named "date", or it is a factor... and the question is 
> not posted in plain text
>
> On September 9, 2019 9:55:48 AM PDT, Bert Gunter  
> wrote:
> >I would guess that you first need to convert your textual dates to a
> >date-time object via as.date, but as you failed to provide a
> >reproducible
> >example (e.g. via dput) I may be wrong. Maybe others may have greater
> >insight.
> >
> >Bert Gunter
> >
> >"The trouble with having an open mind is that people keep coming along
> >and
> >sticking things into it."
> >-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
> >
> >
> >On Mon, Sep 9, 2019 at 8:55 AM Ogbos Okike 
> >wrote:
> >
> >> Dear Contributors,
> >> I have a data frame of the form:
> >> 1997-11-23 -2.91709629064653
> >> 1997-12-07 -0.960255426066815
> >> 1997-12-11 -1.98210752999868
> >> 1997-12-20 -1.10800598439855
> >> 1998-01-01 -1.00090115428118
> >> 1998-01-29 -1.03056081882709
> >> 1998-03-27 -0.873243859498216
> >> 1998-04-09 -2.06378384750109
> >> 1998-04-12 -2.06826431469008
> >> 1998-04-19 -2.49834620746286
> >> 1998-05-02 -6.4357083781542
> >> 1998-05-17 -2.25359807972754
> >> 1998-05-21 -2.55799006865995
> >> 1999-08-22 -2.25114162617707
> >> 1999-08-25 -1.47905397376409
> >> 1999-09-05 -0.641589808755325
> >> 1999-09-09 -0.648954682695949
> >> 1999-09-13 -0.726364489272492
> >> 1999-09-16 -1.28445236942011
> >>
> >> The events happen randomly and so the date is non-sequential. It run
> >form
> >> 1953 to 2019.
> >>
> >> I would like to select all the events/dates between 1998 to 2005.
> >>
> >> One of the things I tried is:
> >> Year <- subset(MOSCFD50, date > "1998-01-01" & date < "2005-12-31").
> >>
> >> But it didn't work.
> >>
> >> I would be thankful if you could please redirect me.
> >>
> >> Thank you very much.
> >> Best regards
> >> Ogbos
> >>
> >> [[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.
>
> --
> Sent from my phone. Please excuse my brevity.

__
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 split a column by tab ?

2019-09-09 Thread Rui Barradas

Hello,

I'm glad it helped.
One more thing. I forgot to set the column names, if you want to get 
them from the data, try something like this:


nms <- lapply(s, function(.s) .s[grepl("[[:alpha:]]+", .s)])
nms <- sapply(nms, paste, collapse = ".")
names(daT3) <- nms
daT3


Hope this helps,

Rui Barradas

Às 16:28 de 09/09/19, Marna Wagley escreveu:

Thank you Rui. it helped a lot.
Sincerely,
MW

On Mon, Sep 9, 2019 at 6:47 AM Rui Barradas > wrote:


Hello,

You could try a character class instead of one character (the tab char).
There are two character classes that you can try, [:blank:] and
[:space:], see ?regex.

strsplit(as.character(daT1), "[[:blank:]]+")

Then form the final result. I have changed rbind to cbind, it seemed
more appropriate (?).

s <- strsplit(as.character(daT1), "[[:blank:]]+")
x <- lapply(s, function(.s) .s[!grepl("[[:alpha:]]+", .s)])
daT3 <- as.data.frame(do.call(cbind, x))
daT3


Hope this helps,

Rui Barradas

Às 12:54 de 09/09/19, Marna Wagley escreveu:
 > Hi R User,
 > I was trying to split a column by tabs, I tried to split with
several ways,
 > but I could not split it. Is there any possibilities?
 >
 > The data example and the code I used
 > daT1<-c("Column number             1    2    3    4    5    6   
7    8

 >   9   10   10   10   10   10   10   10",
 > "comes from position       1    7    2    6    3    5   15    9 
   4    8

 > 10   11   12   13   14   16"
 > )
 > daT2 <- data.frame(do.call('rbind',
 > strsplit(as.character(daT1),'\t',fixed=T)))
 > colnames(daT2)
 > daT2
 >
 >       [[alternative HTML version deleted]]
 >
 > __
 > R-help@r-project.org  mailing list
-- To UNSUBSCRIBE and more, see
 > https://stat.ethz.ch/mailman/listinfo/r-help
 > PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
 > and provide commented, minimal, self-contained, reproducible code.
 >

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



__
R-help@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

2019-09-09 Thread Sarah Goslee
You can use the vector of integer cluster numbers with silhouette()
from the cluster package.

https://www.rdocumentation.org/packages/cluster/versions/2.1.0/topics/silhouette


But note that silhouette as an assessment metric makes roughly the
same assumptions that k-means does about the data structure, and may
not return useful results with other clustering methods.

Sarah

On Mon, Sep 9, 2019 at 12:01 PM Nicola Fiedler  wrote:
>
> Hi together,
>
> I’m new using R and have a question concerning the Silhouette coefficient. 
> I’ve clustered very easy objects with Affinity Propagation.
> My data just has one numeric attribute.
>
> apres <- apcluster(negDistMat(r=2), data, details=TRUE)
> show(apres)
>
>
>
> This worked very well. To compare with other algorithms I want to know the 
> Silhouette coefficient.
> The function I use for the other algorithms doesn’t work for AP (clvalid or 
> fviz_nbclust).
> So my question is, how I can get the Silhouette coefficient for the 
> clustering with AP?
>
> Thank you very much in advance for your help.
>
-- 
Sarah Goslee (she/her)
http://www.numberwrigtht.com

__
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] export the patch results landscapemetrics

2019-09-09 Thread Jeff Newmiller
Wrong mailing list. Read the Posting Guide and the package description.

On September 7, 2019 11:34:29 AM PDT, Jon Hak  wrote:
>I've used SDMTools and Fragstats frequently and I'm trying out the 
>recently published landscapemetrics.  I'e worked through the agusta
>demo 
>that came with the package so I think I've got a handle on how to 
>process the models I would like to use, but I 'm a bit stumped.  the 
>show_patches() is what I would like to export out to a new raster to 
>display/use the patch results in a GIS. Show_pataches() creates a  
>Gabriel graph, but I want a raster similar to STMTools or regiongroup 
>(ArcGIS).
>
>Thanks for any help,
>
>Jon
>
>__
>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.

-- 
Sent from my phone. Please excuse my brevity.

__
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] Choosing specific Date Range from non-sequential Date

2019-09-09 Thread Jeff Newmiller
Or the column is not named "date", or it is a factor... and the question is not 
posted in plain text

On September 9, 2019 9:55:48 AM PDT, Bert Gunter  wrote:
>I would guess that you first need to convert your textual dates to a
>date-time object via as.date, but as you failed to provide a
>reproducible
>example (e.g. via dput) I may be wrong. Maybe others may have greater
>insight.
>
>Bert Gunter
>
>"The trouble with having an open mind is that people keep coming along
>and
>sticking things into it."
>-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )
>
>
>On Mon, Sep 9, 2019 at 8:55 AM Ogbos Okike 
>wrote:
>
>> Dear Contributors,
>> I have a data frame of the form:
>> 1997-11-23 -2.91709629064653
>> 1997-12-07 -0.960255426066815
>> 1997-12-11 -1.98210752999868
>> 1997-12-20 -1.10800598439855
>> 1998-01-01 -1.00090115428118
>> 1998-01-29 -1.03056081882709
>> 1998-03-27 -0.873243859498216
>> 1998-04-09 -2.06378384750109
>> 1998-04-12 -2.06826431469008
>> 1998-04-19 -2.49834620746286
>> 1998-05-02 -6.4357083781542
>> 1998-05-17 -2.25359807972754
>> 1998-05-21 -2.55799006865995
>> 1999-08-22 -2.25114162617707
>> 1999-08-25 -1.47905397376409
>> 1999-09-05 -0.641589808755325
>> 1999-09-09 -0.648954682695949
>> 1999-09-13 -0.726364489272492
>> 1999-09-16 -1.28445236942011
>>
>> The events happen randomly and so the date is non-sequential. It run
>form
>> 1953 to 2019.
>>
>> I would like to select all the events/dates between 1998 to 2005.
>>
>> One of the things I tried is:
>> Year <- subset(MOSCFD50, date > "1998-01-01" & date < "2005-12-31").
>>
>> But it didn't work.
>>
>> I would be thankful if you could please redirect me.
>>
>> Thank you very much.
>> Best regards
>> Ogbos
>>
>> [[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.

-- 
Sent from my phone. Please excuse my brevity.

__
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] Choosing specific Date Range from non-sequential Date

2019-09-09 Thread Bert Gunter
I would guess that you first need to convert your textual dates to a
date-time object via as.date, but as you failed to provide a reproducible
example (e.g. via dput) I may be wrong. Maybe others may have greater
insight.

Bert Gunter

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


On Mon, Sep 9, 2019 at 8:55 AM Ogbos Okike  wrote:

> Dear Contributors,
> I have a data frame of the form:
> 1997-11-23 -2.91709629064653
> 1997-12-07 -0.960255426066815
> 1997-12-11 -1.98210752999868
> 1997-12-20 -1.10800598439855
> 1998-01-01 -1.00090115428118
> 1998-01-29 -1.03056081882709
> 1998-03-27 -0.873243859498216
> 1998-04-09 -2.06378384750109
> 1998-04-12 -2.06826431469008
> 1998-04-19 -2.49834620746286
> 1998-05-02 -6.4357083781542
> 1998-05-17 -2.25359807972754
> 1998-05-21 -2.55799006865995
> 1999-08-22 -2.25114162617707
> 1999-08-25 -1.47905397376409
> 1999-09-05 -0.641589808755325
> 1999-09-09 -0.648954682695949
> 1999-09-13 -0.726364489272492
> 1999-09-16 -1.28445236942011
>
> The events happen randomly and so the date is non-sequential. It run form
> 1953 to 2019.
>
> I would like to select all the events/dates between 1998 to 2005.
>
> One of the things I tried is:
> Year <- subset(MOSCFD50, date > "1998-01-01" & date < "2005-12-31").
>
> But it didn't work.
>
> I would be thankful if you could please redirect me.
>
> Thank you very much.
> Best regards
> Ogbos
>
> [[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.


[R] help

2019-09-09 Thread Nicola Fiedler
Hi together,

I’m new using R and have a question concerning the Silhouette coefficient. I’ve 
clustered very easy objects with Affinity Propagation.
My data just has one numeric attribute.

apres <- apcluster(negDistMat(r=2), data, details=TRUE)
show(apres)



This worked very well. To compare with other algorithms I want to know the 
Silhouette coefficient.
The function I use for the other algorithms doesn’t work for AP (clvalid or 
fviz_nbclust).
So my question is, how I can get the Silhouette coefficient for the clustering 
with AP?

Thank you very much in advance for your help.

__
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] export the patch results landscapemetrics

2019-09-09 Thread Jon Hak
I've used SDMTools and Fragstats frequently and I'm trying out the 
recently published landscapemetrics.  I'e worked through the agusta demo 
that came with the package so I think I've got a handle on how to 
process the models I would like to use, but I 'm a bit stumped.  the 
show_patches() is what I would like to export out to a new raster to 
display/use the patch results in a GIS. Show_pataches() creates a  
Gabriel graph, but I want a raster similar to STMTools or regiongroup 
(ArcGIS).


Thanks for any help,

Jon

__
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] Choosing specific Date Range from non-sequential Date

2019-09-09 Thread Ogbos Okike
Dear Contributors,
I have a data frame of the form:
1997-11-23 -2.91709629064653
1997-12-07 -0.960255426066815
1997-12-11 -1.98210752999868
1997-12-20 -1.10800598439855
1998-01-01 -1.00090115428118
1998-01-29 -1.03056081882709
1998-03-27 -0.873243859498216
1998-04-09 -2.06378384750109
1998-04-12 -2.06826431469008
1998-04-19 -2.49834620746286
1998-05-02 -6.4357083781542
1998-05-17 -2.25359807972754
1998-05-21 -2.55799006865995
1999-08-22 -2.25114162617707
1999-08-25 -1.47905397376409
1999-09-05 -0.641589808755325
1999-09-09 -0.648954682695949
1999-09-13 -0.726364489272492
1999-09-16 -1.28445236942011

The events happen randomly and so the date is non-sequential. It run form
1953 to 2019.

I would like to select all the events/dates between 1998 to 2005.

One of the things I tried is:
Year <- subset(MOSCFD50, date > "1998-01-01" & date < "2005-12-31").

But it didn't work.

I would be thankful if you could please redirect me.

Thank you very much.
Best regards
Ogbos

[[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] structure of NIRsoil

2019-09-09 Thread Jeff Newmiller
Beginners should definitely read the Posting Guide mentioned in the footer of 
this and every message from this mailing list. One key point is that this 
mailing list is for plain text format only, and your message gets damaged to 
varying degrees when you fail to set the plain text format option in your email 
program. (there are too many email programs for us to be able to help you 
figure out how to do that... that is up to you.)

Another point from the PG worth mentioning is that contributed packages are not 
strictly speaking on topic here. There should be a hint as to where to ask 
questions about it in the description [1].

You should learn about the base R function str.  Try typing

?str

at the R console (command line)

[1] https://cran.r-project.org/web/packages/prospectr/index.html see URL

On September 9, 2019 1:21:04 AM PDT, rhotu...@yahoo.co.jp wrote:
>Dear Sir,
>
>After installing prospectr, 
>> data(NIRsoil)> mode(NIRsoil)[1] "list"> 
>I am a beginner and the structure of “NIRsoil” is complicated.
>
>Judging from the explanation of NIRsoil (see below), there are six
>elements: NT, Ciso, CEC, train, validation, spc.
>
>Please tell me how to know the structure of such “NIRsoil”.
>When using mode (NIRsoil) , The answer is just a “list”.
>Is there a command or function "Detailstructure (NIRsoil)"?
>> NIRsoil
>.
>.     spc.2494  spc.2496  spc.24981   0.3724227 0.3724588 0.37256772 
> 0.3159643 0.3164802 0.31681803   0.3416802 0.3422180 0.34263164 
> 0.3650448 0.3654987 0.36580555   0.3050233 0.3058226 0.30640076 
> 0.3599009 0.3603650 0.36070207   0.3365467 0.3369826 0.33725788 
> 0.3922267 0.3926329 0.39288209   0.3149452 0.3153307 0.315540410 
>0.4951153 0.4954152 0.495766411  0.3414548 0.3418657 0.342114012 
>0.3314737 0.3319690 0.332336513  0.4153854 0.4156993 0.416079614 
>0.3311567 0.3316245 0.331926815  0.3289777 0.3294281 0.329720616 
>0.4268982 0.4274236 0.427819517  0.3421552 0.3426531 0.342981518 
>0.3452011 0.3457459 0.346121719  0.3497368 0.3497175 0.349840320 
>0.3896840 0.3901652 0.390537521  0.4062244 0.4066894 0.407021322 
>0.3792031 0.3796499 0.379960123  0.3252305 0.3256037 0.325836624 
>0.3427994 0.3431511 0.343363125  0.3410443 0.3414203 0.341648926 
>0.3947710 0.3952165 0.395562027  0.2930943 0.2934901 0.293697728 
>0.4138924 0.4144398 0.414861929  0.2906964 0.2910948 0.291324130 
>0.4000607 0.4004497 0.400749131  0.3275807 0.3278961 0.328067632 
>0.3343273 0.3347059 0.334947033  0.2923162 0.2927208 0.292952534 
>0.3181143 0.3184221 0.318574835  0.3959161 0.3963806 0.396695436 
>0.3412020 0.3415608 0.341737737  0.3109980 0.3119904 0.312796538 
>0.3452408 0.3457109 0.346040139  0.2352630 0.2357922 0.236104440 
>0.3731434 0.3735985 0.373948341  0.3776968 0.3780733 0.378314142 
>0.4279117 0.4278319 0.427811343  0.3499106 0.3502492 0.350448044 
>0.4060152 0.4064416 0.406781645  0.4434104 0.4437352 0.444117646 
>0.3106347 0.3111292 0.311479047  0.3048005 0.3052686 0.30748 
>0.3074032 0.3078929 0.308188549  0.3099467 0.3103620 0.310607950 
>0.4140719 0.4140101 0.414070551  0.3047789 0.3051992 0.305453152 
>0.4372076 0.4371921 0.437301153  0.3784582 0.3788292 0.379046054 
>0.3070685 0.3074959 0.307739255  0.3929690 0.3930495 0.393248956 
>0.3104950 0.3109303 0.311175657  0.3110389 0.3114884 0.311783658 
>0.3561086 0.3565895 0.356935659  0.2946499 0.2950254 0.295230760 
>0.3396696 0.3402275 0.340604561  0.4174463 0.4174852 0.417609462 
>0.3838490 0.3845536 0.385175463  0.4214520 0.4217800 0.422008564 
>0.3136719 0.3141062 0.314410265  0.3137282 0.3141668 0.31466 
>0.4341556 0.4341235 0.434172067  0.3028214 0.3032053 0.303438768 
>0.2929183 0.2933525 0.293613269  0.2901444 0.2905667 0.290814470 
>0.2926482 0.2930853 0.293328871  0.3964101 0.3968658 0.397207272 
>0.3205706 0.3209653 0.321186973  0.2965653 0.2970253 0.297328574 
>0.3271259 0.3274269 0.327623075  0.2910520 0.2914549 0.291697476 
>0.3266725 0.3271569 0.327475777  0.3405427 0.3410150 0.341319778 
>0.3164929 0.3169560 0.317269479  0.3489597 0.3495394 0.349918280 
>0.3369682 0.3374025 0.337660681  0.2608885 0.2613245 0.261581182 
>0.3132109 0.3136024 0.313788183  0.3155325 0.3159175 0.316144884 
>0.3156847 0.3160608 0.316250785  0.2751068 0.2754884 0.275712986 
>0.2722970 0.2726988 0.272900087  0.3421156 0.3424138 0.342577688 
>0.4408897 0.4413919 0.441767389  0.4094418 0.4098032 0.410052590 
>0.2883307 0.2887366 0.288972191  0.3368085 0.3373375 0.337674492 
>0.2914632 0.2918586 0.292056993  0.3701615 0.3703609 0.370657894 
>0.3168159 0.3172900 0.317585795  0.3141627 0.3145356 0.314785296 
>0.2717998 0.2721882 0.272409297  0.2994829 0.2998522 0.300074998 
>0.4238313 0.4238643 0.423967099  0.3173946 0.3178398 0.3181364100
>0.3065352 0.3070051 0.3073053101 0.4119025 0.4122178 0.4126194102
>0.2997539 0.3001756 0.3004323103 0.3195902 0.3200457 0.3203547104
>0.3770273 0.3775299 0.3779288105 0.3119653 0.3123196 0.3125118106
>0.3007703 0.3012067 0.3014555107 0.3583141 0.3586335 0.3588411108
>0.3613160 0.3616626 

Re: [R] Problems installing Dependences of my package

2019-09-09 Thread Jeff Newmiller
Wrong mailing list (use R-package-devel. Don't post HTML... your email is full 
of unreadable characters.

On September 8, 2019 11:27:27 PM PDT, "VILAR ÁLVAREZ ANDREA" 
 wrote:
>
>Hi,
>
>I am writting because I am doing a package in R and I have some
>problems installing dependences which appear at DESCRIPTION file.
>
>First of all, I am not sure about the difference between �Depends� and
>�Imports�, but I only use �Depends�.
>My problem is that my package is going to be used at different
>computers and for different persons so I want that when other person
>use my package, it can be able to check  if the necesary packages are
>installed and if they are not installed, the package must be able to
>install  them.
>I supposed that this problem was solved including the necesary packages
>and their versions at �Depends�. And now, I have another problem
>because the versions are usually indicated using �>=�, for example:
>forecast (>=8.7) but I need to use exactly the versi�n 8.7 because
>sometimes when packages are updated, they lost some functions. But if I
>use �<=� or �==� and the package is update to versi�n 8.8, my package
>installation fail.
>How can I solve this? If I use R normaly (outside my package), I can
>install older versions of other packages using
>devtools::install_version() so why when I indicate � forecast (<=8.7)�
>at Depends on the DESCRIPTION file, R is not able to install an older
>version if a new one is avaliable?
>
>Thanks in advance for your attention.
>
>Best regards,
>
>Andrea.
>
>
>   [[alternative HTML version deleted]]

-- 
Sent from my phone. Please excuse my brevity.

__
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] [R-pkgs] New package sclr for scaled logit model

2019-09-09 Thread Arseniy Khvorov
A new package "sclr" for fitting the "scaled logit" model from Dunning 
(2006)   is available.


CRAN: https://cran.r-project.org/package=sclr
Github: https://github.com/khvorov45/sclr

I appreciate any feedback.

Best regards,
Arseniy Khvorov

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

__
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] structure of NIRsoil

2019-09-09 Thread rhotuser
Dear Sir,

After installing prospectr, 
> data(NIRsoil)> mode(NIRsoil)[1] "list"> 
I am a beginner and the structure of “NIRsoil” is complicated.

Judging from the explanation of NIRsoil (see below), there are six elements: 
NT, Ciso, CEC, train, validation, spc.

Please tell me how to know the structure of such “NIRsoil”.
When using mode (NIRsoil) , The answer is just a “list”.
Is there a command or function "Detailstructure (NIRsoil)"?
> NIRsoil
.
.     spc.2494  spc.2496  spc.24981   0.3724227 0.3724588 0.37256772   
0.3159643 0.3164802 0.31681803   0.3416802 0.3422180 0.34263164   0.3650448 
0.3654987 0.36580555   0.3050233 0.3058226 0.30640076   0.3599009 0.3603650 
0.36070207   0.3365467 0.3369826 0.33725788   0.3922267 0.3926329 0.39288209   
0.3149452 0.3153307 0.315540410  0.4951153 0.4954152 0.495766411  0.3414548 
0.3418657 0.342114012  0.3314737 0.3319690 0.332336513  0.4153854 0.4156993 
0.416079614  0.3311567 0.3316245 0.331926815  0.3289777 0.3294281 0.329720616  
0.4268982 0.4274236 0.427819517  0.3421552 0.3426531 0.342981518  0.3452011 
0.3457459 0.346121719  0.3497368 0.3497175 0.349840320  0.3896840 0.3901652 
0.390537521  0.4062244 0.4066894 0.407021322  0.3792031 0.3796499 0.379960123  
0.3252305 0.3256037 0.325836624  0.3427994 0.3431511 0.343363125  0.3410443 
0.3414203 0.341648926  0.3947710 0.3952165 0.395562027  0.2930943 0.2934901 
0.293697728  0.4138924 0.4144398 0.414861929  0.2906964 0.2910948 0.291324130  
0.4000607 0.4004497 0.400749131  0.3275807 0.3278961 0.328067632  0.3343273 
0.3347059 0.334947033  0.2923162 0.2927208 0.292952534  0.3181143 0.3184221 
0.318574835  0.3959161 0.3963806 0.396695436  0.3412020 0.3415608 0.341737737  
0.3109980 0.3119904 0.312796538  0.3452408 0.3457109 0.346040139  0.2352630 
0.2357922 0.236104440  0.3731434 0.3735985 0.373948341  0.3776968 0.3780733 
0.378314142  0.4279117 0.4278319 0.427811343  0.3499106 0.3502492 0.350448044  
0.4060152 0.4064416 0.406781645  0.4434104 0.4437352 0.444117646  0.3106347 
0.3111292 0.311479047  0.3048005 0.3052686 0.30748  0.3074032 0.3078929 
0.308188549  0.3099467 0.3103620 0.310607950  0.4140719 0.4140101 0.414070551  
0.3047789 0.3051992 0.305453152  0.4372076 0.4371921 0.437301153  0.3784582 
0.3788292 0.379046054  0.3070685 0.3074959 0.307739255  0.3929690 0.3930495 
0.393248956  0.3104950 0.3109303 0.311175657  0.3110389 0.3114884 0.311783658  
0.3561086 0.3565895 0.356935659  0.2946499 0.2950254 0.295230760  0.3396696 
0.3402275 0.340604561  0.4174463 0.4174852 0.417609462  0.3838490 0.3845536 
0.385175463  0.4214520 0.4217800 0.422008564  0.3136719 0.3141062 0.314410265  
0.3137282 0.3141668 0.31466  0.4341556 0.4341235 0.434172067  0.3028214 
0.3032053 0.303438768  0.2929183 0.2933525 0.293613269  0.2901444 0.2905667 
0.290814470  0.2926482 0.2930853 0.293328871  0.3964101 0.3968658 0.397207272  
0.3205706 0.3209653 0.321186973  0.2965653 0.2970253 0.297328574  0.3271259 
0.3274269 0.327623075  0.2910520 0.2914549 0.291697476  0.3266725 0.3271569 
0.327475777  0.3405427 0.3410150 0.341319778  0.3164929 0.3169560 0.317269479  
0.3489597 0.3495394 0.349918280  0.3369682 0.3374025 0.337660681  0.2608885 
0.2613245 0.261581182  0.3132109 0.3136024 0.313788183  0.3155325 0.3159175 
0.316144884  0.3156847 0.3160608 0.316250785  0.2751068 0.2754884 0.275712986  
0.2722970 0.2726988 0.272900087  0.3421156 0.3424138 0.342577688  0.4408897 
0.4413919 0.441767389  0.4094418 0.4098032 0.410052590  0.2883307 0.2887366 
0.288972191  0.3368085 0.3373375 0.337674492  0.2914632 0.2918586 0.292056993  
0.3701615 0.3703609 0.370657894  0.3168159 0.3172900 0.317585795  0.3141627 
0.3145356 0.314785296  0.2717998 0.2721882 0.272409297  0.2994829 0.2998522 
0.300074998  0.4238313 0.4238643 0.423967099  0.3173946 0.3178398 0.3181364100 
0.3065352 0.3070051 0.3073053101 0.4119025 0.4122178 0.4126194102 0.2997539 
0.3001756 0.3004323103 0.3195902 0.3200457 0.3203547104 0.3770273 0.3775299 
0.3779288105 0.3119653 0.3123196 0.3125118106 0.3007703 0.3012067 0.3014555107 
0.3583141 0.3586335 0.3588411108 0.3613160 0.3616626 0.3619002109 0.3012548 
0.3016973 0.3019971110 0.3040114 0.3044745 0.3047490111 0.3886676 0.3889934 
0.3894869112 0.3381325 0.3386472 0.3389995113 0.3228837 0.3232841 0.3235284114 
0.3175641 0.3179575 0.3182012115 0.3255604 0.3259808 0.3262322116 0.3038366 
0.3043306 0.3046326117 0.3040762 0.3045244 0.3048216118 0.3101427 0.3105674 
0.3108223119 0.3186323 0.3190890 0.3194055120 0.3183660 0.3188377 0.3191515121 
0.3716398 0.3723766 0.3729757122 0.3336347 0.3341000 0.3344247123 0.3013631 
0.3017261 0.3018954124 0.3559751 0.3563222 0.3565449125 0.3467284 0.3475789 
0.3482055126 0.2983477 0.2992734 0.316127 0.2966113 0.2970161 0.2972673128 
0.3244559 0.3249162 0.3252265129 0.3687044 0.3692860 0.3697534130 0.2949226 
0.2953484 0.2956104131 0.3449411 0.3454331 0.3457713132 0.3458079 0.3462659 
0.3465872133 0.3879239 0.3882694 0.3884915134 0.3998409 0.3997933 0.3999189135 
0.2591648 0.2596039 

[R] Problems installing Dependences of my package

2019-09-09 Thread VILAR ÁLVAREZ ANDREA

Hi,

I am writting because I am doing a package in R and I have some problems 
installing dependences which appear at DESCRIPTION file.

First of all, I am not sure about the difference between �Depends� and 
�Imports�, but I only use �Depends�.
My problem is that my package is going to be used at different computers and 
for different persons so I want that when other person use my package, it can 
be able to check  if the necesary packages are installed and if they are not 
installed, the package must be able to install  them.
I supposed that this problem was solved including the necesary packages and 
their versions at �Depends�. And now, I have another problem because the 
versions are usually indicated using �>=�, for example: forecast (>=8.7) but I 
need to use exactly the versi�n 8.7 because sometimes when packages are 
updated, they lost some functions. But if I use �<=� or �==� and the package is 
update to versi�n 8.8, my package installation fail.
How can I solve this? If I use R normaly (outside my package), I can install 
older versions of other packages using devtools::install_version() so why when 
I indicate � forecast (<=8.7)� at Depends on the DESCRIPTION file, R is not 
able to install an older version if a new one is avaliable?

Thanks in advance for your attention.

Best regards,

Andrea.


[[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] install.packages handles package vs package dependencies differently

2019-09-09 Thread Chase Clark
First post, please excuse any ignorance.

install.packages() seems to only respect install.packages(lib=) for
the specified package (in the below case {purrr}) and will ignore any
dependencies ({magrittr}, {rlang}) if they are found in any of the
directories in .libPaths() (e.g. R_LIBS).  The reason for the
inconsistency between the specified package and its dependencies seems
to be here:
https://github.com/wch/r-source/blob/d6c208e464d20adc6ce080ecfaaab4ccf3f06271/src/library/utils/R/packages2.R#L84-L88

Where, only for dependencies, .libPaths() is first checked for
installed.packages; but the same check doesn't occur for the specified
package.

Code to reproduce:
```
a <- file.path(tempdir(), "temp")
dir.create(a)
install.packages("purrr", dependencies = "Imports", lib = a)
list.dirs(a, recursive = FALSE)
```

Definition of 'lib' from ?install/packages : "character vector giving
the library directories where to install the packages. Recycled as
needed. If missing, defaults to the first element of .libPaths(). "

So, is this the desired behavior?  It would mean it's ?impossible? to
install a package to another location if it happens to be located
within R_LIBS; it also seems weird to have it work for the specified
package but not its dependencies.


Best,
Chase Clark
PhD Candidate
Murphy Lab
Center for Biomolecular Sciences
Department of Medicinal Chemistry and Pharmacognosy
University of Illinois at Chicago

__
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 split a column by tab ?

2019-09-09 Thread Rui Barradas

Hello,

You could try a character class instead of one character (the tab char).
There are two character classes that you can try, [:blank:] and 
[:space:], see ?regex.


strsplit(as.character(daT1), "[[:blank:]]+")

Then form the final result. I have changed rbind to cbind, it seemed 
more appropriate (?).


s <- strsplit(as.character(daT1), "[[:blank:]]+")
x <- lapply(s, function(.s) .s[!grepl("[[:alpha:]]+", .s)])
daT3 <- as.data.frame(do.call(cbind, x))
daT3


Hope this helps,

Rui Barradas

Às 12:54 de 09/09/19, Marna Wagley escreveu:

Hi R User,
I was trying to split a column by tabs, I tried to split with several ways,
but I could not split it. Is there any possibilities?

The data example and the code I used
daT1<-c("Column number 12345678
  9   10   10   10   10   10   10   10",
"comes from position   172635   15948
10   11   12   13   14   16"
)
daT2 <- data.frame(do.call('rbind',
strsplit(as.character(daT1),'\t',fixed=T)))
colnames(daT2)
daT2

[[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] how to split a column by tab ?

2019-09-09 Thread Marna Wagley
Hi R User,
I was trying to split a column by tabs, I tried to split with several ways,
but I could not split it. Is there any possibilities?

The data example and the code I used
daT1<-c("Column number 12345678
 9   10   10   10   10   10   10   10",
"comes from position   172635   15948
10   11   12   13   14   16"
)
daT2 <- data.frame(do.call('rbind',
strsplit(as.character(daT1),'\t',fixed=T)))
colnames(daT2)
daT2

[[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.