Posts by Jean • 1,187 points
34 posts
-
1
votes1
answer608
viewsQ: How can I automatically format equations in Word 2013?
I use Microsoft Word as a text editor (Office 2013 package). I built document with a document with numerous equations making use of the tool Microsoft Equation 3.0. However every time I save the…
-
3
votes2
answers173
viewsQ: Compare lines between two tables of data?
Considering: q1 <- data.frame(COD = 1:5, CLAS=letters[1:5]) q2 <- data.frame(COD = c(25,1,31,3,2), CLAS=c(45,letters[1],100,letters[3],letters[10])) I need to know which lines are common among…
-
9
votes1
answer2601
viewsQ: Edit bar graph in R: Order of X-axis values - Caption - Bar color - Insert straight - Insert comments
1 - Contextualization I want to build a bar chart using the ggplot2, however I am having difficulties to gather the information and to make the graphic edition. I have data of the oscillation of the…
-
4
votes1
answer158
viewsQ: How to extract every umpteenth element from a list?
Considering a list composed of several vectors: lista<-list(c("1949", "1963", "45", "X2752009", "X2752013", "X2753007", "X2850009", "X2851005", "X2851008", "X2851014", "X2852002", "X2852003",…
-
1
votes1
answer5243
viewsA: How to apply filters to a data.frame?
Considering: dados<-data.frame(idade=c(15,18,25,40,85,NA), sexo=c("M","F",NA,"F","M","M"), unidade.organica=c("EMEI CG","USP",NA,"UFSM","UFRGS","UPF"),…
-
2
votes1
answer1272
viewsQ: How to print/plot a table in #R?
Consider: dat <- matrix(c(1000, 100, 10000, 10000,3.145,1700.42), 2) In which dat refers to data from the result of a loop, generating a new dat every cycle. I need to present these results, for…
-
0
votes2
answers1310
viewsA: How to remove a word from a string without changing larger words that contain it
Using the expression suggested by @Molx "\\b\\s?bem\\s?\\b", but with the function gsub() gsub("\\b\\s?bem\\s?\\b","",s)
-
2
votes1
answer445
viewsQ: How to create a dynamic progress bar in R?
To follow the processing status in my routines I use the progress bars of the package pbapply, but I couldn’t find a dynamic way to follow more than one process. To illustrate the problem I…
-
4
votes1
answer103
viewsQ: How to delimit the number of characters written per line in a "txt" output in R?
I’m writing a filelog and I want to print it on an A4 sheet. One of the parts of this filelog has a variable, with the following structure:…
-
3
votes2
answers465
viewsQ: Is there a function that checks if a certain value is contained in a certain range?
Supposing: x=120,00 limites.inferior<-80 limites.superior<-160 limites<-c(limites.inferior,limites.superior) I am performing this procedure with a logical test: x.int<-x>=limites[1]…
-
5
votes1
answer2373
views -
4
votes3
answers1099
viewsQ: How to divide the elements of a matrix by the average of its column
I need to divide the elements of a matrix by the respective average of its column, as I can do this, there is some function to perform this simple operation? Considering the matrix: > A <-…
-
2
votes1
answer78
viewsQ: How to test multiple data.frames and set a maximum test score for a certain position? #R
Considering the following date.frames: library(zoo) A<-data.frame(x1=(0:9),x2=rep(0:1,5),x3=rep(0:4,2)) B<-apply(A, 2, function(x) rollapply(x, width = 2, FUN = sum, fill = NA, align = 'r',…
-
2
votes1
answer44
viewsA: Bertin Matrix installation problem
There are several ways to install a package. Being more objective, I looked for specific information about the package requirements bertin, but I couldn’t find it. So, wondering if the problem is…
-
4
votes2
answers1104
views -
3
votes2
answers22615
viewsA: Update the R version of Rstudio?
There are several ways, one of them is using the package installr and applying the function updateR(): library (installr) updateR() further information can be found in this tutorial.…
-
4
votes2
answers22615
viewsQ: Update the R version of Rstudio?
The version of the R I have installed is outdated. What is the procedure to update the R considering that I use Rstudio in Windows?
-
7
votes3
answers108
viewsQ: How can I restructure information contained in a list object into two columns?
Considering a list x composed of nvectors. To illustrate the problem I thought it had 3 elements, as follows: >x $`2751006` [1] 106.2 75.4 65.4 87.4 76.8 196.4 74.2 $`2751007` [1] 73.9 110.1…
-
1
votes1
answer418
viewsQ: How to plot several graphs on an A4 sheet with defined margins?
To illustrate the question I considered the hypothetical situation below, using the libraries ggplot2 and gridExtra. library(ggplot2) library(gridExtra) df<-data.frame(x=1:10,y=1:10)…
-
3
votes1
answer1608
viewsQ: Create a blank data.frame to receive results?
Suppose you want to create a blank data frame to receive the results of a grip test. x<-data.frame(Distribuicao=c(NULL),p-value=c(NULL)) After the test is performed a vector with the results:…
-
2
votes2
answers66
viewsQ: How can I find out which packages/libraries belong to the functions of a routine written in R?
I have stopped using several routines because programmers do not tell what packages/libraries the functions that are in these routines use. I know that many of these functions are authored by the…
-
5
votes2
answers200
viewsQ: How do you store a chart as a variable and export it later?
Considering: x<-1:10 y<-10:1 plot(x,y) I would like to store the result of plot() in a variable, such as grafico<-plot(x,y) is it possible? And to export as I do?…
-
1
votes4
answers1242
viewsQ: How can I save a list or export a list object in R?
I have a list object, similar to the one below: x<- list(cod = 1:10, taxa = exp(-3:3), logico = c(TRUE,FALSE,FALSE,TRUE)) What is the best way to store this object, in *.R , *.csv or _ _ _ ?…
-
2
votes4
answers1242
viewsA: How can I save a list or export a list object in R?
Using the package’s write.list() function erer. x<- list(cod = 1:10, taxa = exp(-3:3), logico = c(TRUE,FALSE,FALSE,TRUE)) library(erer) write.list(x,file="caminhodoarquivo.R") or…
-
1
votes1
answer1174
viewsQ: How to find the position of equal elements in character vectors (Character)?
Considering: a<-c("Ano", "X2751006.", "X2751007.", "X2751008.", "X2751015.", "X2751017.", "X2751018.", "X2751025.", "X2752001.", "X2752006.", "X2752007.", "X2752008.", "X2752009.", "X2752010.",…
-
5
votes1
answer876
viewsQ: How to build an executable/installer from a routine written in R?
I have several routines written in R, simple tools, which I would like to share with my colleagues. However, some of them do not have any knowledge in programming. So I want to facilitate the use of…
-
1
votes2
answers1624
viewsA: Reversing Order column data.frame
Hypothetically, I recreated your data using the packets lubridate and dylyr. library (lubridate) dados<-data.frame(data=seq(ymd('2006/01/01'),ymd('2015/09/01'),by='1 month'),spread=rnorm(117)) To…
-
5
votes1
answer142
viewsQ: What function in R to reorder a data.frame that contains missing data (NA)?
I got the following data.frame: Linha Data Total Med.2 DP.2 Med.3 DP.3 Med.4 DP.4 1 2009 1.4749 NA NA NA NA NA NA 2 2010 2.9945 2.2347 1.0746 NA NA NA NA 3 2011 2.9945 2.9945 0.0000 2.4880 0.8774 NA…
-
3
votes1
answer790
viewsQ: Package Management in R, how to export and import packages?
I use my scripts on several computers and then come across errors regarding the lack of packages and often such computers do not have internet access, which makes it difficult to access the…
-
5
votes1
answer2787
viewsQ: How to read PDF data in R?
I have numerous PDF files containing water well reports from CPRM, like this: http://siagasweb.cprm.gov.br/layout/pdf/exportar_pdf.php?ponto=4300000556 Inside these files are information about the…
-
3
votes3
answers656
viewsQ: Commands as. Date and srtptime in R
Suppose the following vector: datas=c("26/12/2014", "27/12/2014", "28/12/2014", "29/12/2014", "30/12/2014", "31/12/2014") When applying the commands as.Date(datas, "%d/%m%y") and strptimes(datas,…
-
6
votes2
answers3041
viewsQ: How to separate the characters of a string in R?
I have values a string containing a date "01/01/2000" I want to separate the day, month and year. #Data #01/01/2000 be it #Dia Mês Ano #01 01 2000 How do I do it in R?…
-
4
votes3
answers611
viewsQ: How to build time series with frequencies different from the original?
I have a dataframe with daily precipitation data, with dates 01/01/1900 until 31/12/2010, example: # Data Est_1 Est_2 Est_3 # 17/12/2010 NA 0 0 # 18/12/2010 NA 0 0 # 19/12/2010 NA 1.7 0 # 20/12/2010…
-
1
votes4
answers1852
viewsA: Programmatically generate and download links
I incremented some steps in Arthur’s script, like changing the work path and implementing the stations by an external file. I’m sorry for any "Gaff", I’m beginner. I hope I’ve helped.…