Displaying 20 results from an estimated 300 matches similar to: "lattice xyplot with cumsum() function inside"
2024 Sep 21
3
store list objects in data.table
I am trying to store regression objects in a data.table
df <- data.frame(x = rnorm(20))
df[, "y"] <- with(df, x + 0.1 * x^2 + 0.2 * rnorm(20))
mydt <- data.table(mypower = c(1, 2), myreg = list(lm(y ~ x, data = df),
lm(y ~ x + I(x^2), data = df)))
mydt
#?? mypower??? myreg
#???? <num>?? <list>
#1:?????? 1 <lm[12]>
#2:?????? 2 <lm[12]>
But mydt[1, 2]
2024 Sep 22
1
store list objects in data.table
Well, you may have good reasons to do things this way -- and you
certainly do not have to explain them here.
But you might wish to consider using R's poly() function and a basic
nested list structure to do something quite similar that seems much
simpler to me, anyway:
x <- rnorm(20)
df <- data.frame(x = x, y = x + .1*x^2 + rnorm(20, sd = .2))
result <-
with(df,
2024 Sep 22
2
store list objects in data.table
Thanks everyone for their responses.
My data is organized in a data.table.? My goal is to perform analyses
according to some groups.? The results of analysis are objects.? If
these objects could be stored as elements of a data.table, this would
help downstream summarizing of results.
Let me try another example.
carsdt <- setDT(copy(mtcars))
carsdt[, unique(cyl) |> length()]
#[1] 3
2007 Jan 19
1
naive bayes help
Hello
I have a rather simple code and for some reason it produces an error
message. If someone can tell me why and how to fix it, I would be very
greatful. Thank you in advance.
##### create data
set.seed(10)
n <- 200 # number of training points
n.test <- 200 # number of test points
p<-2 # dimension of input space
z <-
2011 Nov 29
2
aggregate syntax for grouped column means
I am calculating the mean of each column grouped by the variable 'id'.
I do this using aggregate, data.table, and plyr. My aggregate results
do not match the other two, and I am trying to figure out what is
incorrect with my syntax. Any suggestions? Thanks.
Here is the data.
myData <- structure(list(var1 = c(31.59, 32.21, 31.78, 31.34, 31.61, 31.61,
30.59, 30.84, 30.98, 30.79, 30.79,
2020 Oct 18
1
Resultado de la consola como un tibble
Hola,
Bueno, puedes hacer el cálculo de una forma mucho más compacta y rápida.
Esta forma es especialmente recomendable cuando tienes muchas columnas y
muchas filas.
> library(data.table)
> myDT <- as.data.table(mtcars)
> myDTlong <- melt(myDT, measure.vars=1:ncol(myDT))
> myDTlong[ , list(p_value = shapiro.test(value)$p.value, v_stat =
shapiro.test(value)$statistic) , by
2024 Nov 05
0
lattice subscripts with both condition and group
How can I use subscripts to draw the last graph with one call to ? ? ? ? ? ? ? ? ? ? ? ??
function xyplot()? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
Thanks, ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
Naresh ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?
2011 Aug 31
1
formatting a 6 million row data set; creating a censoring variable
List,
Consider the following data.
gender mygroup id
1 F A 1
2 F B 2
3 F B 2
4 F B 2
5 F C 2
6 F C 2
7 F C 2
8 F D 2
9 F D 2
10 F D 2
11 F D 2
12 F D 2
13 F D 2
14 M A 3
15 M A 3
16 M A 3
17
2004 Aug 24
5
MMX/mmxext optimisations
quite some speed improvement indeed.
attached the updated patch to apply to svn/trunk.
j
-------------- next part --------------
A non-text attachment was scrubbed...
Name: theora-mmx.patch.gz
Type: application/x-gzip
Size: 8648 bytes
Desc: not available
Url : http://lists.xiph.org/pipermail/theora-dev/attachments/20040824/5a5f2731/theora-mmx.patch-0001.bin
2011 Mar 09
2
SQLDF - Submitting Queries with R Objects as Columns
Fellow R programmers,
I'd like to submit SQLDF statements with R objects as column names.
For example, I want to assign "X" to "var1" (var1<-"X") and then refer to
"var1" in the SQLDF statement. SQLDF needs to understand that when I
reference "var1", it should look for "X" in the dataframe.
This is necessary because my SQLDF
2003 Nov 14
1
plotmath problems with X11 fonts (Redhat 9)
We've only switched from redhat 7.3 to 9 several weeks ago, and
I found today, that the last three pages
of
demo(plotmath)
uses quite wrong plot symbols, e.g
sum(....) gives (+) {+ in circle} instead of the Sigma-like
summation --- but only in "text" not in title, i.e., probably a
font problem.
With postscript() {and hence dev.print() of x11()} all is fine.
Hence it must be an X
2002 Dec 23
2
can not connect to the shared printer
Hi there,
I'm learning Samba and I really appreciate somebody out there can help
me out. I'm using RedHat advanced server and a windows 2000. I created a
workgroup on samba and only samba machine and win2k machine are members.
I shared the printer attached to the Linux. From win2k PC, I can see the
workgroup, but I can not find the samba host from the workgroup, nor
does the printer.
2011 Jan 25
0
Linux acls problem with windows 7 and vista
Hei all,
Today I upgraded my samba which was a really old version 3.0.33 (I know) to 3.5. The upgraded seemed alright since I realize that I got a problem with the linux acls, I wanna say that I only have this problem with windows 7 and Vista, however windows xp works alright
To try to be concreted I will try to expose the problem with an example, the point is that I have a directory called
2011 Apr 13
1
Decimals in R/SQL
Hello,
When I am writing in sqldf or RSQLite I lose the decimals in my matrix.
The only way I can get decimals is by multiplying by 1.00000, etc. I
have tried manipulating the options, but it is only effective once I
multiply by 1.0000.
I appreciate any suggestions!
Thanks!
Example:
z <- sqldf ("select ST,
SUM(AGEP*PWGTP)*1.000000000/SUM(PWGTP)*1.00000000000000 as wgtage from
ss09
2010 Aug 09
2
coef(summary) and plyr
Dear all,
I?m having trouble getting a list of regression variables back into a dataframe.
mydf <- data.frame(x1=rnorm(100), x2=rnorm(100), x3=rnorm(100))
mydf$fac<-factor(sample((0:2),replace=T,100))
mydf$y<- mydf$x1+0.01+mydf$x2*3-mydf$x3*19+rnorm(100)
dlply(mydf,.(fac),function(df) lm(y~x1+x2+x3,data=df))->dl
here I?d like to use
ldply(dl,coef(summary)) or something
2015 Dec 17
1
File Share Problem Between SAMBA AND WINDOWS 7
Hi,
The output is when i run getfacl on a correct folder;
[root at server1 cafer]# getfacl Public# file: Public# owner: ege# group: gebzememuser::rwxgroup::r-xother::r-x
And second output; on a folder which was created on windows 7 by ege
[root at server1 cafer]# getfacl cccc# file: cccc# owner: 3000016# group:
2010 Jan 15
1
How to calculate the row wise means for grouped columns in matrix?
Hi all,
I want to calculate the row wise mean of groups of columns in a matrix M. All columns belonging to the same group have the same column name. My idea is to create a new vector V containing these column names, but after first removing the duplicates. Then I would calculate the means using for instance rowMean() and by comparing the column names of M with the vector V, getting the indices
2007 Jan 18
0
help with niave bayes
Hello
I have a rather simple code and for some reason it produces an error
message. If someone can tell me why and how to fix it, I would be very
greatful. Thank you in advance.
##### create data
set.seed(10)
n <- 200 # number of training points
n.test <- 200 # number of test points
p<-2 # dimension of input space
z <-
2020 Oct 18
2
Resultado de la consola como un tibble
Buen día
estimados
Estoy tratando de hacer un tibble con los resultados de un apply que se
muestran en la consola que me da R, no estoy seguro si eso se pueda hacer,
pero me gustaría organizar los resultados de esa manera.
mi código es:
data("mtcars")
Mtcars_matriz <- as.matrix(mtcars)
apply(Mtcars_matriz, MARGIN =2, FUN = shapiro.test)
DF2 <- tibble(Variable = NA, W = NA, Pvalue =
2007 Nov 08
2
hide unreadable files
Hi all!
I have a problem with the "hide unreadable = yes" option. In windows xp professional sp2 with explorer, or ssh or smbclient, either directories and files does not hide.
I'm using debian 4.0 with XFS file system, ACL, kernel 2.6.18-5-amd64, and samba 3.0.24.
Any idea? It is a bug?
Thanks!
--
Diego
_________________________________________________________________