Displaying 20 results from an estimated 30000 matches similar to: "matrix manipulation with a for loop"
2007 Jun 01
1
zoo matrix manipulation
Hi,
I have this dataset where columns z1.3 and z1.4 are full of NA's. I want
to perform some calculations in the remaining columns, but after doing
this, I want to recontruct the original matrix. I can with:
out <- which( colMeans( is.na( z ) ) == 1 )
gd<-z[, - out]
select the columns full of NA's and those without that pattern. Then
after doing the calculus I need to
2006 Oct 28
2
subsetting, aggregating and zoo
Hi,
Having an zoo object I can subset it to obtain the days where I have the
values within some range:
is.zoo(z)
TRUE
subset(z[,1], z[,1]>=5 & z[,1]<= 10) #Yields: Year(day)
1988(13) 1988(14) 1988(16) 1988(20) 1988(21) 1988(22) 1988(25)
1988(26)
7.973946 9.933518 7.978227 7.512960 6.641862 5.667780 5.721358
6.863729
1988(27) 1988(28) 1988(29) 1988(30) 1988(32)
2007 May 27
1
na.approx and columns with NA's
Hi,
I have a object 'zoo':
dim(zz)
[1] 720 5551
where some columns only have NA's values (representing land data in a
sea surface temperature dataset) I find straightforward the use of
'na.approx' for individual columns from the zz matrix, but when applied
to the whole matrix:
zz.approx<-na.approx(zz)
Erro en approx(along[!na], y[!na], along[na], ...) :
need
2006 Nov 07
1
subsetting a matrix and filling other
Hi,
Having a matrix F(189,6575) I want to do this:
z1<-subset(F[,1], F[,1] >= 5 & F[,1] <= 10)
.
.
.
z189<-subset(F[,189], F[,189] >= 5 & F[,189] <= 10)
I would prefer to have an empty matrix, say 'z' in order to fill its
columns with the output of subsetting F. But each of the subsets can
differ in length. It's to say:
length(z1)
1189
length(z2)
1238
2006 Nov 26
1
adding elemens to a list
Hi,
I have a list of 20 elements, each of them of variable length and with a
structure like this:
lasker[[1]][1:10,]
Var1 Freq
1 1988-02 3
2 1988-03 1
3 1988-04 1
4 1988-05 2
5 1988-06 3
6 1988-07 1
7 1988-08 1
8 1988-09 1
9 1989-03 1
10 1989-04 1
How do I can insert in this list:
1988-01 0
1988-10 0
1988-11 0
1988-12 0
1989-01 0
2006 Oct 24
6
extract certain values from a ts
Hi,
Having several daily wind speed time series I want to extract those
consecutive days over and below certain values (i.e. 5 < x <8) Don't
know which funtion to use (aggregate, lapply?) and how to do it.
Thanks in advance
Antonio
2003 Feb 06
6
Confused by SVD and Eigenvector Decomposition in PCA
Hey, All
In principal component analysis (PCA), we want to know how many percentage
the first principal component explain the total variances among the data.
Assume the data matrix X is zero-meaned, and
I used the following procedures:
C = covriance(X) %% calculate the covariance matrix;
[EVector,EValues]=eig(C) %%
L = diag(EValues) %%L is a column vector with eigenvalues as the elements
percent
2010 Dec 13
2
Does a formula object have a "left hand side"
Hello,
Does anyone know of a function that will determine whether
or not a formula object has a left hand side?
I.e., can differentiate between
y ~ x + z
and
~ x + z
Perhaps I'm overlooking the obvious...
Thanks!
2007 Jun 26
2
aggregating daily values
Hi,
I swear I have read almost all the posted messages about this issue, but
it's evident I couldn't find an answer (surely esay) to my problem. What
I want is the following:
Make 8 days aggregates from a daily series like this (dput output):
structure(c(6.91777181625366, 0.79051125049591, 9.00625133514404,
9.86966037750244, 14.4326181411743, 3.70155477523804, 9.67768573760986,
2017 Jun 19
2
Problema con Histograma con porcentajes usando ggplot
Creo que esto me da para DK, y luego veré como aplicar el barplot
ess %>%
filter(cntry %in% c("DK")) %>%
count (stflife) %>%
mutate (freq = (n /sum(n)*100))%>%
print
2017-06-18 19:01 GMT-05:00 Antonio Rodriguez Andres <
antoniorodriguezandres70 en gmail.com>:
> He conseguido el total para un país, pero no me deja usar percent =
> count() /sum(count),
2006 Nov 22
4
data in form of a date
Dear all,
I often use dates and times in analyses. I just can't figure out how to
format my date or time column in R. So, apparently R sees the date as
something other than date (character). Let's say I am opening a CSV
file, one of the columns of which is a date or time. How do I specify
that when opening the file?
Thanks for the help,
Jim
--
2017 Jun 18
2
Problema con Histograma con porcentajes usando ggplot
#Simple table con frecuencias absolutas y crear relativas
count =table(ess$stflife)
percent = 100* (count)/sum(count)
Carlos he creado a esto a nivel general en vez de usar prop.table. Según lo
que dices o entiendo, debo de usar la función
ddply para hacerlo a nivel de todos los paises, y entiendo que ddply (,
c(""), debo de indicar los paises?
Saludos
2017-06-18 17:37 GMT-05:00
2006 Jul 20
3
How do I modify an exported function in a locked environment?
Running R.app on Mac OS X 10.4
> version
_
platform powerpc-apple-darwin8.6.0
arch powerpc
os darwin8.6.0
system powerpc, darwin8.6.0
status
major 2
minor 3.1
year 2006
2006 Jul 20
3
How do I modify an exported function in a locked environment?
Running R.app on Mac OS X 10.4
> version
_
platform powerpc-apple-darwin8.6.0
arch powerpc
os darwin8.6.0
system powerpc, darwin8.6.0
status
major 2
minor 3.1
year 2006
2008 Oct 01
9
time segments intersection
Hi all,
Please, how could I calculate the time that two time segments has in
common? Is there any function to perform this calculation?
For instance, given four POSIXlt objects...
endPeriod<-as.POSIXlt("2008-09-30")
startPeriod<-as.POSIXlt("2007-10-01")
endProject<-as.POSIXlt("2007-05-31")
startProject<-as.POSIXlt("2006-12-01")
that limit
2017 Jun 18
3
Problema con Histograma con porcentajes usando ggplot
Gracias. Alguna idea de que usar para calcular los porcentajes y
almacenarlos. Se puede usar flat table?
El 18/06/2017 4:50 p. m., "Carlos J. Gil Bellosta" <cgb en datanalytics.com>
escribió:
> Los porcentajes que obtienes con tu código son sobre todas las facetas, no
> país a país.
>
> Calcula los porcentajes previamente a por país y representa esa columna en
>
2003 Sep 19
4
extracting columns with NA's
Hi All,
How do I can delete from a matrix (or array) only those columns which have
all their values set to NA?
Cheers
Antonio Rodriguez
---
2009 Dec 01
1
Problem in reading data
In my Excel file, I have data in following format :
Feb-07 38.49
Mar-07 39.95
Apr-07 37.47
May-07 35.77
Jun-07 32.96
Jul-07 33.27
I tried to copy this data as a time series using following code :
library(zoo)
dat <- read.zoo(file="clipboard", format="%m-%y")
However getting following error :
Error in read.zoo(file = "clipboard", format = "%m-%y") :
2012 Feb 17
1
time series manipulation what functions are "best"
Newbie question - mechanical engineer trying to learn R
I've had success with plotting time series data and even made a heat map
using R Graphs Cookbook by Mittal.
I have a new problem - I need to align a number of time series data
"columns" to the desired regular exact time stamp vector. The target time
vector could be finer or more course than the typical time stamp spacing
found.
2017 Jun 19
3
Problema con Histograma con porcentajes usando ggplot
Muchas gracias. Me puede recomendar algún libro donde poder empezar.
Gracias
El 18/06/2017 9:46 p. m., <javier.ruben.marcuzzi en gmail.com> escribió:
>
>
> Estimado Antonio Rodriguez Andres
>
>
>
> Usted dice que está en sus inicios con R, y desea realizar un gráfico.
> Esto no es problema, el inconveniente es que está mezclando librerías, es
> lógico, se puede