how to assign locations as cluster centroids and run clustering to find the...
use the centroid coordinates as centroids and cluster the rest of the locations around them as per the nearest one.Centroid <- data.frame (longitude =c( -1.482880, -1.485735), latitude = c(...
View ArticleHow to default the selector in web scraping in r?
I am extracting information on different topics from specific objects. In the first part, when I wrote the code, the selectors provided the specific information I was looking for. However, each object...
View ArticleExtract name of data.frame in R as character
How can I extract the name of a data.frame in R as a character? For example, if I have data.frame named df, I want to get "df" as a character object.
View ArticleTraMineR using SPELL or TSE format
I am trying to create a sequence plot using data of behaviour states over time. My data is in long format - I have tried to change this to wide format however there are too many time values to do so....
View ArticleHow can I use mutate() to produce a series of items from an external list...
I have data in the form of ID and food:adf<-data.frame(ID=c("a","a","a","b","b","b","b","c","c"), foods=c("apple","orange","banana","apple","banana","tomato","pear","pear","onion")) I also have a...
View Articlescores returned by the alpha function in psych pkg are incorrect
Please consider the following code to obtain scores from the alpha functionlibrary(psych) vars <- c('mpg', 'cyl', 'disp', 'hp') df <- mtcars[0:10, vars] alpha_results <- alpha(df,...
View ArticleR: Linear or GLM: weighted results: wls:
So probably a basic enough questionWhat i want to achieve is to do a regression of lapse rates on savings type policies. So say person a in one yr withdraws 10 out of 100 and person b 10 out of 50. So...
View ArticleRun nlrx simulation with deterministic parameter variation
I want to run the simple netlogo fire model with the nlrx package with different values for density... but I don't want to do it stochastically but deterministically (systematically), i.e. vary density...
View ArticleDeleting specific observations from a data frame. Those specific observations...
I have a big data frame with 6 million observation. From the column ID (that may have lots of duplicated values because I only have approximately 400k unique ID) I want to remove all ID that I have...
View ArticleCan I use the Anova (type II) to test significance in my negative binomial...
I have fitted a binomial regression (glm.nb using the MASS package) to my data. I have two questions and would be very thankfull if you could answer any of them: 1a) Can I use the Anova (type II, car...
View ArticleShiny - rintrojs on different tabset
I'm developing an interactive help in Shiny and obviously the choice was rintrojs.When I look into the example and the doc I found a little ugly to add to every element we want the interactive help the...
View Articler: zApply in parallel computing
I need to aggregate a rasterbrick into monthly values. Normally, this would be easy by using zApply function from raster package. However, I have a large rasterbrick and this would take a very long...
View Articlefill matrix with numbers in each row to create a parttern
I'm trying to generate a trip parttern using a matrix. Glastonbury Munich Venice Paris Ibiza Kamar-Taj [1,] 1 2 3 4 5 6 [2,] 1 2 3 4 5 0 [3,] 1 2 3 4 0 0 [4,] 1 2 3 0 0 0 [5,] 1 2 0 0 0 0 [6,] 3 2 1 4...
View ArticleHow can I look up values which are indirectly linked to my dataframe?
I'd like some ideas/solutions for the following example. I have two tables, deals.df and turnover.df. Please see a toy example below which reflects what they look like:deals.df <- data.frame(DealID...
View ArticleHow to choose the best regression model
For my statistics analysis, I try to understand the variables that influence collaboration of Europese universities with china. At this point in time, de DV = Chinese publications/total publications of...
View ArticleHow to do a for-loop to establish the linear relationship between two...
I have two devices that record similar data but in a different way: V13 and X16. V13measures activity of an animal in a window of 57 seconds starting 57 seconds before the DateTime we have in our...
View Articlespecies richness in iNEXT
I use a package iNext in R for obtain rarefaction curve. I have the result and actually i want to put in this curve a labels of estimated number species, and an observed number species. please, one can...
View ArticleAutomate date formatting
Data contains a column "date range" that contains 2 months i.e. Oct 31,2019-Nov 30,2019 (November) and Dec 1,2019-Dec 31, 2019(December). Need to separate them in different columns under Post Period...
View Articleworking within google translation api requested limit
I have this dataframe that contains with 41,000 rows of Flickr tags with non-english words. Example:column1 column2 column3 amsterdam het dag calamiteit bij doen gratis dag 2015 rotterdam blijdorp...
View ArticleHow to delete many occurrences of a symbol within comments in an XML file in...
I need to delete several occurrences of a symbol (single quote) within comments in an XML file in R, and then save it back to XML. I have to do this in 1000s of XML file. In each XML file the single...
View Article