Re: [R] Remove Even Number from A Vector

2019-03-02 Thread Jim Lemon
Hi Darren,
You're probably looking for the %% (remainder) operator:

x<-1:10
# get odd numbers
x[as.logical(x%%2)]
# get even numbers
x[!(x%%2)]

Jim

On Sun, Mar 3, 2019 at 4:10 PM Darren Danyluk  wrote:
>
> Hello,
>
> I found this email when looking for some help with R Studio.  It's actually 
> my daughter who is looking for help.
>
> It sounds like she is working with the very basics of this software, and her 
> task is to write the code which would result in the extraction of "odd" data 
> from a dataset of restaurant sales.
>
> This is a shot in the dark...please ignore if my question makes little or no 
> sense.  I have no working knowledge of R software.
>
> Thanks.
>
> [[alternative HTML version deleted]]
>
> __
> R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

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


Re: [R] Remove Even Number from A Vector

2019-03-02 Thread Darren Danyluk
Hello,

I found this email when looking for some help with R Studio.  It's actually my 
daughter who is looking for help.

It sounds like she is working with the very basics of this software, and her 
task is to write the code which would result in the extraction of "odd" data 
from a dataset of restaurant sales.

This is a shot in the dark...please ignore if my question makes little or no 
sense.  I have no working knowledge of R software.

Thanks.

[[alternative HTML version deleted]]

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


[R] R installation Ubuntu 10.04 missing dependency

2019-03-02 Thread John Kane
To upgrade to R.3.5.2 from 3.4.4 I have been following the
instructions at
https://www.r-bloggers.com/installation-of-r-3-5-on-ubuntu-18-04-lts-and-tips-for-spatial-packages/
.

I seem to have the repository properly connected and verified.

I am getting an error:
---
john@jonh-T510:~$ sudo apt install r-base r-base-core r-recommended
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help resolve the situation:

The following packages have unmet dependencies:
 r-base-core : Depends: libreadline6 (>= 6.0) but it is not installable
   Recommends: r-base-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
-
Earlier I was getting another error
r-base-core : Depends: libpng12-0 but it is not installable
but that was cured by installing libpng12-0 via the Ubuntu Software app.

I cannot find what appears to be an installable version of libreadlines6.

Ubuntu reports that the up-to-date version of libreadlines7.

Should I consider this an R issue or an Ubuntu issue?

In any case, has anyone encountered the problem and beaten it?

Thanks

-- 
John Kane
Kingston ON Canada

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