Hi, R-Help members,
I'm doing some webscraping. This time i need the image (url) of the
products of an ecommerce.
I can get the nodes where the urls are, but when trying to extract the URL,
i need to take 1
additional step:
src vs data-original: in the source code, some urls are in the src
Dear all,
I am trying to learn lapply.
I would like, as a test case, to try the lapply alternative for the
Shadowlist-array(data=NA,dim=c(dimx,dimy,dimmaps))
for (i in c(1:dimx)){
Shadowlist[,,i]-i
}
---so I wrote the following---
returni -function(i,ShadowMatrix) {ShadowMatrix-i}
Hi Alaios,
there are some problems with your code:
1. In the expression Shadowlist[,,i]-i, i corresponds to dimmaps, not
dimx. The for loop should be either
for (i in c(1:dimmaps)){
Shadowlist[,,i]-i
}
or
for (i in c(1:dimx)){
Shadowlist[i,,]-i
}
2. in lapply, the function must be
: A1.056, Coupure Links 653, 9000 Gent
ring: 09/264.59.36
-- Do Not Disapprove
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On
Behalf Of Alaios
Sent: woensdag 30 maart 2011 8:31
To: R-help@r-project.org
Subject: [R] a for loop to lapply
Dear
Hi Alex,
lapply is not a substitute for for, so it not only does things
differenly, it does a different thing.
Shadowlist-array(data=NA,dim=c(dimx,dimy,dimmaps))
for (i in c(1:dimx)){
Shadowlist[,,i]-i
}
Note that your test case is not reproducible as you haven't defined
dimx, dimy,
alaios wrote:
I am trying to learn lapply.
I would like, as a test case, to try the lapply alternative for the
Shadowlistlt;-array(data=NA,dim=c(dimx,dimy,dimmaps))
for (i in c(1:dimx)){
Shadowlist[,,i]lt;-i
}
---so I wrote the following---
returni lt;-function(i,ShadowMatrix)
6 matches
Mail list logo