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, 2022 1,239 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)

Transform data into actionable insights with our Data Analyst Certification – Enroll today!

answered Jun 24, 2022 by
• 3,040 points

+1 vote
1 answer

## I’m a noob to R and I’m supposed to printing all even numbers from 1 to 100. Can somebody help me with it?

Try this: Two <- seq(2,100,2) READ MORE

0 votes
1 answer

## How to install an R package from source?

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

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

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

0 votes
1 answer

## Big Data transformations with R

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

0 votes
2 answers

## Transforming a key/value string into distinct rows in R

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

0 votes
1 answer

## Finding frequency of observations in R

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

0 votes
1 answer

## Left Join and Right Join using "dplyr"

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

0 votes
1 answer

## How to use Aggregate function in R

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

0 votes
1 answer

## How to use the switch statement in R functions?

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