I have a .csv database that gathers posts from both Facebook and twitter.
For reading the bank in R, the code I have used is
bancodedados <- read.csv("nomedobanco.csv", sep=";", encoding="UTF-8")
The code loads the database almost to t...
Consider the vectors:
a<-1:10
b<-1:10
c<-'a'
d<-'a'
e<-list('b')
f<-list('b')
g<-1.1
h<-1.1
The function below removes only a class (which is integer , in this case):
rm(list=names(Filter(is.integer,mget(ls...
Suppose a linear regression model such as the following:
set.seed(1)
x <- rnorm(100)
y <- rnorm(100) + 2*x +10
modelo <- lm(y~x)
If I plot y against x, how do I include the regression line in the chart?
plot(y~x)
Suppose a data.frame with numeric values and strings:
set.seed(1)
dados <- data.frame(w=rep(c("A", "B"), 2), x= rep(c("D", "C"), 2), y= rnorm(4), z=rnorm(4),
stringsAsFactors=FALSE)
dados
w x y z
1 A...
In the case below id corresponds to observations contained in two different data frames, where in df1 the observations have the variable x and in df2 the observations have x and z
In these cases how to join the two data frames? rbind...
It is very common to hear (or read) that loops are not efficient in R and should be avoided ( in this link or on another link or same in this ).
And proving this statement is simple:
numeros <- rnorm(10000)
com_loop <- fun...
Hi,
I need to do a task and I'm not getting into logical reasoning.
My scenario is: I have a DF with several columns, I need to "read column 3", identify the words and sort.
Example:
DF
nome rua funcao
alberto assis progr...
I need to make concentric circles, preferably displaced from the source, in the plot() function to serve as a visual reference for a function. I tried abline() , but I did not succeed.
There is a database of the National Water Agency that can be accessed by Hidroweb .
To download, just go to:
Hydrological data > Historical series
and include the code of the desired rain gauge.
When chosen the code and type...