Click here to Skip to main content
15,892,537 members
Everything / Programming Languages / R

R

R

Great Reads

by Andy Allinger
Add features to k-means for missing data, mixed data, and choosing the number of clusters
by Voevudko A. E., Ph.D.
Demonstrating a few approaches to generating and plotting fractals in R and offering R scripts realizing it.
by Amarnath S
An introduction to data analytics, using R, by taking a quick look at the state of World Health.
by Mr. xieguigang 谢桂纲
R# language is a kind of R liked language implements on .NET environment

Latest Articles

by Andy Allinger
Add features to k-means for missing data, mixed data, and choosing the number of clusters
by ToughDev
More about ST7735 1.8-inch 128×160 Color LCD on a PIC Microcontroller
by Mr. xieguigang 谢桂纲
R# language is a kind of R liked language implements on .NET environment

All Articles

Sort by Title

R 

7 Feb 2017 by Amarnath S
An introduction to data analytics, using R, by taking a quick look at the state of World Health.
16 Apr 2018 by Voevudko A. E., Ph.D.
Demonstrating a few approaches to generating and plotting fractals in R and offering R scripts realizing it.
30 Sep 2019 by Member 4206974
A Tcl -Tk Form Generator that can be used alone or used to provide a fast Form generation for language in which this activity can be complex
10 Jul 2017 by Voevudko A. E., Ph.D.
Demonstrating ability of the L-system in R, and offering helper functions able to plot all main categories of figures typical for the 2D L-system.
15 Jan 2023 by katebjork
I get single letter words in my Structural Topic Model after my preprocessing steps. Particularly after I stem my tokens. My code is as follows: #read the csv articletexts
6 Jun 2015 by Member 11742590
Hello, I have a problem with the allocVector () function. I wrote a code (DLL) in C that can be called in R. I would like to call a method of that DLL into my application in C#. The DLL code works fine but when the compiler reaches the next line SEXP Rout = PROTECT (RclustOut = allocVector...
16 Nov 2015 by girish sp
I have to work with c tree(Conditional Inference Trees) in my Asp.net project,i know c tree is directly not supported, so i am looking for the alternatives which i can start with, i came across r.net i cannot use it as it requires executable to be installed on client side, i went through the...
9 Jul 2017 by RS.Ratheesh
Hi, I am using RDotNet to execute RScript from my C# program. Is there any .net library available other than RDotNet. RDorNet is always causing the problem. Regards, Ratheesh What I have tried: I am using RDotNet to execute RScript from my C# program
9 Jul 2017 by Joezer BH
Another thing you can do is run the R code in process you create just for that task. See this code sample written by Jake Drew on stackoverflow: public static string RFromCmd(string rCodeFilePath, string rScriptExecutablePath, string args) { string file = rCodeFilePath; ...
16 Sep 2018 by nishant damani
Hello everyone i am a Business Intelligence developer working in SSIS, SSAS SSRS and SQL with 3 year of experience, now i want to take my career a step ahead and want to become data scientist so can anyone guide me on what to learn R or python, also what other things should i learn in order to...
28 Oct 2022 by smartcoder22
Hi all, One of my independent variable in a data that I want to use for Multinomial logistic regression has more than one text values in some of the cells i.e like high,higher or high,higher,highest . Can I use this variable as it is or is...
26 May 2022 by Gerry Schmitz
It's called "binning"; do what you need to do to the data to have it make sense for your particular "model". e.g. Height is almost meaningless (for most) unless it's in terms of short, medium, tall (i.e. range binning). ...
23 Sep 2016 by Member 12757084
test[,(factcols) := lapply(.SD, factor), .SDcols = factcols]factcols has a list columns for which the above needs to be applied. I am trying to understand what does .SD and .SDcols mean in the above code.Thanks in advance!!What I have tried:I am trying to understand what does .SD...
12 Oct 2019 by Kristina Hunter
I have a dataframe (df) with 4 columns: Start date, Stop date, Launch date, and NMBR (Usage amount - numerical value). I have another dataframe (usage) with two columns: time1 and usage. I am trying to check if each date in the time1 column in the usage dataframe falls between any of the start...
26 Dec 2016 by Fernando de Oliveira [MCP]
What if you could predict data using a cloud-based environment? You can do it with Azure Machine Learning.
3 Jul 2014 by Jake Drew
Full demo app using both C# and R interchangeably to rapidly identify and cluster similar images
11 Jan 2018 by muhammad ramzi
Making a commercial type of statistical business software What I have tried: I am learning R and C++ in hope of creating a type of statistic business software
11 Jan 2018 by OriginalGriff
Quote: I am considered an intermediate in R and also C++ what kind of programming language I could take up and learn to make a commercial statistical software ? Any of them, depending on environment. If you want a web app, you want a server language (VB, C#, C++, PHP, ...) and client language -...
11 Oct 2022 by Kevin Thomas Oct2022
def staircase(n): for i in range(0,n): for j in range(0,n): if i + j >= n-1: print("#",end='') else: print(" ",end='') print('\n') staircase(4) What I have tried: ...
11 Oct 2022 by Kevin Thomas Oct2022
mariostairs
25 Apr 2018 by Member 13799198
Hi! I would like to convert the below SAS code into R code. It would be great help for me! Thanks in advance! %let NN=1000; proc iml; cov={1 .1 .1 .1 .1, .1 1 .1 .1 .1, .1 .1 1 .1 .1, .1 .1 .1 1 .1, .1 .1 .1 .1 1 }; M=5; h={[5].2}; Rcvr={[5].2}; T={[&NN]0}; VL={[&NN]0}; VR={[&NN]0};...
25 Apr 2018 by OriginalGriff
We do not provide a code conversion service, and code conversion rarely produces good code in the target language anyway: either learn SAS plus R and convert it yourself, work out what the SAS code is doing and recode that functionality in R, or find R code that does the same job.
18 Dec 2015 by Member 12216251
I am trying to calculate a regression variable based on a range of variables in my data set. I would like the regression variable (ei: Threshold 1) to be calculated using a different variable set in each iteration of running the regression.Data (df)is composed of variables: Yield, Prec,...
14 Aug 2017 by Intel
In this article, we discuss our teachings about data science in a series of steps so that any product manager or business manager interested in exploring this science will be able take their first step toward becoming a data scientist or at least develop a deeper understanding of this science.
7 Aug 2016 by MohamedKamalPharm, Omneya Hassanain, Nouran Yasser, Fatma Abdelhameed
Simulation Model to plan the capacity of an oncology Hospital with limited number of beds. The R script is run on R Studio or called from PHP.
25 Mar 2017 by OriginalGriff
We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.Try it yourself, you may find it...
13 Sep 2022 by Jason Garcia Jr.
'''(r setup, include=FALSE) knitr:opts chunk$set(echo= TRUE) Read in the data provided and save it as a variable called "data" '''(r) ''' use c() and cbind() to add a numerical column from 1:19 to "data". Order it as the first column. '''(r)...
13 Sep 2022 by OriginalGriff
If you are having problems getting started at all, then this may help: How to Write Code to Solve a Problem, A Beginner's Guide[^]
6 May 2018 by Member 13658733
for(i in 1:dim(dataset)[1]){ hitlist=trainmy2[trainmy2$VisitNumber==dataset[i,2],] dayofweek=names(hitlist)[3:9][hitlist[1,3:9]>0] dataset[i,dayofweek]=1 hitlist2=Copy_Walmart[Copy_Walmart$VisitNumber==dataset[i,2],] agg=aggregate(ScanCount~DepartmentDescription,data=hitlist2,sum) ...
22 May 2022 by Richard MacCutchan
Have you checked the documentation to see if it requires some external library? Quote: Thank you very much, Richard, indeed , I have managed to resolve this, there was a requirement for Janitor package to be installed. I have added these...
22 May 2022 by smartcoder22
Am just starting out in R and machine learning. Am working on a hierarchical clustering problem where after getting clusters of attitudinal variables (e.g preference for a certain choice), I want to do target segmentation by combining the cluster...
22 Nov 2020 by Member 14999754
Hello, i tried following ways but none of them worked 1. trying to install rpy2 (version 2.9.4) using anaconda, facing error of python version unsatisfied (when python == 3.8.3 or anything over python==3.7.1). 2. when tried same using pip...
22 Nov 2020 by Richard MacCutchan
rpy2 3.3.6· PyPI[^]
22 Feb 2019 by Member 13233096
I am using R studio, Now i want to install LightGBM for window. I have Installed Git for Window, CMAKE and MINGW64. The path of GIT is C:\Program Files\Git\bin and the path of CMAKE is C:\Users\MuhammadMaqsood\Downloads\cmake-3.13.3-win64-x64\bin I have set...
9 Jul 2017 by Smartguy3k
Hi, I am trying to run few spark commands using SparkR (from local R-GUI). For setting up the spark cluster on EC2 I used most of the commands from ( https://edgarsdatalab.com/2016/08/25/setup-a-spark-2-0-cluster-r-on-aws/) with little modification to install the latest versions. All I was...
7 May 2023 by ToughDev
More about ST7735 1.8-inch 128×160 Color LCD on a PIC Microcontroller
25 May 2016 by Bud Gressett
Explaining Naïve Bayes
8 Feb 2016 by Daniel 11317535
Autodeploy case36 using R
12 May 2019 by Patrice T
We are not their support service, try to contact them or the author.
12 Aug 2015 by Vinayak Bakshi
I'm going through coursera R progrmming course. the assignment question im doing is as follows:Write a function that reads a directory full of files and reports the number of completely observed cases in each data file. The function should return a data frame where the first column is the...
12 Aug 2015 by Patrice T
I recommend to use the debugger.run the program step by step, you will see where is the error.You will be able to inspect variables.
22 Nov 2016 by Miguel Diaz Kusztrich
Using R to explore complexity of time series generated by simple process
3 Jun 2017 by Voevudko A. E., Ph.D.
Generating and plotting random Voronoi Diagrams and offering web-page supporting it and R scripts.
19 Apr 2021 by debbie oomen
I'm having a tough time figuring this out and I will try to explain where I need help the best I can. I have a dataframe consisting of participant ID (column 1), possible dates of an appointment for that participant (column 2, ranging from V1 to...
2 Nov 2016 by vipulkumar patel
Here is an example xml webpage I am accessing and parsing with XML package in R. I am interested in accessing the following information. and ,Here is the code I am running but it extract the first comment node regardless of...
4 Mar 2020 by Trey Lewis
Hi, Im working on an survey analysis and found SAS code that creates what I want to do but I do not have SAS. Can anyone help me translate this code to R LABEL SUSCEP = 'Susceptibility Index'; if &CR7SUSCEP.=1 then do; if &CR12SUSCEP. IN...
12 Oct 2021 by chin21504
I am trying to create a new datframe using paste0 function and i need to copy an existing dataframe into it. e.g. ty 1) { Paste0("mynewdata",ty)
4 Jun 2015 by Member 11742590
Hello, I have question please. I am currently developing an application in C# that communicates with the libraries (DLL) coded in C or C++. These DLLs are created to be called from R. In most of existing methods in the DLL, there is a variable that is not known to me. His name is SEXP. What I...
4 Jun 2015 by Dave Kreskowiak
If it's a type you're referring to, you're going to have to consult with the people that wrote the .DLL to find out what that type is. From that information you can code up an equivalent type in C# or whatever.SEXP is not a standard type in any language.
27 Oct 2022 by MKGoal25
I have a dataframe including 520 individual identification #s and their frequency count over 10 bin/indices. I want to fit nls() for each of them & save their coef and r^2 values each in a new column. structure(list(User.ID = c("37593", "38643",...
31 Aug 2021 by Member 15336701
I can't figure out how to create letter 'J' and 'K' using point plots in r the following code builds an H. x=c(rep(0,500),seq(0,1,length.out=1000), rep(1,500)) y=c(seq(-1,1,length.out=500),rep(0,1000), seq(-1,1,length.out=500)) z=rbind(x,y)...
15 Aug 2018 by KeyurKelkar
Hello, I am trying to open an interactive session of R from Wine. I need to run R from the Rhel7 host as I have recompiled it specifically for my purpose. I am having trouble with (1) Opening R in the host from Wine, by way of commands, and (2) ensuring that R from the Rhel7 host is kept open...
15 Aug 2018 by Richard MacCutchan
Please do not repost the same question, you already asked this at How to open an interactive bash shell from wine (in RHEL7)[^]
20 Oct 2022 by Member 14991075
I would like to create/convert a .r script (in R studio) to an executable - batch(.exe) file. Which command should I use? What I have tried: chmod +x test.R in cmd - command window
20 Oct 2022 by Richard MacCutchan
The chmod command merely sets a file permission, it has no effect on the file contents. You need to check the R documentation to see if there is a command to do it. Alternatively a Google search may find something.
13 Mar 2022 by loop063
I have a 15x15 matrix with strings of "0"s and "1"s. I need to find the number of columns that have only one "0". Note that the variables in the matrix are strings, not numerics What I have tried: colSums(m1=="1", na.rm=TRUE)
26 Apr 2018 by Member 13800477
So I have a data frame with 2 columns that have TRUE and FALSE values. I want to find the rows that contain TRUE for both columns in a given row, and create a vector with Boolean values, only outputting TRUE if it meets the criteria above. E.g. dat
20 Mar 2017 by OriginalGriff
We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.Try it yourself, you may find it...
1 Jun 2018 by Member 13440232
I am having my very first experience with data tables. I have a data table "dt" created using: dt A B C D E 1: -1.6288978 -1.6288978...
30 Dec 2022 by Member 15880441
Hello everyone! I am currently working on outlier detection for a highly skewed data which is also heavy tailed. I wanted to use the generalized boxplot as mentioned in the research paper of (Bruffaerts, et al., 2014). However, I don't know...
23 Oct 2021 by Kevin Paul 2021
Hi I am working on an Amazon dataset which does not follow the traditional row and column format. Kindly advice on the best way to convert this into a easily manipulatable dataset in R. Thank you Dataset: ...
13 Jan 2022 by Pizzle15
Error in do_one(nmeth) : NA/NaN/Inf in foreign function call (arg 1) What I have tried: I have tried converting the fields to numeric and remove all duplicates
13 Jan 2022 by _Asif_
This error occurs mostly due to non numeric values present in the table. Please check this as it explains a bit detail with real example r - Error in do_one(nmeth) : NA/NaN/Inf in foreign function call (arg 1) - Stack Overflow[^]
15 Oct 2020 by OriginalGriff
Read the question carefully. Re-read your course notes. Then read this: How to Write Code to Solve a Problem, A Beginner's Guide[^] Then re-read the question and think about the task it describes. Give it a try - this isn't a complicated...
15 Dec 2020 by OriginalGriff
This is not a code conversion service: we are not here to translate code for you. Even if we did, what you would end up with would not be "good code" in the target language – they are based on very different frameworks, and what makes something...
23 Sep 2021 by Member 14007867
I have imported a new set of data, it's called "data2". When I put View(data2) a new window opened with all of my data. There are 4 variables in my data: house_size, number_of_beds, price.of.house., and Region (A,B,C,D,E). My mission is that I...
4 Nov 2015 by Member 12114684
I would like to use the apply() function and create an object called 'Item.IQR' that contains the interquartile range of each of the first four columns of "iris". How do I go about doing this? I am new to R and I'm not even sure how to navigate the iris dataset. Could someone please help me...
17 Oct 2018 by Member 14023742
Distance Write a function find_distance() that returns the distance between two given points. You should be able to call the function like this: # coordinates for point-1 and point-2 p1
17 Oct 2018 by Patrice T
Quote: This is in R. Please help! I am new at programming , and I am completely lost So, you show no attempt to solve the problem yourself, you have no question, you just want us to do your HomeWork. HomeWork problems are simplified versions of the kind of problems you will have to solve in...
17 Oct 2018 by Richard MacCutchan
R: The R Project for Statistical Computing[^]