resize the image in R

0 votes
How to resize the image in R? I want to resize the image of dim (480,217), how to do this?
Aug 7, 2019 in Data Analytics by anonymous
10,059 views

1 answer to this question.

0 votes

Hi, 

You can read the image using Magick package as below.

library(magick)
img = image_read("C:\\Users\\Cherukuri_Sindhu\\Downloads\\teams.jpg")

To resize the image, use image_scale() function.

img_scale = image_scale(img, "[Value]")  #for resizing width

img_scale = image_scale(img, "[xValue]")  #for resizing height

To resize both height and width, try below code - 

image_scale(image_scale(img,"[Value]"),"x[value]")

where value is either relative to parent object or fixed size values.

Value = 100% or 500 or 200%, etc.

answered Aug 7, 2019 by anonymous
• 33,030 points

Related Questions In Data Analytics

0 votes
1 answer

Plotting multiple graphs on the same page in R

If you want to plot 4 graphs ...READ MORE

answered Mar 27, 2018 in Data Analytics by Bharani
• 4,660 points
1,426 views
0 votes
1 answer

How to find out the sum/mean for multiple variables per group in R?

You can use the reshape2 package for ...READ MORE

answered Apr 12, 2018 in Data Analytics by DataKing99
• 8,250 points
3,824 views
0 votes
1 answer
0 votes
2 answers

R function for finding the index of an element in a vector?

The function match works on vectors : x <- sample(1:10) x # ...READ MORE

answered Dec 12, 2020 in Data Analytics by Rajiv
• 8,870 points
56,631 views
0 votes
1 answer

Create an animation from images in R

Create a vector with all frames required ...READ MORE

answered Aug 7, 2019 in Data Analytics by anonymous
• 33,030 points
843 views
0 votes
1 answer

By using dpylr package sum of multiple columns

Basically here we are making an equation ...READ MORE

answered Apr 5, 2018 in Data Analytics by DeepCoder786
• 1,720 points
2,249 views
0 votes
1 answer

How to convert a text mining termDocumentMatrix into excel or csv in R?

By assuming that all the values are ...READ MORE

answered Apr 5, 2018 in Data Analytics by DeepCoder786
• 1,720 points
1,919 views
0 votes
1 answer

In a dpylr pipline how to use sample and seq?

For avoiding rowwise(), I prefer to use ...READ MORE

answered Apr 6, 2018 in Data Analytics by DeepCoder786
• 1,720 points

edited Jun 9, 2020 by Gitika 1,182 views
0 votes
2 answers

What are the rules to define a variable name in R programming language?

The same rules almost follow for all ...READ MORE

answered Aug 26, 2019 in Data Analytics by anonymous
• 33,030 points
15,122 views
+1 vote
3 answers

How to change the value of a variable using R programming in a data frame?

Try this: df$symbol <- as.character(df$symbol) df$symbol[df$sym ...READ MORE

answered Jan 11, 2019 in Data Analytics by Tyrion anex
• 8,700 points
35,823 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP