r

How to add two different-sized vectors in R

Let's say there are vectors: a <- c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) b <- c(1, 2, 3, 4) How to add all the elements of a ... yclically, so that the output is this result: 2, 4, 6, 8, 6, 8, 10, 12, 10, 12 If you can use slices, then it would be great

Calling a function in R

How can I save my own function and then call it in another script?

Rstudio: Cyrillic alphabet is displayed incorrectly in the script

I downloaded a script containing the Cyrillic alphabet. When opening in Rstudio, there are incomprehensible characters instea ... астоты). hist(data, plot = TRUE, freq = TRUE, col = "darkviolet", ylab = "Частота", xlab = "Рнтервалы")

Transcoding a part of the text in data.frame from utf8 to win1251 to R

There is an object data in the format data.frame, which contains columns with text in combination with other data, part of th ... ) Class 'labeled' chr "RYReR±resЂcЊ" .. .. LABEL: fo Str(t1) Class 'labelled' chr "R R RR S'R V±R S'RR'RЉ" .. .. LABEL: fo

Convert quotes to herringbone in a column of the generated table

There is a problem. You need to make substitutions for the following type of content in the table generated by the script, in ... 91)", respectively, you need to convert to > Since the table is formed by the condition, then say I can't find the size.

The do.call(function(...) Map(list, ...), cars) construct in R is the order of argument traversal

Would your dear colleagues be so kind as to explain what is the principle of argument traversal in the do.call(function (cons ... ite GMC' '3 black GMC' '3 2_3' Example of a laptop with codes: Https://www.kaggle.com/alexandervc/r-do-call-map-with-3-dots

Plot of relative frequencies in R

I need to plot a histogram of relative frequencies via plot. I know that the hist () function is used to plot the sample hist ... the sum of the relative frequencies on the graph exceeds 1. Please tell me what the error may be and how to fix it fix it?

Using the "HP Vertica" database via dbplyr (R) in Win10

Since Vertica only works on Linux, I installed Vertica 10-Dev in the VM. How can it be used in Win10 via dbplyr (R)? Switching completely to Linux is not an option. Maybe someone has experience in a similar situation.

How to build a vector autoregression model (VAR model)?

It is necessary to evaluate the reaction of one variable to the shock of another (using vector autoregression). Given the spe ... ve used Eviews Help, respectively, various tutorials for it, as well as textbooks on econometrics Nosko V. P. and Dougherty.

Installing Rtools

I'm trying to install Rtools. Downloaded it. Next, run the following command in the terminal: > writeLines('PATH="${RTOOLS40_HOME}\\usr\\bin;${PATH}"', con = "~/.Renviron") Who can describe what to insert instead of RTOOLS40_HOME and PATH?

Regular expression: looking for strings of 5 types, forming a list

I process the text containing the names of documents. You need to take out all the names of the documents and put them in a l ... W[0-9]+[А-Я]+)|([А-Я][а-я]*?)(\\s\\W[0-9]+-[А-Я]+)|([А-Я][а-я]*?)(\\s\\W[0-9]+)|([А-Я][а-я]*?)(\\s\\W[А-Я]+[0-9]\\W[0-9]+)')

The cbind function in R

The cbind and rbind functions. How do I remove the quotation marks of the values of the resulting dataframe? For example: my ... [4,] "4" "door" "9" [5,] "5" "floor" "10" Is there a way to get rid of the quotation marks?

How do I create a subset without a specific element?

Hello. How do I create a subset without a specific element? For example: > a1<-c(1:5) > a2<-c("bed","pillow","sl ... erator does not work. How to use it here correctly? Or maybe there are other commands that allow you to create such a subset?

Is there a function in R to get the value of the Laplace function?

For solving various statistical problems, textbooks actively use the Laplace table. What is the name of the function in R to get the values according to this table?

Approximation of experimental data

There is data for the graph(x,y), if you build it, you can see that somewhere there is an increase, and somewhere there is a ... itial parameters. If I set them by example 1, then I get something like a singular gradient matrix, how to "fit"it correctly?

Downloading data from finam to R (rusquant)

Faced with such a problem, when downloading data from the Finam of industry tickers (MICEXO&G, MICEXM&M), the " & ... ачивается и выдает ошибку(*) getSymbols('MICEXFNL',from=date, src = "Finam") Finance <- MICEXFNL #Все проходит идеально

How to create png file for multiple graphics using x11 in R?

I was able to plot and generate (png) files of the simple charts, but in the case of multiple charts in the same window (as i ... n=2) dev.off() Is it possible to save the chart using png(filename=nome_do_grafico.png) and dev.off()? Where's the mistake?

How to color the caption according to the graph in the R

Hello guys I have a chart on R and would like to make the caption equal to the chart. below is the command used and the graph ... generated this graph. What I would like to do is paint the legend balls according to the color that is on the chart. Thanks.

How to extract every nth element from a list?

Considering a list composed of several vectors: lista<-list(c("1949", "1963", "45", "X2752009", "X2752013", "X2753007", ... The other analyzes are follow the same level and will be possible only with the manipulation of the solution of this case.

Columns with different row numbers, how to join?

I have some time series (Monthly) that end in different months, for example, some end in March 2017, others in April 2017 and ... 3.1042 231 2017-03-01 1.05 9.85 3.1279 232 2017-04-01 0.79 3.1362 233 2017-05-01 0.08