Creating Visual Emphasis: Adding Dotted Boxes to Graphs in R Studio

Creating Visual Emphasis: Adding Dotted Boxes to Graphs in R Studio

I’ll explain how to insert a box in a graph to highlight it. I’ll generate some data. “This data pertains to the yield and standard error for five different genotypes. I’ll create a bar chart to visualize it. In this graph, genotypes D and E exhibit greater yields compared to the other genotypes. My current objective is to emphasize genotypes D and E by adding a dotted box. To achieve this, we can utilize the geom_rect(). For geom_rect(), I set…

Read More Read More

단순선형 회귀분석에서 결정계수 (R², Coefficient of Determination) 를 가장 쉽게 설명해 보자

단순선형 회귀분석에서 결정계수 (R², Coefficient of Determination) 를 가장 쉽게 설명해 보자

여기 x 와 y 에 대한 데이터가 있습니다. x 가 변화함에 따라 y 는 어떻게 달라지는지를 알고 싶어 회귀분석을 해 보겠습니다. x y 1 10 30 2 20 40 3 30 50 4 40 80 5 50 90 6 60 100 7 70 120 저는 SAS 를 이용합니다. 먼저 데이터 데이블을 생성합니다. 그리고 단순선형 회귀분석을 해 보겠습니다. 통계 프로그램은 회귀방정식 y= 11.429 + 1.5357x 를 제공해 주었습니다. 즉, x 가 1 증가할 때 y 는1.5357 배로 증가합니다. 그리고 이 회귀모형의…

Read More Read More

[스페인 농업일기] 스페인 작물 학회 (FiRCMe) 발표

[스페인 농업일기] 스페인 작물 학회 (FiRCMe) 발표

팜플로나에 있는 University of Navarra 에서 진행된 스페인 작물 학회에서 발표를 하였습니다. 발표 주제는 밀 수확량에 영향을 미치는 고온 스트레스에 관한 내용이었습니다. 고온 스트레스는 밀 수확량에 영향을 미칠때 직접적으로 종자에 영향을 미치는지, 잎에 직접적으로 영향을 미쳐 최종적으로는 간접적으로 종자에 영향을 미치는지에 대한 내용을 발표했습니다. p.s. 팜플로나의 야경

In R STUDIO, how to apply the same font type and size in ggplot?

In R STUDIO, how to apply the same font type and size in ggplot?

First, let’s generate a simple data. Then I’ll make a bar graph using ggplot2. Now, I made a bar graph like above, but in the code to make this bar graph, I repeated font type and size over and over to set up the same font type and size in both graph title and text (also in x and y axis). I want to reduce this repeated codes, and the solution is using theme_grey(). axis.title.x= element_text (family=”serif”, size=15, color=”black”), axis.title.y=…

Read More Read More

Creating Stacked Bar Graphs in R Studio: A Step-by-Step Guide

Creating Stacked Bar Graphs in R Studio: A Step-by-Step Guide

Today, I’ll be introducing how to create stacked bar graphs using R Studio. To start, I will generate a data table as shown below. I’ll make stacked bar graphs using this data table. First of all, it’s necessary to summarize the data. I’ll use ddply() function. If I use this code, the error message pops up This is because when generating data, I used double quotation marks such as yield = c(rep(“15”, 5), rep(“18”, 5), rep(“20”, 8), rep(“14”, 7), rep(“21”,…

Read More Read More

예이다 La Seu Vella (라 세우 벨라)

예이다 La Seu Vella (라 세우 벨라)

박사 논문 막바지 단계에 있습니다. 사무실에서 일하다가 기분전환이나 할겸 예이다에서 가장 유명한 (사실 유일한) 관광지인 La Seu Vella 를 다녀왔습니다. La Seu Vella 를 올라갈수 있는 길은 여러곳이 있습니다만 저는 개인적으로 여기가 공식적인 정문이라고 생각하고 있습니다. La Seu Vella 에 올라가면 예이다 시내를 한눈에 볼수 있습니다. 그래서 가끔 여기 와서 도시 풍경 보는 것을 좋아합니다. 이곳은 La Seu Vella 에 있는 카페테리아 입니다. 이곳에 앉아 쉬면서 도시 풍경을 보는 재미가 있습니다. 잠시 성에 앉아 도시 풍경을 보며 박사과정 이후의 삶에…

Read More Read More

How to conduct Least Significant difference (LSD) test using R STUDIO?

How to conduct Least Significant difference (LSD) test using R STUDIO?

For the mean comparison among variables, Least Significant difference (LSD) test is the most common method. Today I’ll introduce LSD test using R Studio. Here is one data. This data is about the yield difference of CV1 in response to 4 different nitrogen fertilizer (N0 ,N1, N2, N3). First of all, let’s check the mean per each nitrogen fertilizer. It seems that yield is different from nitrogen fertilizers, but we need to confirm it statistically. First, I’ll run One-Way ANOVA…

Read More Read More

[스페인 농업일기] 스페인 카탈루냐 지역 2021년 밀 수확

[스페인 농업일기] 스페인 카탈루냐 지역 2021년 밀 수확

2021년 겨울밀 수확 현장에 참여했습니다. 횟수로는 4년째 스페인에서 밀 수확 현장에 참여하고 있습니다. 올해 저는 필드실험이 없어서 아주 오랜만에 필드 방문이기도 해서 더욱더 기분이 좋았던 하루 였습니다 아주 뜨거운 날씨입니다. 밀은 아주 잘 익어서 밀 이삭 역시 고개를 숙이고 있습니다. 파종을 작년 11월 중순에 했으니 7개월 정도 잘 자라 주었습니다. 필드 연구는 언제나 즐겁습니다.

Graph Partitioning Using facet_wrap() in R Studio

Graph Partitioning Using facet_wrap() in R Studio

While creating graphs, you can certainly draw multiple graphs in a single panel. However, you can also use the facet_wrap() function to divide graphs based on specific variables. First, let’s generate a dataset. I intend to create a bar graph using this data. Therefore, I need to summarize the data. To do this, I must reorganize the data from being divided into columns to being arranged in rows. I have reorganized the data into rows using the reshape2::melt() function. Now,…

Read More Read More

Utilizing stat_summary() in R Studio to Summarize Data Graphically

Utilizing stat_summary() in R Studio to Summarize Data Graphically

When creating graphs using data, especially those involving error bars, it is necessary to calculate the standard error by summarizing the data. There are various methods to summarize the data. □ Utilizing R Studio for Data Grouping and Mean/Standard Error Calculation (feat ddply) Today I will introduce a method of creating graphs all at once using stat_summary() without the need for such data summarization. Below is an example dataset: Now I want to display the data as points by placing…

Read More Read More

노먼 볼로그와 녹색혁명 이야기 (20세기 밀 수확량은 어떻게 증가했는가?)

노먼 볼로그와 녹색혁명 이야기 (20세기 밀 수확량은 어떻게 증가했는가?)

20세기 후반 밀 수확량은 어떻게 증가 하였을까? 이 이야기는 1935년으로 거슬러 올라갑니다. 당시 일본의 밀 육종가 곤지로 이나주카 (Gonjiro Inazuka) 는 일본의 반왜성 (semi-dwarf) 야생 품종과 두개의 미국 밀 품종을 교배하여 노린 10 [小麦農林10号] 이라는 새로운 밀 품종을 개발합니다. 일본어로 노린은 ‘농림’ 이라는 뜻이라고 합니다. 반왜성[半矮性]: 식물 육종에서 보통의 품종보다 줄기의 길이가 짧거나 키가 작지만 왜성처럼 극단적이지 않은 상태 Daruma 는 줄기가 짧은 일본 고유 품종이었고 박력분 밀 품종인 Fultz 와 강력분 밀 품종인 Turkey Red 는 1982년쯤 미국에서 일본으로 도입된 품종이었습니다. 이 Fultz 와 Turkey Red 는 일본 도쿄에 있는…

Read More Read More

Transforming Data: Stacking Multiple Columns into Rows Using R

Transforming Data: Stacking Multiple Columns into Rows Using R

One common mistake when organizing data is collecting it as depicted below (## represents the result). While it might seem easy to input values into each column, listing data in this manner complicates statistical analysis. To conduct statistical analysis on such listed data, it is necessary for the data to be arranged as shown below. In other words, statistical analysis of an experimental design with three replicates for the two variables, Genotype and Field, can be conducted when the data…

Read More Read More

Stacking Data Vertically from Multiple Columns in R Studio (feat. reshape package)

Stacking Data Vertically from Multiple Columns in R Studio (feat. reshape package)

Previously, I posted about how to change the data structure in the following scenario. □ Combining Factors from Separate Datasets into a Single Column Using R Studio (feat. dplyr package) This time, I will introduce a method for changing the structure of data as shown below. Specifically, this is about cases where there are multiple columns within a single dataset, not two different datasets. I will create a simple dataset for illustration purposes. This is a method for taking input…

Read More Read More

[스페인 농업일기] 스페인 카탈루냐 지역 작은 농장 스토리

[스페인 농업일기] 스페인 카탈루냐 지역 작은 농장 스토리

Farmer España 라는 앱에서 소개한 스페인 카탈루냐 지역에 작은 농장 스토리 입니다. 농부라는 직업을 이렇게 매력적으로 묘사하는 영상을 오랜만에 봅니다. 영상미부터 스토리까지 농부가 되고 싶게 만드는 영상을 보며 이런게 문화의 힘인가 싶고, 개인적으로는 카탈루냐 지역 농업이 이런 면을 많이 부각시키는 듯 합니다. 영상이 너무 이뻐서 영상 내용을 번역하여 소개합니다. Hericamps es nuestro proyecto agroecológico de agricultura ecológica y sostenible. Empezó ya hace 3 años. 우리의 농장 Hericamps 는 스페인 카탈루냐 Figuera 지역에서 3년전에 시작한, 농업과 환경에 관한 생태학적이고 지속가능한 우리의…

Read More Read More

Combining Factors from Separate Datasets into a Single Column Using R Studio (feat. dplyr package)

Combining Factors from Separate Datasets into a Single Column Using R Studio (feat. dplyr package)

When data is divided into two separate datasets, it needs to be combined into a single column. Using R, we can simply combine the two datasets. I will create a simple dataset. Now I will combine these two datasets into one. 1) using data.frame() To explain the below code simply, we are using the function data.frame() to combine two datasets. Regarding the repetition of the text “Defoliation,” it indicates repeating it by the number of times corresponding to the values…

Read More Read More

Utilizing R Studio for Data Grouping and Mean/Standard Error Calculation (feat ddply)

Utilizing R Studio for Data Grouping and Mean/Standard Error Calculation (feat ddply)

The function I will introduce today is ddply(). This function is convenient for summarizing large amounts of data and can also calculate standard errors, making it easy to create bar graphs. First, install the package. Once the installation is complete, let’s upload some data. This dataset consists of results from cultivating 4 genotypes under 4 different nitrogen treatment conditions with 4 replicates each. In other words, it comprises a total of 64 data points (4 x 4 x 4). When…

Read More Read More

How to add new columns (new calculation) using R STUDIO?

How to add new columns (new calculation) using R STUDIO?

I’ll generate one data. Let’s say this is a math and english score for 8 students from different countries. I would like to adjust the scores by giving more weight to math. Since math was particularly difficult, I will increase the weight given to math.

Performing a Two-Way ANOVA with Blocks using R Studio

Performing a Two-Way ANOVA with Blocks using R Studio

I’ll upload one data in R. I have 10 corn varieties and want to analyze the impact of nitrogen treatments (N0 and N1), variety, and their interaction on grain yield. Since replicates are considered as blocks, I will conduct a two-way ANOVA analysis with blocks as the statistical model. The statistical model for two-way ANOVA with blocks is as follows: yijk = μ  + αi + βj + δij + γk + εijk where yijk: observed values for treatment (ij; i…

Read More Read More

Streamlined Data Summary in R STUDIO: Enhancing Bar Graphs with Error Bars

Streamlined Data Summary in R STUDIO: Enhancing Bar Graphs with Error Bars

When working with data in R, there are situations where you might need to examine summarized information, such as means, standard deviations, and more. Today, I will introduce the methods that can be employed for this purpose. Let’s start by loading a dataset. As I engage in various tasks involving this data, I aim to summarize it. Therefore, I will introduce methods applicable to such situations. 1) using plyr package First, install and activate the package. I want to summarize…

Read More Read More

Enhancing Graph Points in R Studio: Adding Distinct Borders

Enhancing Graph Points in R Studio: Adding Distinct Borders

I have datasets below. This data pertains to the differences in grain yield and height resulting from various fertilizer treatments. Now I’ll create a graph using the following code. Since I assigned the color based on the condition of the “Fertilizer,”; geom_point (aes(color=Fertilizer)), the colors are automatically distinguished, resulting in the graph being plotted. However, I would like to add borders to these points in order to represent them more distinctly. By the way, if you include shape=Fertilizer within aes(),…

Read More Read More

How to select/delete specific variables using R STUDIO?

How to select/delete specific variables using R STUDIO?

□ How to select and delete specific columns using R STUDIO? In my previous post, I explained how to select or delete specific columns. This time, I’ll elaborate on selecting or deleting specific variables within columns. Once again, I’ll generate a new set of data. If I want to divide the data by genotype, I use the code below. But what if I simply want to delete all instances of the CV2 genotype? The code is below. Alternatively, the code…

Read More Read More

Modifying Graph Axis Style using ggplot in R Studio

Modifying Graph Axis Style using ggplot in R Studio

This is a method for adjusting the axis formatting of a graph drawn using ggplot() in R Studio. I will create a simple dataset as shown below. Next, I will use this data to create a bar graph. I have created the bar graph as shown above. Now, let’s proceed to adjust the axis formatting of the graph. 1) Setting Axis Range I will adjust the range of the y-axis values. I want to set the range from -1 to…

Read More Read More

Illustrating Data Trends with a Line Graph in R Studio

Illustrating Data Trends with a Line Graph in R Studio

I’ll Introduce the method of creating a line graph using R. I will utilize the geom_line() within ggplot(). First, let’s load the file. This data pertains to the changes in chlorophyll content and leaf greenness over time (days after planting). This dataset contains information from two distinct locations (Northern, Southern) and genotypes (CV1, CV2), each with three stress treatments (Control, Stress_1, Stress_2). Now, I’d like to know how chlorophyll content is changed by stress treatments per genotype at each location….

Read More Read More

[El trigo column] Language

[El trigo column] Language

Wednesday, September 16, 2020 @ Lleida, Spain Lately, I have been investing a lot of time in learning coding languages. I’m currently learning R, a very basic statistical language, and just the mention of “coding” is somewhat embarrassing since I’m at such a fundamental level. With R, I am learning how to draw various implementable graphs and am also learning very basic statistical analysis methods. Although there aren’t many good statistical programs available for free, R has the advantage of…

Read More Read More

How to select/delete specific columns using R STUDIO?

How to select/delete specific columns using R STUDIO?

It would be helpful if you read the below post before starting!! □ Data filtering using R Studio I’ll generate one data. Let’s say this is a math and English score for 8 students from different countries. Let’s do several things with this data. ■ How to delete certain column? I’d like to delete math column. I use the below code. In case I want to delete both math and eng columns, I use the below code. Without using subset(),…

Read More Read More

How to Combine Data in R Studio using c/r bind() and merge() Functions?

How to Combine Data in R Studio using c/r bind() and merge() Functions?

I will post a method for combining the columns and rows of two datasets in R. I have created two datasets simply for this purpose. And now, let’s combine these two datasets. I have combined these two tables into one. In fact, combining columns is simple because you can just put them side by side. However, when combining rows, it is important to check if the names of each column are the same before merging to prevent data from being…

Read More Read More

R 에서 각 변수간 그룹의 평균값을 계산하여 새로운 열에 삽입해 보자

R 에서 각 변수간 그룹의 평균값을 계산하여 새로운 열에 삽입해 보자

아래와 같은 데이터가 있습니다. 이 데이터에서 treatment 별로 평균값을 계산하여 새로운 열에 삽입하고 싶습니다. 그래서 아래와 같은 코드를 사용해 보겠습니다. 하지만 이 코드는 너무 길어 보입니다. 아주 간편하게 위와 동일한 계산을 수행하는 코드가 있으면 아주 편할것 같습니다. tapply() 코드는 위와 동일한 계산을 가능하게 하는 코드입니다. mean2 라는 열을 생성해서 그곳에 각 변수의 평균값을 계산하여 삽입하고 싶습니다. 첫번째 일일이 계산했던 방법과 동일한 값을 얻을 수 있습니다. 즉, 아래와 같이 길었던 코드와 동일한 계산식을 제공하는 코드가 tapply() 입니다. 만일 변수가 하나가 아니라…

Read More Read More

스페인 작물학회 참석 및 발표

스페인 작물학회 참석 및 발표

스페인 코르도바에서 열린 스페인 작물학회 The Second Spanish Symposium on Cereal Physiology and Breeding (SEFiMeC) 에 참석하여 밀 종자의 source-sink balance 에 대한 주제로 주제발표를 하였습니다.    밀의 수확량은 크게 두가지 구성성분으로 이루어집니다. 하나는 Grain number per m2 (GN) 이고 다른 하나는 average grain weight (GW) 입니다. 밀의 수확량은 GN 에 더 큰 영향을 받습니다. 하지만 이 두 구성성분 사이에는 negative 한 관계가 형성됩니다. 즉, GN 이 증가되면 GW 는 감소됩니다. 이 negative 한 관계는 결국 yield penalty 를 가져오는 요인이 됩니다. 그렇기에…

Read More Read More

스페인 예이다 대학교 (ETSEA) 도착 (박사 연구 시작)

스페인 예이다 대학교 (ETSEA) 도착 (박사 연구 시작)

2017년 10월 4일 이번 예이다 대학교 방문은 박사과정 진학을 위해 지도 교수님과 향후 일정을 조율하기 위해 방문하는 일정이었습니다. 바르셀로나 역에서 Lleida 로 가는 Renfe 고속열차를 타고 Lleida 역 (Lleida Pirineus railway station) 에 도착하였습니다. 미팅이 다음날 오전에 잡혀 있어서 숙소로 먼저 이동합니다. ETSEA (Escola Tècnica Superior d’Enginyeria Agrària) 건물 바로 앞에 있는 Nastasi 라는 호텔입니다. 가격도 저렴하고 시설도 무척이나 좋았습니다. 다음날 미팅을 위해서 방문한 ETSEA (Escola Tècnica Superior d’Enginyeria Agrària) 입니다. 예이다 대학교에서 농업 관련쪽 분야는 이곳에 다 모여 있다고 보시면…

Read More Read More