Submit Search
Upload
R functions for data type conversion and logical operations
•
0 likes
•
759 views
AI-enhanced title
皓丞 王
Follow
Reference : Jared P.Lander, R for Everyone: Advanced Analytics and Graphics
Read less
Read more
Data & Analytics
Report
Share
Report
Share
1 of 22
Download now
Download to read offline
Recommended
Functional Patterns for the non-mathematician
Functional Patterns for the non-mathematician
Brian Lonsdorf
S1 3 derivadas_resueltas
S1 3 derivadas_resueltas
jesquerrev1
ゲーム理論NEXT 期待効用理論第6回 -3つの公理と期待効用定理-
ゲーム理論NEXT 期待効用理論第6回 -3つの公理と期待効用定理-
ssusere0a682
Ruby's Arrays and Hashes with examples
Ruby's Arrays and Hashes with examples
Niranjan Sarade
Ruby Language: Array, Hash and Iterators
Ruby Language: Array, Hash and Iterators
Sarah Allen
[系列活動] Data exploration with modern R
[系列活動] Data exploration with modern R
台灣資料科學年會
Intro shiny coscup2013
Intro shiny coscup2013
Johnson Hsieh
手把手Julia及簡易IDE安裝
手把手Julia及簡易IDE安裝
岳華 杜
Recommended
Functional Patterns for the non-mathematician
Functional Patterns for the non-mathematician
Brian Lonsdorf
S1 3 derivadas_resueltas
S1 3 derivadas_resueltas
jesquerrev1
ゲーム理論NEXT 期待効用理論第6回 -3つの公理と期待効用定理-
ゲーム理論NEXT 期待効用理論第6回 -3つの公理と期待効用定理-
ssusere0a682
Ruby's Arrays and Hashes with examples
Ruby's Arrays and Hashes with examples
Niranjan Sarade
Ruby Language: Array, Hash and Iterators
Ruby Language: Array, Hash and Iterators
Sarah Allen
[系列活動] Data exploration with modern R
[系列活動] Data exploration with modern R
台灣資料科學年會
Intro shiny coscup2013
Intro shiny coscup2013
Johnson Hsieh
手把手Julia及簡易IDE安裝
手把手Julia及簡易IDE安裝
岳華 杜
«PyWat. А хорошо ли вы знаете Python?» Александр Швец, Marilyn System
«PyWat. А хорошо ли вы знаете Python?» Александр Швец, Marilyn System
it-people
Next Level Testing
Next Level Testing
James Saryerwinnie
Scala Parallel Collections
Scala Parallel Collections
Aleksandar Prokopec
Useful javascript
Useful javascript
Lei Kang
Chap 3php array part4
Chap 3php array part4
monikadeshmane
Parse Everything With Elixir
Parse Everything With Elixir
Gabriele Lana
PostgreSQL10の新機能 ~ロジカルレプリケーションを中心に~
PostgreSQL10の新機能 ~ロジカルレプリケーションを中心に~
Atsushi Torikoshi
An introduction to property-based testing
An introduction to property-based testing
Vincent Pradeilles
An example of R code for Data visualization
An example of R code for Data visualization
Liang (Leon) Zhou
Recurrent Networks and LSTM deep dive
Recurrent Networks and LSTM deep dive
Alex Kalinin
Ecuaciones dispositivos electronicos
Ecuaciones dispositivos electronicos
fsdewr
Monadologie
Monadologie
league
轻量级文本工具集
轻量级文本工具集
March Liu
Meet scala
Meet scala
Wojciech Pituła
A Course in Fuzzy Systems and Control Matlab Chapter Three
A Course in Fuzzy Systems and Control Matlab Chapter Three
Chung Hua Universit
(How) can we benefit from adopting scala?
(How) can we benefit from adopting scala?
Tomasz Wrobel
PromptWorks Talk Tuesdays: Ray Zane 1/17/17 "Elixir Is Cool"
PromptWorks Talk Tuesdays: Ray Zane 1/17/17 "Elixir Is Cool"
PromptWorks
Python Lecture 11
Python Lecture 11
Inzamam Baig
SparkSQLの構文解析
SparkSQLの構文解析
ゆり 井上
Diapositiva de Estudio: SolPrac2Am4.pptx
Diapositiva de Estudio: SolPrac2Am4.pptx
jorgejvc777
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
shivangimorya083
Brighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data Storytelling
Neil Barnes
More Related Content
Similar to R functions for data type conversion and logical operations
«PyWat. А хорошо ли вы знаете Python?» Александр Швец, Marilyn System
«PyWat. А хорошо ли вы знаете Python?» Александр Швец, Marilyn System
it-people
Next Level Testing
Next Level Testing
James Saryerwinnie
Scala Parallel Collections
Scala Parallel Collections
Aleksandar Prokopec
Useful javascript
Useful javascript
Lei Kang
Chap 3php array part4
Chap 3php array part4
monikadeshmane
Parse Everything With Elixir
Parse Everything With Elixir
Gabriele Lana
PostgreSQL10の新機能 ~ロジカルレプリケーションを中心に~
PostgreSQL10の新機能 ~ロジカルレプリケーションを中心に~
Atsushi Torikoshi
An introduction to property-based testing
An introduction to property-based testing
Vincent Pradeilles
An example of R code for Data visualization
An example of R code for Data visualization
Liang (Leon) Zhou
Recurrent Networks and LSTM deep dive
Recurrent Networks and LSTM deep dive
Alex Kalinin
Ecuaciones dispositivos electronicos
Ecuaciones dispositivos electronicos
fsdewr
Monadologie
Monadologie
league
轻量级文本工具集
轻量级文本工具集
March Liu
Meet scala
Meet scala
Wojciech Pituła
A Course in Fuzzy Systems and Control Matlab Chapter Three
A Course in Fuzzy Systems and Control Matlab Chapter Three
Chung Hua Universit
(How) can we benefit from adopting scala?
(How) can we benefit from adopting scala?
Tomasz Wrobel
PromptWorks Talk Tuesdays: Ray Zane 1/17/17 "Elixir Is Cool"
PromptWorks Talk Tuesdays: Ray Zane 1/17/17 "Elixir Is Cool"
PromptWorks
Python Lecture 11
Python Lecture 11
Inzamam Baig
SparkSQLの構文解析
SparkSQLの構文解析
ゆり 井上
Diapositiva de Estudio: SolPrac2Am4.pptx
Diapositiva de Estudio: SolPrac2Am4.pptx
jorgejvc777
Similar to R functions for data type conversion and logical operations
(20)
«PyWat. А хорошо ли вы знаете Python?» Александр Швец, Marilyn System
«PyWat. А хорошо ли вы знаете Python?» Александр Швец, Marilyn System
Next Level Testing
Next Level Testing
Scala Parallel Collections
Scala Parallel Collections
Useful javascript
Useful javascript
Chap 3php array part4
Chap 3php array part4
Parse Everything With Elixir
Parse Everything With Elixir
PostgreSQL10の新機能 ~ロジカルレプリケーションを中心に~
PostgreSQL10の新機能 ~ロジカルレプリケーションを中心に~
An introduction to property-based testing
An introduction to property-based testing
An example of R code for Data visualization
An example of R code for Data visualization
Recurrent Networks and LSTM deep dive
Recurrent Networks and LSTM deep dive
Ecuaciones dispositivos electronicos
Ecuaciones dispositivos electronicos
Monadologie
Monadologie
轻量级文本工具集
轻量级文本工具集
Meet scala
Meet scala
A Course in Fuzzy Systems and Control Matlab Chapter Three
A Course in Fuzzy Systems and Control Matlab Chapter Three
(How) can we benefit from adopting scala?
(How) can we benefit from adopting scala?
PromptWorks Talk Tuesdays: Ray Zane 1/17/17 "Elixir Is Cool"
PromptWorks Talk Tuesdays: Ray Zane 1/17/17 "Elixir Is Cool"
Python Lecture 11
Python Lecture 11
SparkSQLの構文解析
SparkSQLの構文解析
Diapositiva de Estudio: SolPrac2Am4.pptx
Diapositiva de Estudio: SolPrac2Am4.pptx
Recently uploaded
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
shivangimorya083
Brighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data Storytelling
Neil Barnes
Log Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptx
JohnnyPlasten
BabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptx
olyaivanovalion
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptx
olyaivanovalion
04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships
ccctableauusergroup
100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx
Anupama Kate
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Delhi Call girls
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
ranjana rawat
CebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptx
olyaivanovalion
Generative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and Milvus
Timothy Spann
Ukraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICS
Aishani27
Industrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdf
Lars Albertsson
RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998
YohFuh
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
apidays
Carero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptx
olyaivanovalion
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptx
olyaivanovalion
Sampling (random) method and Non random.ppt
Sampling (random) method and Non random.ppt
Dr. Soumendra Kumar Patra
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
Suhani Kapoor
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
Call Girls In Delhi Whatsup 9873940964 Enjoy Unlimited Pleasure
Recently uploaded
(20)
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
꧁❤ Greater Noida Call Girls Delhi ❤꧂ 9711199171 ☎️ Hard And Sexy Vip Call
Brighton SEO | April 2024 | Data Storytelling
Brighton SEO | April 2024 | Data Storytelling
Log Analysis using OSSEC sasoasasasas.pptx
Log Analysis using OSSEC sasoasasasas.pptx
BabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptx
04242024_CCC TUG_Joins and Relationships
04242024_CCC TUG_Joins and Relationships
100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
(PARI) Call Girls Wanowrie ( 7001035870 ) HI-Fi Pune Escorts Service
CebaBaby dropshipping via API with DroFX.pptx
CebaBaby dropshipping via API with DroFX.pptx
Generative AI on Enterprise Cloud with NiFi and Milvus
Generative AI on Enterprise Cloud with NiFi and Milvus
Ukraine War presentation: KNOW THE BASICS
Ukraine War presentation: KNOW THE BASICS
Industrialised data - the key to AI success.pdf
Industrialised data - the key to AI success.pdf
RA-11058_IRR-COMPRESS Do 198 series of 1998
RA-11058_IRR-COMPRESS Do 198 series of 1998
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Carero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptx
Sampling (random) method and Non random.ppt
Sampling (random) method and Non random.ppt
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
VIP High Class Call Girls Jamshedpur Anushka 8250192130 Independent Escort Se...
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
꧁❤ Aerocity Call Girls Service Aerocity Delhi ❤꧂ 9999965857 ☎️ Hard And Sexy ...
R functions for data type conversion and logical operations
1.
2.
Kan, Hao-Cheng Lunghwa University
of Science and Technology http://kanchengzxdfgcv.blogspot.tw/
3.
4.
5.
6.
> as.numeric(TRUE) > as.numeric(FALSE) >
as.character(TRUE) > as.character(FALSE) > as.factor(TRUE) > as.factor(FALSE) > > k = "kan" > class(k) > as.character(k) > > n = 123 > class(n) > as.numeric(n) > > test = as.numeric(k) > test
7.
> 1 ==
1 > 1 < 1 > 1 <= 1 > 1 > 1 > 1 >= 1 > 1 != 1 > toCheck = 1 if (toCheck == 1) { print("hello") } if (toCheck == 0) { print("hello") }
8.
check.bool = function(x){ if
(x == 1){ print("hello") }else{ print("goodbye") } } > check.bool(1) > check.bool(0) > check.bool("k") > check.bool(TRUE)
9.
check.bool = function(x){ if
(x == 1){ print("hello") } else if (x == 0){ print("goodbye") } else{ print("confused") } } > check.bool(1) > check.bool(0) > check.bool(2) > check.bool("k")
10.
11.
use.switch = function(x){ switch(x, "a"="first", "b"="second", "z"="last", "c"="third", "other") } >
use.switch("a") > use.switch("b") > use.switch("c") > use.switch("d") > use.switch("OwO") > use.switch("z") > use.switch(1) > use.switch(2) > use.switch(3) > use.switch(4) > use.switch(5) > use.switch(6) > is.null(use.switch(6))
12.
13.
> ifelse(1 ==
1, "Yes", "No") > ifelse(1 == 0, "Yes", "No") > > toTest = c(1, 1, 0, 1, 0, 1) > class(toTest) > toTest > > ifelse(toTest == 1, "Yes", "No") > ifelse(toTest == 1, toTest * 3, toTest) > ifelse(toTest == 1, toTest * 3, "Zero") > > toTest[2] = NA > class(toTest) > toTest > > ifelse(toTest == 1, "Yes", "No") > ifelse(toTest == 1, toTest * 3, toTest) > ifelse(toTest == 1, toTest * 3, "Zero")
14.
15.
> a =
c(1, 1, 0, 1) > b = c(2, 1, 0, 1) > bs = c(2, 1, 0, 1) > > ifelse(a == 1 & b == 1, "Yes", "No") > ifelse(a == 1 && b == 1, "Yes", "No") > ifelse(a == 1 && bs == 1, "Yes", "No") ifelse(a == 1 & b == 1, "Yes", "No") ifelse(a == 1 && b == 1, "Yes", "No")
16.
17.
18.
squfc = function(xsqu,ysqu){ if(
xsqu <= 0 || ysqu <= 0|| is.na(xsqu) || is.na( ysqu) || is.character(xsqu) ||is.character(ysqu)){ print(NA) }else{ squmatem = xsqu * ysqu return(squmatem) } }
19.
> squfc( 3,
4) > squfc( 0, 4) > squfc( 3, 0) > squfc( 3, NA) > squfc( NA, 4) > squfc( 3, "Hi") > squfc( "Hi", 4) > > ww = c(1,NA,3,4,5) > qq = c(6,7,NA,9,10) > squfc(ww,qq)
Download now