similar to: Efficient passing through big data.frame and modifying select

Displaying 20 results from an estimated 500 matches similar to: "Efficient passing through big data.frame and modifying select"

2017 Jul 05
0
expand gridded matrix to higher resolution
You probably ought to be using the raster package. See the CRAN Spatial Task View. -- Sent from my phone. Please excuse my brevity. On July 5, 2017 12:20:28 AM PDT, "Anthoni, Peter (IMK)" <peter.anthoni at kit.edu> wrote: >Hi all, >(if me email goes out as html, than my email client don't do as told, >and I apologies already.) > >We need to downscale climate
2017 Jul 05
4
expand gridded matrix to higher resolution
Hi all, (if me email goes out as html, than my email client don't do as told, and I apologies already.) We need to downscale climate data and therefore first need to expand the climate from 0.5deg to the higher resolution 10min, before we can add high resolution deviations. We basically need to have the original data at each gridcell replicated into 3x3 gridcells. A simple for loop can do
2017 Jul 05
0
expand gridded matrix to higher resolution
Hi Peter, apply(t(apply(mm,1,rep,each=3)),2,rep,each=3) Jim On Wed, Jul 5, 2017 at 5:20 PM, Anthoni, Peter (IMK) <peter.anthoni at kit.edu> wrote: > Hi all, > (if me email goes out as html, than my email client don't do as told, and I apologies already.) > > We need to downscale climate data and therefore first need to expand the climate from 0.5deg to the higher
2009 Mar 09
5
Help
Hello Everyone, I am trying to excess the inbuit .Fortran and .C codes of R. Can any one help me in that. For example in kmeans clustering the algorithms are written in .Fortran I want to access them and see the .Fortran syntax of the codes. Can any one help me how can I do that? Thanx, Nitin Kumar On Thu, Nov 27, 2008 at 12:00 PM, <r-help-request@r-project.org> wrote: > Send R-help
2008 Nov 25
0
Efficient passing through big data.frame and modifying select fields
Hi all, I have relatively big data frames (> 10000 rows by 80 columns) that need to be exposed to "merge". Works marvelously well in general, but some fields of the data frames actually contain multiple ";"-separated values encoded as a character string without defined order, which makes the fields not match each other. Example: > frame1[1,1] [1] "some;thing"
2012 Feb 26
1
Matrix problem to extract animal associations
Dear List, I have been trying to extract associations from a matrix whereby individual locations are within a certain distance threshold from one another. I have been able to extract those individuals where there is 'no interaction' (i.e. where these individuals are not within a specified distance threshold from another individual) and give these individuals a unique Group ID containing
2018 Feb 25
1
reshaping column items into rows per unique ID
Hi Allaisone, I took a slightly different approach but you might find this either as or more useful than your approach, or at least a start on the path to a solution you need. df1 <- data.frame(CustId=c(1,1,1,2,3,3,4,4,4),DietType=c("a","c","b","f","a","j","c","c","f"),
2018 Feb 25
0
reshaping column items into rows per unique ID
I believe you need to spend time with an R tutorial or two: a data frame (presumably the "table" data structure you describe) can *not* contain "blanks" -- all columns must be the same length, which means NA's are filled in as needed. Also, 8e^5 * 7e^4 = 5.6e^10, which almost certainly will not fit into any local version of R (maybe it would in some server version --
2008 Dec 23
1
quotation problem/dataframe names as function input argument.
Dear R friends: Can someone help me with the following problem? Many thanks in advance. # Problem Description: # I want to write functions which take a (character) vector of dataframe names as input argument. # For example, I want to extract the number of observations from a number of dataframes. # I tried the following: nobs.fun <- function (dframe.vec) { nobs.vec <-
2012 Mar 30
1
How to use access results of gregexpr in data frames
Hello, I'm trying to figure out how to find the index of the second occurrence of "/" in a string (which happens to represent a date) within a data frame column. I've used the following code successfully to find the first instance of "/". dframe <- data.frame(date=c("5/14/2011", "4/7/2011")) dframe$x1 <- regexpr("/", dframe[, 1])
2011 Jun 09
3
How to subset based on column name that is a number ?
Hi, I have a data frame with column names "1", "2", "3", ... and I'd like to extract a subset based on the values in the first column. None of the methods I tried worked (below). x <- subset(dframe, 1 = = "My Text") x <- subset(dframe, "1" = = "My Text") x <- subset(dframe, names(dframe)[1] = = "My Text") Q
2009 Apr 02
1
problem with svyglm()
Hello, I'm trying to use the function svyglm in the library survey. I create a data survey object: data_svy<- svydesign(id=~PSU, strata=~sample_domain, weights=~sample_weight, data=data, nest=TRUE) and I try to use svyglm() with little success: R<-svyglm(data_svy[,4]~(data_svy[,iCol]==listModality[[iVar]] [iMod]),design=data_svy, family=binomial(link="logit") Error in
2017 Nov 22
1
assign NA to rows by test on multiple columns of a data frame
...well, I don't think this is exactly the expected result (see my post) to be noted that the columns affected should be "A" and "B" thanks for the help max ----- Messaggio originale ----- Da: "Rui Barradas" <ruipbarradas at sapo.pt> A: "Massimo Bressan" <massimo.bressan at arpa.veneto.it>, "r-help" <r-help at
2018 Feb 25
4
reshaping column items into rows per unique ID
Hi All I have a datafram which looks like this : CustomerID DietType 1 a 1 c 1 b 2 f 2 a 3 j 4 c 4 c 4 f And I would like to reshape this so I can
2005 Nov 09
2
error in NORM lib
Dear alltogether, I experience very strange behavior of imputation of NA's with the NORM library. I use R 2.2.0, win32. The code is below and the same dataset was also tried with MICE and aregImpute() from HMISC _without_ any problem. The problem is as follows: (1) using the whole dataset results in very strange imputations - values far beyond the maximum of the respective column, >
2010 Oct 13
4
Change global env variables from within a function
Hi, I've looked all over for a solution to this, but haven't had much look in specifying what I want to do with appropriate search terms. Thus I'm turning to R-help. In the process of trying to write a simple function to rename individual column names in a data frame, I ran into the following problem: When I rename the columns within my function, I can't seem to get it to
2006 Jan 20
3
Selecting data frame components by name - do you know a shorter way?
Hi! I suspect there must be an easy way to access components of a data frame by name, i.e. the input should look like "name1 name2 name3 ..." and the output be a data frame of those components with the corresponding names. I ´ve been trying for hours, but only found the long way to do it (which is not feasible, since I have lots of components to select):
2011 Jul 08
1
Referencing a vector of data labels in ggplot function
Hi, I really feel I've looked everywhere, although I know this can't be a hard problem. I'd like to be able to call the graph below as a function, but I can't get the function to recognize variables beyond 'dframe'. I've read through many papers on writing functions in R, but I can't get this to work. data <- data.frame('date' = as.Date(rep(c(15101,
1999 Oct 19
2
Summary bug?
Hi, It seems that there's a bug in summary, in the max. output... but max() alone works fine. > hw04.dframe$area ... [41] 1790 1380 1296 2745 798 2306 438649 1481 1559 2450 ... > summary(hw04.dframe) area Min. : 798 1st Qu.: 1349 Median : 1690 Mean : 6962 3rd Qu.: 2306 Max. :438600 ### should read 438649 or, to the point,
2017 Nov 22
0
assign NA to rows by test on multiple columns of a data frame
Hello, Try the following. icol <- which(grepl("flag", names(mydf))) mydf[icol] <- lapply(mydf[icol], function(x){ is.na(x) <- x == 0 x }) mydf # A A_flag B B_flag #1 8 10 5 12 #2 7 NA 6 9 #3 10 1 2 NA #4 1 NA 1 5 #5 5 2 0 NA Hope this helps, Rui Barradas On 11/22/2017 10:34 AM, Massimo Bressan