search for: my_data

Displaying 20 results from an estimated 64 matches for "my_data".

Did you mean: mc_data
2011 Mar 14
3
increase a value by each group?
Hi everybody. I'm looking for the way to increase the depth value in 0.01 for each index group. Easier to explain with this example: >my_data=read.table("clipboard", header=TRUE) Depth s_name index 3852 Site_1 144 3852 Site_1 144 3852 Site_1 144 3852 site_A 145 3852 site_A 145 3852 site_A 145 3852 site_A 145 3852 site_B 147 3852 site_B 147 3852 site_B 147 3852 site_B 147 54962 site_C 27 54962 site_C 27 54962 Site_D 217 54962 S...
2012 Mar 23
1
R conditional matrix operations - advanced condition
Hello List! I stumbled across an efficiency problem - calculation that would be probably done very fast as a matrix operation I must perform as a for-loop. My intention was to do a conditional operation in matrix depending on the information in first column (summing as many data points from vector my_data as the number specified in the first column of the matrix) but the result is that the function takes the condition only from the first row of column for calculations in every row. Is it possible to solve this problem as a matrix calculation or I have to iterate over each row? (which I suppose is mu...
2011 Feb 23
0
Problem with Mclust
...a must be one-dimensional In addition: There were 42 warnings (use warnings() to see them) Can anyone tell me what I am doing wrong? Many thanks Lorenzo ############################ library(mclust) rm(list=ls()) #Define the training dataset sel_col <- c(1,2,4) sample_percentage <- 0.9 my_data <- read.csv("http://dl.dropbox.com/u/5685598/dataedges.csv", header=FALSE) my_data <- as.matrix(my_data) set.seed(1234) ms <- sample(seq(sample_percentage*dim(my_data)[1])) train_set <- my_data[ms, sel_col] my_labels <- my_data[ms,-sel_col] train...
2013 Jan 17
3
how to use "..."
...n' is the function that will be run to aggregate stat.group <- function(dat, vec_cat, stat_fun){ require(doBy) df <- summaryBy(as.formula(paste0(".~",paste0(names(dat)[vec_cat],collapse="+"))), data=dat, FUN=stat_fun) return(df) } Example, works fine: my_data <- structure(list(cat = structure(c(1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L), .Label = c("A", "B"), class = "factor"), varnum = c(-0.754816565434373, -1.94101630973709, -0.102461836059522, -0.519952759645808, -1.73772800855664, -1.13939178585609, 0.522356715260142,...
2008 Jul 17
0
Re : float and double precision with C code
...t 8:47 AM, JS Ubei <jsubei at yahoo.fr> wrote: > Hi all, > > There is a mistake for wich I need your ligths : > > /////////////////////////////////////// > > I have a small C code : > > SEXP testData() > { > SEXP result; > void * rans; > float * my_data; > int my_data_length; > > my_data_length = 2; > my_data = new float[my_data_length]; > > my_data[0] = 29.958334; > my_data[1] = 29.875; > > PROTECT(result = allocVector(REALSXP, my_data_length)); > rans = (void *)REAL(result); > > for(int...
2008 Jul 17
0
Re : Re : float and double precision with C code
...t 8:47 AM, JS Ubei <jsubei at yahoo.fr> wrote: > Hi all, > > There is a mistake for wich I need your ligths : > > /////////////////////////////////////// > > I have a small C code : > > SEXP testData() > { > SEXP result; > void * rans; > float * my_data; > int my_data_length; > > my_data_length = 2; > my_data = new float[my_data_length]; > > my_data[0] = 29.958334; > my_data[1] = 29.875; > > PROTECT(result = allocVector(REALSXP, my_data_length)); > rans = (void *)REAL(result); > > for(int...
2011 Apr 10
2
Multinomial Logit Model with lots of Dummy Variables
...also need a more powerful PC to do all of this). I'll also want to perform a joint test of significance on the first 805 coefficients... Is this possible? Thanks GP [code] #install MLOGIT library(mlogit) #load mydata mydata = 0 mydata<-read.csv(file="G:\\data.csv",head=TRUE) my_data=0 num.rows=length(mydata[,1]) num.cols=965+805+1 my_data=matrix(0,nr=num.rows,nc=num.cols) for(i in 1:num.rows) { nb=mydata[i,2] np=mydata[i,3] my_data[i,nb]=1 my_data[i,965+np]=1 my_data[i,1+1770]=mydata[i,1] } #convert matrix to data.frame # convert to data frame my_data_frame<-...
2006 Dec 28
2
lattice xyplot: plot multiple lines with different colors
...one, I am using the lattice package to plot some simulation results, by using the function xyplot(). However, I cannot find a way to plot multiple lines within the same xyplot and to have each of the lines be drawn in a different color. This is what I am currently doing: xyplot(a + b + c ~ x, my_data, panel = panel.lines) but, of course, all lines are drawn in the same color. What I would prefer, would be to first print a single line in an xyplot and then add a new line, and so on (since I want to dynamically determine the number of lines that need to be plotted). For example, something l...
2005 Oct 22
0
Getting univariate information from a multivariate data set
A quick question that I've had only partial success in answering. I have a multivariate dataset, and would like to extract some simple univariate information from it grouped by treatments, etc. I am encountering two problems however Note: I am importing my data with my_data <- read.csv("/path/data.csv") 1) Scoping of unstack If I attempt sorted_data <- unstack(response, response ~ treatment, data=my_data) I get Error in unstack(response, response ~ treatment, data=my_data): Object response not found However, if I first use attatch(my_data) and d...
2011 Dec 27
1
How to extract an interval of "hour:minute" type
Hi, I 'd like to know how to extract an interval of "hour:minute" type from a column of POSIXlt POSIXct type. For instance: my_data.csv: 4352;2011-09-02 21:30:00;3242; 4352;2011-09-02 21:31:00;3315; 4352;2011-09-02 21:32:00;4241; 4352;2011-09-02 21:33:00;5394; ... 4352;2011-09-02 01:02:00;67; 4352;2011-09-02 01:03:00;67; 4352;2011-09-02 01:04:00;67; .... I loaded my_data.csv into a data.frame. I 'd like to sel...
2018 May 10
4
the first name of the first column
Dear all; I need to run heatmap. Because my first column in my data is alphanumeric, I can not run as.matrix(scale(my_data)). So I need to make my data readable as in data(mtcars). In *mtcars *data the first column is alphanumeric and has no name. Thanks, Greg [[alternative HTML version deleted]]
2012 Aug 04
1
Getting unknown error trying to plot spatial data
...2012/6/19/notes-from-a-recent-spatial-r-class-i-gave.html) and am running into an error that I can't figure out how to fix. Disclaimer: I am very much an R n00b Here is the r script I am running: https://dl.dropbox.com/u/28231177/This%20Should%20Work.R data: https://dl.dropbox.com/u/28231177/my_data.csv shapefile: https://dl.dropbox.com/u/28231177/sfzipcodes.zip I am getting two errors: > pds <- fortify(sf_map) *Using OBJECTID to define regions.* > pds$OBJECTID <- as.integer(pds$OBJECTID) *Error in `$<-.data.frame`(`*tmp*`, "OBJECTID", value = integer(0)) : repla...
2007 Jan 30
3
How to find series of small numbers in a big vector?
...ANY and ALL the "series" or "sequences" in that vector where ever there are 5 or more members in a row between 0.021 and 0.029 ? For example: search_range <- c (0.021, 0.029) # inclusive searching search_length <- 5 # find ALL series of 5 members within search_range my_data <- c(0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.028, 0.024, 0.027, 0.023, 0.022, 0.900, 0.900, 0.900, 0.900, 0.900, 0.900, 0.024, 0.029, 0.023, 0.025, 0.026, 0.900, 0.900, 0.900, 0.9...
2006 May 18
5
Overriding default DELETE behavior with logical deletes
Hello! I am trying to figure out how to implement *logical deletes* instead of physical deletes using ActiveRecord. Basically, in many applications that deal with E-Commerce, you really can''t physically delete almost anything, because records must be kept for auditing and customer service tracking purposes. In the past, I''ve implemented logical deletes as follows: 1.
2024 Feb 24
1
Interactions in regression
...se mentioned interactions. This is not likely to be used in publications (including three base levels), but from the point of view of solving the topics this questions have interested me. I tried myself to make it happen, but so far without success. I recall this reprex based on SO: set.seed(1000) my_data <- rbind( data.frame(time = "Pre", treatment = "Control", response = rnorm(100, mean=1)), data.frame(time = "Pre", treatment = "Treatment", response = rnorm(100, mean=2)), data.frame(time = "Post", treatment = "Control", response...
2019 Aug 14
2
Re: [PATCH libnbd 1/4] api: Combine callback and user_data into a single struct.
...int *error); > } nbd_completion_callback; > > The nbd_aio_pread function can now be called using: > > nbd_aio_pread (nbd, buf, sizeof buf, offset, > (nbd_completion_callback) { .callback = my_fn, > .user_data = my_data }, Is it worth arranging the C struct to match the typical argument ordering of user_data last? It doesn't make any real difference (the struct size doesn't change, and the compiler handles out-of-order member initialization just fine), but doing it could allow the use of: nbd_completion...
2011 Oct 31
5
Kaplan Meier - not for dates
I have some data which is censored and I want to determine the median. Its actually cost data for a cohort of patients, many of whom are still on treatment and so are censored. I can do the same sort of analysis for a survival curve and get the median survival... ...but can I just use the survival curve functions to plot an X axis that is $ rather than date? If not is there some other way to
2015 Jul 27
8
[Bug 11414] New: rsync: chgrp "/.filename.5afK5X" (in dirdir) failed: Operation not permitted (1)
https://bugzilla.samba.org/show_bug.cgi?id=11414 Bug ID: 11414 Summary: rsync: chgrp "/.filename.5afK5X" (in dirdir) failed: Operation not permitted (1) Product: rsync Version: 3.1.1 Hardware: x64 OS: Linux Status: NEW Severity: normal Priority: P5
2017 Nov 06
0
[Bug 11414] rsync: chgrp "/.filename.5afK5X" (in dirdir) failed: Operation not permitted (1)
...prich at redhat.com> --- I stumbled upon this bug and I have a question. I get the chgrp error even when running the daemon as root. #ps -aux | grep rsync root 18486 0.0 0.0 114696 568 ? Ss 09:41 0:00 rsync --daemon I have configured a module in /etc/rsyncd.conf like this: [my_data] comment = test dir for rsync path = /home/tester read only = no uid = tester gid = tester Now when I try to copy file 'data' to this module: # rsync -av data localhost::my_data sending incremental file list data rsync: chgrp "/.data.CFttwz" (in my_data) faile...
2009 Dec 16
0
lasso regression coefficients
...his method works so as to later implement it on larger datasets. I thus create an input vector x: * x=rnorm(10)* I add some noise * noise=runif(n=10, min=-0.1, max=0.1)* and I create a simple linear model which calculates my output vector y * y=2*x+1+noise* I then do * my_data <- data.matrix(x) model = lars(my_data, y, type = 'lasso')* I then calculate the coefficients (type="coefficients") based on the created *model ** preds=predict.lars(model) for(i in 1:10){ est[i]=preds$coef[2]*x[i] } y.e...