R numbers from 1 to 100

0 votes
How can I obtain a list of all the numbers from 1 to 100 in R? For this, several languages have a function called "range." The action of R's range is very different.

> range (1,100)

[1] 1 100
Jun 22 in Data Analytics by avinash
• 860 points
12 views

1 answer to this question.

0 votes
Your error is seeking for range, which provides you a vector's range, like in:

range (10, -5, 100), c,
gives

-5 100
Examine the: operator to provide sequences (with a step size of one) instead.

1:100
alternatively for a little bit more control, try the seq function. For instance,

## Step size of 2 Sequence (1, 100, by=2)
answered 6 days ago by Sohail
• 2,960 points

Related Questions In Data Analytics

0 votes
1 answer

How to install an R package from source?

If you have your file located locally ...READ MORE

answered Apr 14, 2018 in Data Analytics by CodingByHeart77
• 3,720 points
271 views
0 votes
5 answers

How to remove NA values from a Vector in R?

Hello team, you can use na.omit x <- c(NA, 3, ...READ MORE

answered Dec 9, 2020 in Data Analytics by anonymous
• 82,720 points
152,224 views
0 votes
1 answer

How to import data from a Json file into R?

Easy and simple: library("rjson") json_file <- "file_name" json_data <- fromJSON(file=json_file)) or ...READ MORE

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

Big Data transformations with R

Dear Koushik, Hope you are doing great. You can ...READ MORE

answered Dec 18, 2017 in Data Analytics by Sudhir
• 1,610 points
422 views
0 votes
2 answers

Transforming a key/value string into distinct rows in R

We would start off by loading the ...READ MORE

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

Finding frequency of observations in R

You can use the "dplyr" package to ...READ MORE

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

Left Join and Right Join using "dplyr"

The below is the code to perform ...READ MORE

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

How to use Aggregate function in R

Where dat is the name of your ...READ MORE

answered 6 days ago in Data Analytics by Sohail
• 2,960 points
9 views
0 votes
1 answer

How to use the switch statement in R functions?

Switch definitely wasn't intended to operate this ...READ MORE

answered 6 days ago in Data Analytics by Sohail
• 2,960 points
11 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP