Why? I assume you posted because you want help with something, but it is going
to be very difficult to help if you don't know the most basic things about R
or this mailing list.
Spreadsheet: R can import data from a spreadsheet, but the corresponding native
terminology in R is "data.frame" or "matrix" depending on
what kind of data you are working with. This is important because R does not
behave at all like a spreadsheet and you will confuse us and yourself if you get
this mixed up.
For loop: It is unusual to do most calculations in R with for loops. It is
almost always better to use vector calculations and indexing. Read the
Introduction to R document that comes with R. In particular, per your question,
logical indexing or the subset function can be used to find particular values.
If else: There are two forms of if-else in R. The if function is used for
choosing among code blocks, while the ifelse function is used for vector
calculations. I imagine you were thinking of the former, but in many cases the
latter is more appropriate.
Mailing list: Please read the Posting Guide. Posting in HTML is strongly
discouraged, as it makes a mess of R code. Learn how to send plain text emails.
Also, this is not a homework help forum, so if this is related to a class then
get help there because we don't know what your instructor thinks is fair
help. Finally, please show us what you have already tried including input data
(this is known as providing a reproducible example).
If this all seems a bit much then you are probably in the wrong place. It takes
some effort to make sure your question is understood using only email.
Fortunately, once you learn the basics of the R language it is possible to
communicate very precisely in email.
---------------------------------------------------------------------------
Jeff Newmiller The ..... ..... Go Live...
DCN:<jdnewmil at dcn.davis.ca.us> Basics: ##.#. ##.#. Live
Go...
Live: OO#.. Dead: OO#.. Playing
Research Engineer (Solar/Batteries O.O#. #.O#. with
/Software/Embedded Controllers) .OO#. .OO#. rocks...1k
---------------------------------------------------------------------------
Sent from my phone. Please excuse my brevity.
Shameem Akhtar <sham3287 at gmail.com> wrote:>Dear,
> I want to use for loop and if..else condition together for
>finding such value from a two column in a spreadsheet.
>
>
>
>
>
>
>Thanks & Regards
>Shameem Akhtar
>
> [[alternative HTML version deleted]]
>
>______________________________________________
>R-help at r-project.org mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.